View previous topic :: View next topic
|
Author |
Message |
AlexSalas95
New User
Joined: 18 Mar 2024 Posts: 6 Location: United States
|
|
|
|
Within a record, I need to replace the following characters 'YYMMDD' with the actual date. Below is what I'm currently using to do this;
Code: |
OUTREC IFTHEN=(WHEN=(44,6,CH,EQ,C'YYMMDD'),OVERLAY=(44:DATENS=(YMD))) |
Is there a way to do this if 'YYMMDD' does not start in column 44?
I would like to do something like below;
Code: |
OUTREC FINDREP=(IN=C'YYMMDD',OUT=DATENS=(YMD)) |
however, this doesn't work. I'm assuming FINDREP will only work with literals |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1305 Location: Bamberg, Germany
|
|
|
|
This should work for you:
Code: |
//WHATEVER EXEC PGM=SORT
//SYMNAMES DD *
YMD,S'&LYYMMDD.'
/*
//SYMNOUT DD SYSOUT=*
//SORTIN DD *
YYMMDD
YYMMDD
YYMMDD
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC FINDREP=(INOUT=(C'YYMMDD',YMD))
END
/* |
|
|
Back to top |
|
|
AlexSalas95
New User
Joined: 18 Mar 2024 Posts: 6 Location: United States
|
|
|
|
It works beautifully, thank you! |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1305 Location: Bamberg, Germany
|
|
|
|
If you have to use not the current date, a two step solution is needed. There is a sample somewhere in the forum we have provided some time ago. |
|
Back to top |
|
|
|