Page 1 of 1

Mapping file variable

PostPosted: Fri Nov 06, 2015 1:57 pm
by vegafacundodaniel
Hello to all,

Could anyone tell me how can I mapping a variable file with a copybook?

If I see the dataset in ISPF I don't see the first 4 characters of the length.

Thanks in advance

Re: Mapping file variable

PostPosted: Fri Nov 06, 2015 2:23 pm
by BillyBoyo
The first four bytes of a variable-length record are the Record Descriptor Word. Except for the unlikely case of you having an "S-type" variable-length record to look at, the first two bytes, taken as signed binary, indicate the length and the next two bytes you can ignore. From ISPF you can always tell the length of a record by finding the position of the last byte (put the cursor on the last position, move to the right (often PF11), look at the screen).

Or do you mean something else? If so, you'll have to be much clearer, and give sample input and required output and what you are currently receiving.

Re: Mapping file variable

PostPosted: Fri Nov 06, 2015 2:40 pm
by vegafacundodaniel
Thanks for your reponse.
I'd like to see the content of the Record Descriptor Word. Can I ? How?

Re: Mapping file variable

PostPosted: Fri Nov 06, 2015 2:57 pm
by BillyBoyo
OK, but why? Except for a RECFM=VS or RECFM=VBS it is very uninteresting and contains exactly the information you can intuit from the display of the record in ISPF?

Re: Mapping file variable

PostPosted: Fri Nov 06, 2015 3:10 pm
by vegafacundodaniel
I need to see that information because I am sure if my program est OK. I don't know if I have to define a first field of the file in my cobol program with PIC S9(4) COMP or not.That is the raison.

My description file in the program is
BLOCK 0 RECORDS
RECORDING MODE V
RECORD IS VARYING IN SIZE FROM 1 TO 300 CHARACTERS
DEPENDING ON VAR-SIZE
LABEL RECORD ARE STANDARD.


and in my JCL is:
FILEAUT DSN=CYTT21.GAASGG.FILEAUT,DISP=(,CATLG),
UNIT=3390,SPACE=(TRK,(50,10),RLSE),
DCB=(RECFM=VB,LRECL=304,BLKSIZE=0)

Thanks

Re: Mapping file variable

PostPosted: Fri Nov 06, 2015 4:23 pm
by BillyBoyo
You don't need to code the RDW under the FD. Your VAR-SIZE will contain the length, COBOL will populate that when a record is read, and use what is in that field when a record is written. VAR-SIZE is a silly, meaningless, name so I hope it is only that for this example.

In IBM COBOL, the RDW is hidden from you because how records are stored on any given system is not part of the COBOL Standard, it is an implementation issue, and entirely separate from the COBOL language.

In Linux/Unix/Windows there is no concept of an "RDW". A variable-length record would have a record-delimiter. The idea is that your program would still work the same, and you don't need to know anything about a different underlying file-system.

Re: Mapping file variable

PostPosted: Fri Nov 06, 2015 4:27 pm
by NicC
And there is no other program that you can look at to see how it declares a variable length record dataset?