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

reading variable length records in sequential file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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
Search our Forums:

Back to Top