Page 1 of 1

Replace a character using JCL and SORT.

Posted: Mon Feb 13, 2023 9:40 am
by Vicky Malhotra
Hello all,

can someone help me to resolve a query.

I got a dataset, and i wanna replace the 1st column Value from X to Y.
For ex. Current Value in dataset is X9010
Output i need is Y9010
How can I do this using the JCL sort statement pls.
I think Overlay can be used but am not getting how to use overlay with Sort.

Re: Replace a character using JCL and SORT.

Posted: Thu Feb 16, 2023 6:51 pm
by Anuj Dhawan
Look for FINDREP, a sample is given below:

Code: Select all

//SYSIN DD *                           
 OPTION COPY                           
 OUTREC FINDREP=(IN=C'X',OUT=C'Y')
Play around with position of characters you want to replace, should work.