Replace a string with another string with different length

JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...
Devrana
Posts: 15
Joined: Tue May 17, 2022 12:57 pm
Skillset: Mainframe Developer
Referer: Through Colleague

Replace a string with another string with different length

Postby Devrana » Sun Jan 19, 2025 3:23 pm

Hi All,

I have tried to change a string of length 3 with another string of length 4 but the output is not coming as expected. I have tried with findrep parameter of sort utility but it didn't give the desired result.

Example:

Input:

DEVTEST
DEVUAT
DEVPROD


Expected output:

DEV1EST
DEV1AT
DEV1ROD

Note: postition of start of DEV string in input file is not known.

Please assist. Thanks!

User avatar
sergeyken
Posts: 458
Joined: Wed Jul 24, 2019 10:12 pm
Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
Referer: Internet search

Re: Replace a string with another string with different leng

Postby sergeyken » Sun Jan 19, 2025 11:07 pm

JCL has no operations for such manipulation.

Please, choose the forum section for different tools: COBOL? Assembler? PL/I? REXX? SORT? Whatever else?

The important issue: you must present here the exact code of your attempts, plus all input/output/log data of its execution. Otherwise there is no base for any discussion.
Javas and Pythons come and go, but JCL and SORT stay forever.


  • Similar Topics
    Replies
    Views
    Last post