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

Repro command to copy a particular record from VSAM to Flat


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

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Thu Oct 13, 2011 11:14 am
Reply with quote

Hi,

I am trying to copy a Particular record from VSAM file to a Flat file using REPRO command. I have used below code to do that but I don't know complete KEY, I only know part of the key and I want to copy the records based on that partial KEY.
Please suggest me how I can achieve this. Thanks

Code:
/* ReXX */                                                           
 MAIN_PROCESSING:                                                     
   " ALLOC DA('VSAM.FILE') DD(INDD) SHR"         
   " ALLOC DA('FLAT.FILE') DD(OUTDD) NEW",
   " SPACE(100,100) DSORG(PS) RECFM(F,B) LRECL(350) BLKSIZE(3500)"   
/* COPY VSAM FILE TO A FLAT FILE */                                   
   " REPRO IFILE(INDD) OFILE(OUTDD) FROMKEY('0000000000XXXXXX')"     
 EXIT                       



KEY length- 16 splitted as 1 - 5, 6 - 10 and 11 - 16. I know the partial key from 11 - 16 and copy the records based on this partial Key. Kindly sugget.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Oct 13, 2011 11:21 am
Reply with quote

Since you don't know the high-order part of the key, I'd suggest SORT, with COPY and INCLUDE for what you do know and STOPAFT if there is really only one and you don't want to continue processing the file.
Back to top
View user's profile Send private message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Thu Oct 13, 2011 11:25 am
Reply with quote

Bill Woodger wrote:
Since you don't know the high-order part of the key, I'd suggest SORT, with COPY and INCLUDE for what you do know and STOPAFT if there is really only one and you don't want to continue processing the file.


Can I do the Sort in Rexx itself because I don't want to use JCL in my tool ? If yes, can you tell me the syntax in REXX. Thanks
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Oct 13, 2011 11:55 am
Reply with quote

You can call sort from rexx. Try searching the CLIST/rexx forum or th web, or your sort manual.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Oct 13, 2011 5:59 pm
Reply with quote

vinayknj, since you're working with VSAM, don't you think your process might be better suited to an actual program (COBOL or other) rather than to a REXX exec?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Oct 13, 2011 6:16 pm
Reply with quote

Click HERE for an example.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top