Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Want to process the file(read and write) based on the length

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Gopinath_Natrayan

New User


Joined: 20 Dec 2006
Posts: 2
Location: India

PostPosted: Fri Apr 20, 2007 12:53 pm    Post subject: Want to process the file(read and write) based on the length
Reply with quote

Hi,

Iam having an input file of variable format...it contains records of different length.I want to process the file(read and write) based on the length..
please help me in doing this

Thanks in advance
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Apr 20, 2007 12:57 pm    Post subject:
Reply with quote

Bytes 1&2 of the RDW contain the length of the record.

I'm a little intrigued as to why the record length should be the deciding factor of whether a record is processed or not. Can you elaborate on that.
Back to top
View user's profile Send private message
Gopinath_Natrayan

New User


Joined: 20 Dec 2006
Posts: 2
Location: India

PostPosted: Fri Apr 20, 2007 1:11 pm    Post subject: Re: Read a file of variable format...
Reply with quote

hi expat,

my requirement is my input file has different record of different layout..i have to process according to the layout..
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Apr 20, 2007 1:16 pm    Post subject:
Reply with quote

And you have the record layouts from the creating program ?
Are there any readily available pointers such as a record type
e.g. If record type = 3 then use this layout ?
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Fri Apr 20, 2007 1:30 pm    Post subject:
Reply with quote

As expat suggested generally you will have a field called record type in the input record which will tell you which layout needs to be used for that record. Check for that field and accordingly move the input record into respective layout.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Apr 20, 2007 2:15 pm    Post subject: Re: Read a file of variable format...
Reply with quote

Gopinath_Natrayan wrote:
Iam having an input file of variable format...it contains records of different length.I want to process the file(read and write) based on the length.
Strange but doable.
The llbb is reachable, but care must be used. Input and output records could be defined as ODO variables. A linkage section variable could be set as the address of the llbb of the input record. A working storage variable would be the object of the ODOs.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Apr 21, 2007 4:21 am    Post subject:
Reply with quote

Hi,

Try the link below. my suggestion is in the last post in the thread.

http://ibmmainframes.com/viewtopic.php?t=11754&highlight=varying

Or you can put all the 01 rec descriptions in the FD and use the rec-type fields in the recs to decide which datanames to use, as suggested by others earlier.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us