Passing input files each having different record length
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Application Programming

#1: Passing input files each having different record length Author: senthilvelLocation: India PostPosted: Wed Feb 05, 2003 1:04 am
    —
Hi,

Can you tell me the concept of variable blocked dataset. In Cobol program File Description,
I had given like this

Record is varying from 80 to 1200 characters Depending on wk-length

After declaring like this what is the record length I have to declare below in using PIC clause


I dont know what this wk-length does

My requirement is I have to use an input file with variable record length

that is for the first run i may use a file with record length 80 (VB)
then for the second run I may use a file with record length 400(VB)


Thanks in Advance
Regards,
E.senthilvel

#2:  Author: Programmer PostPosted: Wed Feb 05, 2003 2:45 am
    —
Senthil,

Have you mentioned "Record is varying from 80 to 1200 characters Depending on wk-length " for a file definition or is it defiened for a variable table entry ??? Question

#3:  Author: senthilvelLocation: India PostPosted: Wed Feb 05, 2003 3:11 am
    —
Its for file definition

#4:  Author: kolusuLocation: San Jose PostPosted: Wed Feb 05, 2003 11:08 am
    —
Senthil,

For variable blocked files, you need to define it as follows. Note that it starts from 1 instead of 80 as shown in your example.

Code:

RECORD IS VARYING IN SIZE FROM 1 TO 1200 CHARACTERS DEPENDING ON WK-LENGTH


The wk-length field must be defined as unsigned binary variable.

Code:

01  WK-LENGTH PIC  9(09) BINARY.


So depending on the file read in the program , the wk-length variable will be set to the actual length of the variable length record.

Also use READ INTO working storage field for variable blocked files so that the record size read for that file is used in the MOVE statement generated by the compiler.

Also check this for a better understanding of Variable length format

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3PG00/1.9.1.1.3?DT=20011203125201#HDRWQ290

Hope this helps...

cheers

kolusu

#5:  Author: sladeLocation: Edison, NJ USA PostPosted: Fri Feb 07, 2003 9:13 pm
    —
Hi E,

I noticed that the text of your post stated something different than its title implied. Also in the text of the post you mention that the records vary from 80 to 1200, then you follow that by saying that the 1st run will have a file with 80 byte records, and the 2nd run will have a a file with 400 byte records.

This seems to imply that the records in these 2 files will all be 80 and 400 bytes respectively, in spite of the fact that you say they are "VB". Am I right?

I also note that you don't mention Record or Block Descriptor Words (RDW/BDWs) that identify a record a V or VB. Are you dealing with true IBM variable length records or are they merely in files that contain records of differing lengths? Perhaps you can send along a few records to illustrate.

Regards, Jack.



MVSFORUMS.com -> Application Programming


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group