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

how do i use REPRO in REXX program to update in KSDS


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sandhya rani

New User


Joined: 05 Dec 2006
Posts: 22
Location: hyderabad

PostPosted: Tue Dec 26, 2006 10:07 pm
Reply with quote

Hi,

My requirement is to add the message entered by the user in the Vsam file by incrementing the key

I had written the code as follows

Say 'enter thr message'
Pull message
"alloc DA(temp.flatfile") dd(INDD) shr"
"alloc DA(temp.Vsam.KSDS) dd(OUTDD) mod"
"repro Ifile(INDD) ofile(OUTDD) TOKEY('00000008')"

when i execute the same it is expecting a FROMKEY

whateven message enter by the user iam copying the same into the flatfile.Now iam using repro utility to copy that message to the VSAM by incrementing the key or specified key.

Can anyone tell me how do we use repro to add the record for KSDS(key information is not present in flatfile..and the keylength is 8).

Thanks & Regards
Sandhya Rani
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Dec 27, 2006 1:33 am
Reply with quote

As far as I know, you can't use REPRO to simply update a VSAM dataset. I believe that you'll need to REPRO all of the VSAM dataset to the QSAM dataset, add the comment record along with an appropriate key, then REPRO all of the QSAM dataset back into the VSAM dataset.

Comment: wouldn't this be easier to much more efficient to do in COBOL?
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Thu Dec 28, 2006 12:12 am
Reply with quote

You need the KEY to the RECORD you are trying to update in the VSAM file. You also need to use the FROM and To Option. I do this all the time. here is an EXAMPLE. The FROM and TO keys are both the same VSAM
record KEY which allows you to replace the one VSAM RECORD.

Code:

//STEP020 EXEC PGM=IDCAMS
//IN        DD DSN=input.file.name,DISP=SHR      (SEQ FILE)
//OUT       DD DSN=output.vsam.file,DISP=SHR     (VSAM FILE)
//SYSOUT    DD SYSOUT=*
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
 REPRO INFILE(IN) OUTFILE(OUT) REPLACE -
 FKEY ('record key')
 TOKEY('record key')
//*
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Sun Feb 25, 2007 12:19 pm
Reply with quote

Sandhya,

You cannot copy a flast PS file to VSAM file(i.e updation) as it is.

If the VSAM file is KSDS you cannot do that.

Simple way is ,

1.Get the records from the user( as you did in the flat file)

2.Sort the record in PS based on the key defined in VSAM.

3.Update the VSAM file.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Using API Gateway from CICS program CICS 0
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top