Mainframe: Replace spaces in input file with a String

If I find a space in position 63-72, I need to replace with 9999-99-99.Is there any way to perform this?

My Input looks like the following records.

Input:
————————————————————-

AAAAAAAA          2006-09-01 XXXXXXXXXX 001 000

BBBBBBBB          2006-06-01 XXXXXXXXXX 001 000

CCCCCCC           2006-01-01 2006-05-31 001 000

DDDDDDD           2007-01-01 XXXXXXXXXX 001 000

————————————————————-

And the output should be –

Output:
————————————————————-

AAAAAAAA          2006-09-01 9999-99-99 001 000

BBBBBBBB          2006-06-01 9999-99-99 001 000

CCCCCCC           2006-01-01 2006-05-31 001 000

DDDDDDD           2007-01-01 9999-99-99 001 000

————————————————————-

The following Sort step with control card having keywords IFTHEN and OVERLAY would give the solution to the above problem.

Code:
//STEP01   EXEC  PGM=SORT

//SYSOUT   DD SYSOUT=*

//SORTIN   DD DSN=YOUR INPUT FILE,

//            DISP=SHR

//SORTOUT  DD DSN=YOUR OUTPUT FILE,

//            DISP=(NEW,CATLG,DELETE),

//            UNIT=SYSDA,

//            SPACE=(CYL,(X,Y),RLSE)

//SYSIN    DD *

//SYSIN    DD *

SORT FIELDS=COPY

OUTREC IFTHEN=(WHEN=(63,10,CH,EQ,C’ ‘),

OVERLAY=(63:C’9999-99-99′))

/*

Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.