Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 4648
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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us