View previous topic :: View next topic
|
Author |
Message |
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You can call sort from rexx. Try searching the CLIST/rexx forum or th web, or your sort manual. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Click HERE for an example. |
|
Back to top |
|
|
|