Need to update VSAM through JCL



Help for IBM's record-oriented filesystem VSAM, ESDS, KSDS, RRDS, LDS and Storage management Subsystems

Need to update VSAM through JCL

Postby vkumarg3 » Thu Aug 08, 2013 4:33 pm

Hi,

I have KSDS file with few keys. i want to copy the same VSAM file to an another VSAM file. While copying i want to update one record based on key.

This should be done by jcl.

example:
ctrl card            date
123                   01122012
124                   02122012
125                   03122012


In my scenario i know ctrl card to update. It is 124.. date to be update 02122013

So after copied to new file, new file should look like below.
ctrl card            date
123                   01122012
124                   02122013
125                   03122012


this should be done in jcl. Please help. Thanks in advance.
vkumarg3
 
Posts: 29
Joined: Fri Jan 06, 2012 9:29 am
Has thanked: 10 times
Been thanked: 0 time

Re: Need to update VSAM through JCL

Postby Robert Sample » Thu Aug 08, 2013 6:00 pm

What you want cannot be done, period. All JCL does is execute programs and allocate files. If you had said you wanted to use a program (such as SORT or writing COBOL code) to do so, then what you want to do would be possible.

Furthermore, you did not provide any information about how your input is changed to create your output -- it could have been changed by date, or because it is the second record, or because of the key value, or whatever. You did not provide any such information, so any answers you get can only be guesses.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Need to update VSAM through JCL

Postby c62ap90 » Thu Aug 08, 2013 6:37 pm

If I were doing this task I would…

Copy original VSAM file to sequential file.
i.e. IDCAMS REPRO INFILE(Input) OUTFILE(Output)

Use sort, Easytrieve, whatever (I do not know your shops tools) to make your changes.
Output from above for you input, and create a new output.

Create your new VSAM file using the new output from above.
IDCAMS DEFINE, then IDCAMS REPRO to copy to new VSAM file.

These users thanked the author c62ap90 for the post:
vkumarg3 (Thu Aug 08, 2013 8:12 pm)
c62ap90
 
Posts: 125
Joined: Thu Oct 11, 2012 10:24 pm
Has thanked: 1 time
Been thanked: 7 times

Re: Need to update VSAM through JCL

Postby NicC » Thu Aug 08, 2013 7:00 pm

Sort can read the old, do the change and write the new. But whichever way JCL cannot do it - only facilitate the exercise.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Need to update VSAM through JCL

Postby vkumarg3 » Thu Aug 08, 2013 8:13 pm

Hi NicC,

Pls tell the sort card to replace that position.
vkumarg3
 
Posts: 29
Joined: Fri Jan 06, 2012 9:29 am
Has thanked: 10 times
Been thanked: 0 time

Re: Need to update VSAM through JCL

Postby dick scherrer » Thu Aug 08, 2013 9:30 pm

Hello,

You need to post the rules for which record(s) to change . . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Need to update VSAM through JCL

Postby BillyBoyo » Thu Aug 08, 2013 10:15 pm

  INREC IFTHEN=(WHEN=(X,X,CH,EQ,C'XXX'),
                 OVERLAY=(X:C'XXXXXX'))


It'll be something like that, but you'll need to fix-up all the Xs if you're keeping it all to yourself.

These users thanked the author BillyBoyo for the post:
vkumarg3 (Tue Sep 03, 2013 12:30 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to VSAM/SMS

 


  • Related topics
    Replies
    Views
    Last post