Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Resolve date field YYYYMMDD in a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vel2k8

New User


Joined: 10 Jun 2005
Posts: 11
Location: Jacksonville

PostPosted: Thu Mar 13, 2008 3:16 pm    Post subject: Resolve date field YYYYMMDD in a file
Reply with quote

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
View user's profile Send private message

vel2k8

New User


Joined: 10 Jun 2005
Posts: 11
Location: Jacksonville

PostPosted: Thu Mar 13, 2008 3:26 pm    Post subject: Reply to: Resolve date field YYYYMMDD in a file
Reply with quote

Forgot to tell you one thing, my installation doesnot have DFSORT Symbol
facility

Thanks
Vel.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Mar 13, 2008 9:17 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Aug 15, 2008 5:45 am    Post subject:
Reply with quote

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:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us