MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passing input files each having different record length

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
senthilvel
Beginner


Joined: 04 Feb 2003
Posts: 3
Topics: 2
Location: India

PostPosted: Wed Feb 05, 2003 1:04 am    Post subject: Passing input files each having different record length Reply with quote

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
View user's profile Send private message Yahoo Messenger MSN Messenger
Programmer
Beginner


Joined: 23 Jan 2003
Posts: 5
Topics: 1

PostPosted: Wed Feb 05, 2003 2:45 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
senthilvel
Beginner


Joined: 04 Feb 2003
Posts: 3
Topics: 2
Location: India

PostPosted: Wed Feb 05, 2003 3:11 am    Post subject: Reply with quote

Its for file definition
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Wed Feb 05, 2003 11:08 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Fri Feb 07, 2003 9:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group