View previous topic :: View next topic
|
Author |
Message |
shobvid
New User
Joined: 03 Apr 2008 Posts: 11 Location: India
|
|
|
|
Hi,
I need to update a record in a VSAM (KSDS) file twice.
Sceneratio:
I have one VSAM and two flat files. Need to read the flat files and update the record when found in the vsam.
Code: |
Eg
VSAM
111
222
333
444
666
File 1
111 AAA
222 BBB
333 ABC
666 ZZZ
File 2
333 CCC
555 EEE
Updated VSAM file should be
111 AAA
222 BBB
333 ABCCCC
444
555 EEE
666 ZZZ
But what we find is
Updated VSAM file should be
111 AAA
222 BBB
333 CCC
444
555 EEE
666 ZZZ |
Problem:
when i try to update the the record 333 after reading the second file, I am unable to find the ABC details for 333 record. the value ABC is not being commited in the VSAM file.
Hope my question is clear.
Please suggest.
Thanks,
V |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
The code that moves the info from file2 appears to be wiping out the data area. . .
Make sure the code preserves the data from the first update. . . |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
either that,
or use a sort product to splice the files,
so there is only one input file. |
|
Back to top |
|
|
shobvid
New User
Joined: 03 Apr 2008 Posts: 11 Location: India
|
|
|
|
No, when we are reading the VSAM file for the second time to update, we dont see the data being present from the first update. The data is not commited after the first update and after the second read to update. The second read is still showing the initial record with no updates of first update. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
read my previous post,
if you insist that your analysis is true. |
|
Back to top |
|
|
shobvid
New User
Joined: 03 Apr 2008 Posts: 11 Location: India
|
|
|
|
Thanks for the option for merging, but we are not interested in that way. We want to know how the program will update it. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
well, then you have to debug your program:
such as listcat for vsam file,
shr options
i assume this 'problem update program' is batch.
Select statement,
FD,
I/O statements,
jcl - dd statements
is this file open to CICS at the same time as the batch update?
and it was not a merge that I suggested. that would result in a file with the number of records = file1 + file2.
my suggestion was to splice, which would reduce the total number of records by the number of duplicates. |
|
Back to top |
|
|
shobvid
New User
Joined: 03 Apr 2008 Posts: 11 Location: India
|
|
|
|
Its a batch program. we guess there is some issue with VSAM file handling. Either file definition, access mode or JCL share options. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Was the status code checked after the update?
What happens if you run a test that ends after the first update of the problem record? Is the update still there or does the first update fail? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Nah!!!
Mr. Scherrer wrote: |
The code that moves the info from file2 appears to be wiping out the data area. . . |
that's the problem, otherwise, none of your first updates would take. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
to follow up.
you obviously know that you are reading file 2,
because of the silliness of
why, if there is only one entry is it in the second position.
you have a bug!!!!!
it's not the OP-SYS, or your jcl or vsam construct. it is your code. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Either file definition, access mode or JCL share options. |
If you insist on these limits, you will probably not find the problem. . .
The code is failing somewhere and the code will need to be changed. . . |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Dick,
Quote: |
that's the problem, otherwise, none of your first updates would take. |
The more i see, i wonder if the first update really did. . . Update that is. . .
Maybe more info will follow. . .
d |
|
Back to top |
|
|
shobvid
New User
Joined: 03 Apr 2008 Posts: 11 Location: India
|
|
|
|
Thankyou for your help. Its a bug in the program. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
shobvid wrote: |
Thankyou for your help. Its a bug in the program. |
Could you please enlighten us as to the 'bug'? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If you post the problem/solution, it will probably help someone else who has a similar problem some day. . . |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Glad to hear that you have resolved your problem. |
|
Back to top |
|
|
|