View previous topic :: View next topic
|
Author |
Message |
creator.abhishek
New User
Joined: 07 May 2006 Posts: 32 Location: Pune
|
|
|
|
Hi,
I have used FINDREP command to replace string in RRDS file but it was not working.. pls suggest..
Code: |
//STEP010 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=TEST.RRDS.VSAM,DISP=SHR
//*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC FINDREP=(INOUT=(C'wxyz',C'Abcd'))
/* |
Code'd |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
First, you should not tail-gate an old topic - it's tough to keep an eye on details for such a topic.
Second, when it did not work - what happened? An abend? Job executed but you did not get the expected the output? Something else? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Because the control cards start in column 1? Of course, if OP had used the code tags, which he should know he should do after 7 years on the forum, we might see that they were not starting in cc1. |
|
Back to top |
|
|
creator.abhishek
New User
Joined: 07 May 2006 Posts: 32 Location: Pune
|
|
|
|
No abend MAXCC zero but String not replaced in the file. |
|
Back to top |
|
|
creator.abhishek
New User
Joined: 07 May 2006 Posts: 32 Location: Pune
|
|
|
|
Control cards starts with column 3. Apologies as pasted in forum in column 1.
There is no error in the JOB and returning MAXCC as zero, but no change in input file.
Please note i can't use any other output file. Input file only need to change and it is RRDS file. Please help. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
When you say "string not replaced in the file" you do realise that SORT cannot affect the input dataset?
You do realise that if it were working it would change (or attempt to change) the length of some of your RRDS records? Are you using variable-length RRDS anyway? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Input file only need to change and it is RRDS file. |
You should not even try to do this . . . DO NOT try to overwrite the input data.
Suggest you run a test using an INCLUDE and see if the value is found. If it cannot be found, it cannot be changed. |
|
Back to top |
|
|
creator.abhishek
New User
Joined: 07 May 2006 Posts: 32 Location: Pune
|
|
|
|
It is fixed length rrds and length is 256. Yes string is there that need to replace in RRDS file. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Yes string is there that need to replace in RRDS file |
Then you can proceed with a new process . . .
Quote: |
DO NOT try to overwrite the input data. |
Well managed operatons will not allow overwriting production input files . . .
Run the findrep creating a new file and then use the changed data file to reload the rrds. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
SORT read its input (usually SORTIN DD) and writes its output (usually SORTOUT DD, but man other possibilities).
There is no "update in place" with SORT.
If you specifiy the same DSN for input and output DD then you deserve all the extra hassle it'll give you, so don't do that.
Either write a program, in the language of your choice, or do as Dick has said. The "flat" output from the SORT, with the FINDREP'd data, can then be again fed through a SORT to re-create your RRDS.
You have different lengths for your "in" and "out", so you will change your record-lengths for all "hits", and the RRDS may not like that anyway. |
|
Back to top |
|
|
creator.abhishek
New User
Joined: 07 May 2006 Posts: 32 Location: Pune
|
|
|
|
Looks like, editing input directly wont work, so i had back with old method working with VSAM like, reproing from VSAM to PS file, editing PS file though SORT/REXX, delete/define RRDS existing dataset and copying from edited PS file to RRDS dataset.
Thanks all for your inputs, however which i wanted to do in one step unfortunately not working and have to divide in many. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you use SORT instead of REPRO you will get a faster "copy" to the PS and you can use FINDREP at the same time.
Delete/Define only if necessary.
Use SORT to copy the modified PS to the RRDS.
If you want fewer steps, write a program. Ensure that it runs faster than the above solution. |
|
Back to top |
|
|
|