Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
how do i use REPRO in REXX program to update in KSDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: how do i use REPRO in REXX program to update in KSDS
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

Moderator Team Head


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

PostPosted: Wed Dec 27, 2006 1:33 am    Post subject: Re: how do i use REPRO in REXX program to update in KSDS
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Creating ISPF Screens with Scrname vi... Albireo20 TSO/ISPF 9 Tue Sep 05, 2017 4:24 pm
No new posts How to Run Rexx Macro? Kalaivignesh CLIST & REXX 5 Fri Sep 01, 2017 9:08 pm
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us