View previous topic :: View next topic |
Author |
Message |
senthilvel Beginner
Joined: 04 Feb 2003 Posts: 3 Topics: 2 Location: India
|
Posted: Wed Feb 05, 2003 1:04 am Post subject: Passing input files each having different record length |
|
|
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 |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Programmer Beginner
![](images/avatars/gallery/cartoons/WB165.gif)
Joined: 23 Jan 2003 Posts: 5 Topics: 1
|
Posted: Wed Feb 05, 2003 2:45 am Post subject: |
|
|
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](images/smiles/icon_question.gif) |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
senthilvel Beginner
Joined: 04 Feb 2003 Posts: 3 Topics: 2 Location: India
|
Posted: Wed Feb 05, 2003 3:11 am Post subject: |
|
|
Its for file definition |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
kolusu Site Admin
![Site Admin Site Admin](images/ranks/adminpic.jpg)
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
|
Posted: Wed Feb 05, 2003 11:08 am Post subject: |
|
|
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 |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
slade Intermediate
Joined: 07 Feb 2003 Posts: 266 Topics: 1 Location: Edison, NJ USA
|
Posted: Fri Feb 07, 2003 9:13 pm Post subject: |
|
|
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. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|
|