
Chapter 2. Introducing File Manager 41
2.1.10 Replace a string in a specific location in a file
If you need to unconditionally replace a string in one location of a file, you can use this utility.
The code to perform this function with File Manager is shown in Example 2-11.
Example 2-11 File Manager string replace batch step
//*
//* FILE MANAGER BATCH: REPLACE A STRING IN A SPECIFIC LOCATION
//*
//STEP01 EXEC PGM=FMNMAIN
//STEPLIB DD DSN=FMN.V4R1M0.SFMNMOD1,DISP=SHR
//* DD DSN=IGY.SIGYCOMP,DISP=SHR
//SYSPRINT DD SYSOUT=*
//FMNTSPRT DD SYSOUT=*
//SYSTERM DD SYSOUT=*
//EDITFILE DD DISP=OLD,DSN=YOUR.FILE.TO.EDIT
//SYSIN DD *
$$FILEM DSU INPUT=EDIT ...