View previous topic :: View next topic
|
Author |
Message |
vel2k8
New User
Joined: 10 Jun 2005 Posts: 11 Location: Jacksonville
|
|
|
|
Frank
I want to reolve all the string fields YYYYMMDD inside a file with todays date. (or DATE1-1. ie yesterday)
YYYYMMDD may occur many times in the input file and may not be in the same column.
Sample Input file.
AAA_YYYYMMDD_123
123_TRS_YYYYMMDD_RTS_YYYYMMDD
Output Expected
AAA_20080313_123
123_TRS_20080313_RTS_20080313
I need this card to be generic so that I can have a similar card to replace YYYYMMDD with yesterdays date and so on.. (Like DATE1-1 or DATE1-2 etc. ) Because my job will be running on week ends and need to process monday to Friday files. ie, for monday file I need to replace YYYYMMDD with today - 5 days and so on assuming my job will run on saturday.
Vel. |
|
Back to top |
|
|
vel2k8
New User
Joined: 10 Jun 2005 Posts: 11 Location: Jacksonville
|
|
|
|
Forgot to tell you one thing, my installation doesnot have DFSORT Symbol
facility
Thanks
Vel. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
my installation does not have DFSORT Symbol |
This statement makes no sense. If you have DFSORT, then you have DFSORT Symbols.
You could use a set of IFTHEN statements to do this. How many depends on the last position in which YYYYMMDD can be found in any record. It's not clear if the example records you show are the actual records or if the actual records can have a YYYYMMDD further out in the record. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can do this kind of thing quite easily now with DFSORT's new FINDREP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
INREC BUILD=(C'TDATE,''',DATE1-1,C'''',80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD *
AAA_YYYYMMDD_123
123_TRS_YYYYMMDD_RTS_YYYYMMDD
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC FINDREP=(IN=C'YYYYMMDD',OUT=TDATE)
/*
|
You can substitute DATE1 or DATE1-2 or whatever you need for DATE1-1 in the first INREC statement.
For complete details on the new FINDREP function and the other new functions available with PTF UK90013, see:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|