View previous topic :: View next topic
|
Author |
Message |
deen nisha
New User
Joined: 16 Aug 2005 Posts: 2
|
|
|
|
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 |
|
|
khaarthikm
New User
Joined: 08 Aug 2005 Posts: 15
|
|
|
|
Hi Nisha,
Can u give us some more details.. wat is the problem ur facing during this?????
thanks
Khaarthik.M |
|
Back to top |
|
|
sendil
New User
Joined: 30 Jun 2005 Posts: 27
|
|
|
|
Hi nisha,
we need some more details..........
Thanks
Sendil |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Nisha,
I'm not sure if you're still there; questions about a request for info seem to make people disappear.
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 |
|
|
sendil
New User
Joined: 30 Jun 2005 Posts: 27
|
|
|
|
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 |
|
|
khaarthikm
New User
Joined: 08 Aug 2005 Posts: 15
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
|