MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Update date in dataset

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Piscesian
Beginner


Joined: 17 Dec 2004
Posts: 14
Topics: 8
Location: Monrovia,California

PostPosted: Mon Aug 13, 2007 1:42 pm    Post subject: Update date in dataset Reply with quote

I need to update a datefile in one of the steps of a JCL
Suppose the date file is 2007-06-30
When the jcl is executed, the date file should look like 2007-07-31
i.e update the file to next month end date.
Can his be done through DFSORT?

Thanks,
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Aug 13, 2007 2:46 pm    Post subject: Reply with quote

Piscesian,

Try this JCL. I assumed that your date starts in pos1 for 10 bytes in CCYY-MM-DD format.

Code:

//STEP0100 EXEC PGM=SORT     
//SYSOUT   DD SYSOUT=*       
//SYMNAMES DD *               
M01END,C'31'                 
M02END,C'28'                 
M03END,C'31'                 
M04END,C'30'                 
M05END,C'31'                 
M06END,C'30'                 
M07END,C'31'                 
M08END,C'31'                 
M09END,C'30'                 
M10END,C'31'                 
M11END,C'30'                 
M12END,C'31'                 
M13END,C'29'                 
//SORTIN   DD DSN=your input file,
//            disp=shr
//SORTOUT  DD dsn=your output file,
//            disp=(new,catlg,delete),
//            unit=sysda,
//            space=(trk,(1,1),rlse)
//SYSIN    DD *                                       
  OPTION COPY                                         
  INREC IFTHEN=(WHEN=INIT,                             
       OVERLAY=(21:01,04,ZD,MOD,+4,EDIT=(T),           
                22:01,04,ZD,MOD,+100,EDIT=(TTT),       
                25:01,04,ZD,MOD,+400,EDIT=(TTT),       
                30:+1,ADD,06,02,ZD,EDIT=(TT))),       
                                                       
        IFTHEN=(WHEN=(25,3,ZD,EQ,0,OR,                 
                     (21,1,ZD,EQ,0,AND,22,3,ZD,GT,0)),
       OVERLAY=(28:C'L'),HIT=NEXT),                   
                                                       
        IFTHEN=(WHEN=(30,2,ZD,EQ,13),                 
       OVERLAY=(01:+1,ADD,01,04,ZD,EDIT=(TTTT),       
                06:C'01',                             
                09:M01END)),                           
                                                       
        IFTHEN=(WHEN=(30,2,ZD,EQ,02,AND,               
                      28,1,CH,EQ,C' '),               
       OVERLAY=(06:30,2,09:M02END)),                   
                                                       
        IFTHEN=(WHEN=(30,2,ZD,EQ,02,AND,               
                      28,1,CH,EQ,C'L'),               
       OVERLAY=(06:30,2,09:M13END)),                   
                                                       
        IFTHEN=(WHEN=(30,2,ZD,EQ,03),                 
       OVERLAY=(06:30,2,09:M03END)),                   
                                                       
        IFTHEN=(WHEN=(30,2,ZD,EQ,04),                 
       OVERLAY=(06:30,2,09:M04END)),                   
                                                       
        IFTHEN=(WHEN=(30,2,ZD,EQ,05),                 
       OVERLAY=(06:30,2,09:M05END)),                   
                                                       
        IFTHEN=(WHEN=(30,2,ZD,EQ,06),                 
       OVERLAY=(06:30,2,09:M06END)),                   
                                                       
        IFTHEN=(WHEN=(30,2,ZD,EQ,07),
       OVERLAY=(06:30,2,09:M07END)), 
                                     
        IFTHEN=(WHEN=(30,2,ZD,EQ,08),
       OVERLAY=(06:30,2,09:M08END)), 
                                     
        IFTHEN=(WHEN=(30,2,ZD,EQ,09),
       OVERLAY=(06:30,2,09:M09END)), 
                                     
        IFTHEN=(WHEN=(30,2,ZD,EQ,10),
       OVERLAY=(06:30,2,09:M10END)), 
                                     
        IFTHEN=(WHEN=(30,2,ZD,EQ,11),
       OVERLAY=(06:30,2,09:M11END)), 
                                     
        IFTHEN=(WHEN=(30,2,ZD,EQ,12),
       OVERLAY=(06:30,2,09:M12END))   
                                     
  OUTREC BUILD=(01,10)               
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Mon Aug 13, 2007 4:25 pm    Post subject: Reply with quote

thx Kolusu, another keeper to the dbzPDF archives.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Piscesian
Beginner


Joined: 17 Dec 2004
Posts: 14
Topics: 8
Location: Monrovia,California

PostPosted: Wed Aug 22, 2007 12:51 pm    Post subject: Reply with quote

Thanks Kolusu,
This is really useful....
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group