|
|
| Author |
Message |
munna_ibm
New User
Joined: 23 Apr 2005 Posts: 16 Location: chennai
|
|
|
|
Hi ,
I have some doubt , a file(sequential/vsam) accessing by Cobol can be accessed by the assembler program? if so the o/p will be the same or it will differs. Because I have one assignment with layout of
Train Record:
Train No. 1 Byte
Train Name 20 Chars
Date of Travel XL4 (No sign)
Time XL2 (No sign)
Train Attributes 1 Bit - Pantry
1 Bit ? A/C
1 Bit ? Security
5 Bits - Filler
Origin 3 Chars
Destination 3 Chars
Price of Ticket PL3
TRN DC X'65',CL20'MAA-BAN EXP',X'20030301',X'1035',B'11100000'
DC CL3'MAA',CL3'BAN',P'15000'
In Cobol copy book how can we create the structure for this file, like the train no. X'65' in hexadecimal, if we choose the packed decimal in Cobol it will occupies s9(02) comp-3 as 2 bytes with sign, but in assembler with out sign we can very well embedded two digits in single byte. Like this Date of travel X'20030301' and Time X'1035' how can we do it with same bytes occupied in asm, with same bytes in Cobol with out sign.
The copybook layout in Cobol will occupy more bytes than asm, then it will reflect the length of the bytes in file.
If we can't create with the same structure with same bytes in asm as well as in Cobol then how can we access the same file(seq/vsam) in Cobol and asm? if we access then the o/p should be differ ???.. this is as per my concern.
Even I created a copy book in asm and tried to edit(enter/feed) data in file-aid, but file-aid not supporting asm copy book.
If at all is it possible to create a copy book same in asm/Cobol and also possible to access the asm copy book layout. Plz guide me how to create it and what option have to specify. If possible plz thru an example with the above structure it will be very helpful to me.
Finally I want to code the program in assembler which it will uses these files.
If you have any clarification plz mail to me or call me.
Please support me in this issue. |
|
| Back to top |
|
 |
References
|
Posted: Thu Apr 13, 2006 12:43 pm Post subject: Re: A file(seq/vsam) accessing by Cobol can be accessed by assem |
 |
|
|
 |
Bharanidharan
Active User
Joined: 20 Jun 2005 Posts: 100 Location: Chennai, India
|
|
|
|
From your posting, here is what I gathered:
1. You would like to know the cobol structural equivalent of asm for hex data type.
2. How to access VSAM thru assembler.
For item 1, try binary (COMP) in cobol, and code the constants as you wish. It would work the same way as asm hex data type and would occupy the same space.
For item 2, try IBM assembler language reference; you need to use ACB macro (to define the type of VSAM access) in conjunction with RPL (to specify the request parameters). A typical definition of VSAM would look like this:
A
| Code: |
INDXIN ACB DDNAME=INDXIN,MACRF=(IN,KEY,DIR),EXLST=INDXINX
INDXIRPL RPL ACB=INDXIN,AREA=INDXAREA,AREALEN=512,OPTCD=(KEY,DIR), X
ARG=PNXPOLNO,KEYLEN=10
INDXINX EXLST AM=VSAM,SYNAD=PNXPHYER
|
Above is the definition of INDXIN, a KSDS (KEY parm), for random access (DIR parm). RPL has ddname, file area, file area length, and access type, in that order (EXLST specifies the exit list; SYNAD specifies the label to route the execution sequence if any physical error is encountered for the file).
Let me know if this doesn't answer your question. |
|
| Back to top |
|
 |
|
|
|