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
 

 

reading variable length records in sequential file

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

New User


Joined: 16 Aug 2005
Posts: 2

PostPosted: Wed Aug 24, 2005 9:14 am    Post subject: reading variable length records in sequential file
Reply with quote

hai friends
In my program, the variable length records are predefined.
my problem is to read the variable length record from a seq. file and update the vsam file (ksds) according to the transaction specified .
sequential file is the transaction file
Back to top
View user's profile Send private message

khaarthikm

New User


Joined: 08 Aug 2005
Posts: 15

PostPosted: Wed Aug 24, 2005 12:57 pm    Post subject: reading variable length records in sequential file
Reply with quote

Hi Nisha,

Can u give us some more details.. wat is the problem ur facing during this?????



thanks
Khaarthik.M
Back to top
View user's profile Send private message
sendil

New User


Joined: 30 Jun 2005
Posts: 27

PostPosted: Thu Aug 25, 2005 12:03 pm    Post subject:
Reply with quote

Hi nisha,


we need some more details..........


Thanks
Sendil
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Aug 27, 2005 9:47 pm    Post subject:
Reply with quote

Hi Nisha,

I'm not sure if you're still there; questions about a request for info seem to make people disappear. icon_smile.gif

If you meant to ask, how do I define the recs and how do I determine what rec I just read, then consider this:

Define your FD to include multiple 01 recs that define each of the recs you expect to find when you read the var file.

Usually each rec contains a rec-type field (usually at the same location in each) that identifies that rec. In your code you test that field and determine the kind of processing you want to do for that rec type. For e.g.


fd v-file
....
01 rec-a.
05 rec-typ-a pic x.
.
.
.
01 rec-b.
05 rec-typ-b pic x.
.
.
.
etc.

read v-file
evaluate rec-typ-a
when 'a'
perform 100-process-a-recs
when 'b'
perform 200-process-b-recs
when '?'
perform ?00-process-?-recs
.
.
etc.
end-evaluate
Back to top
View user's profile Send private message
sendil

New User


Joined: 30 Jun 2005
Posts: 27

PostPosted: Mon Aug 29, 2005 10:41 am    Post subject:
Reply with quote

Hi mmwife,

In my file, i have 20000 records(all the record having variable length). Is it your code efficient for this 20000 record read.


Please correct me if i am wrong........


Thanks
Sendil
Back to top
View user's profile Send private message
khaarthikm

New User


Joined: 08 Aug 2005
Posts: 15

PostPosted: Mon Aug 29, 2005 2:40 pm    Post subject:
Reply with quote

Hi Sendil,

Any how ur gonna process the 20000 records in the same program... so adding just a evaluate statements is not gonna make much difference....


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

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Aug 30, 2005 5:08 am    Post subject:
Reply with quote

Hi Sendil,

I mentioned one scheme for writing/reading var recs. You have to describe the scheme for your var recs. Usually the scheme involves ver length tables within the recs.

You should explain how you plan to process the recs. Will you change their length, how do you map the rec description in the pgm to the rec(s), etc.

One can't pose a one sentence ques and expect a book like ans.
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