IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Fri Apr 20, 2007 12:57 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Fri Apr 20, 2007 1:16 pm
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
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: 3156
Location: Tucson AZ

PostPosted: Fri Apr 20, 2007 2:15 pm
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
Reply with quote

Hi,

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

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top