Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to pass the previous month date in include condition

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Suganya87

New User


Joined: 09 May 2016
Posts: 12
Location: India

PostPosted: Mon Oct 31, 2016 4:13 pm    Post subject: How to pass the previous month date in include condition
Reply with quote

Hi

I have requirement to automate the below JCL and control cards to run on 19 of every month
to fetch the data in 2016-09-17 & 2016-10-18


Code:
//SYSPRINT DD SYSOUT=*                                         
 //SYSOUT   DD SYSOUT=*                                         
 //SORTIN    DD DISP=SHR,DSN= dsn name     
 //SORTOUT   DD DSN=dsn name1,                     
 //            DISP=(NEW,DELETE,DELETE),                       
 //            SPACE=(CYL,(10,05)),MGMTCLAS=LUSE180,           
 //            DCB=(RECFM=FB,LRECL=58,BLKSIZE=5800)             
 //SYSIN    DD *                                               
  INCLUDE COND=(001,10,CH,GE,C'2016-09-17',&,                           
               001,10,CH,LE,C'2016-10-18')                         
    SORT FIELDS=(1,04,CH,A)                                     
    END                                                         
 /*


Please let me know to achieve the same

Coded
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1768
Location: UK

PostPosted: Mon Oct 31, 2016 4:18 pm    Post subject:
Reply with quote

Every month you will have the same dates? Are you sure?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Oct 31, 2016 4:22 pm    Post subject: Reply to: How to pass the previous month date in include condition
Reply with quote

Does this relate to your other question? Amaze me, and say No.
Back to top
View user's profile Send private message
Suganya87

New User


Joined: 09 May 2016
Posts: 12
Location: India

PostPosted: Mon Oct 31, 2016 5:33 pm    Post subject:
Reply with quote

Yes I have same date , but I need to pass the month dynamically
Back to top
View user's profile Send private message
Suganya87

New User


Joined: 09 May 2016
Posts: 12
Location: India

PostPosted: Mon Oct 31, 2016 5:35 pm    Post subject:
Reply with quote

hi bill,

yes it is related to my other questions I have posted already.

Thanks
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2253
Location: @my desk

PostPosted: Mon Oct 31, 2016 7:34 pm    Post subject: Reply to: How to pass the previous month date in include condition
Reply with quote

You could either do something like this, or use the same date functions and build symbols as Bill suggested in your duplicate topic.
Code:
//STEP01   EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                       
2016-09-16                                           
2016-09-17                                           
2016-09-18                                           
2016-10-17                                           
2016-10-18                                           
2016-10-19                                           
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                       
  SORT FIELDS=COPY                                   
  OUTREC OVERLAY=(81:1,4,6,2,9,2,                     
                  89:DATE2-1,95:C'17',DATE2,103:C'18')
  OUTFIL INCLUDE=(81,8,CH,GE,89,8,CH,AND,             
                  81,8,CH,LE,97,8,CH),               
  BUILD=(1,80)         

SORTOUT :
Code:
2016-09-17
2016-09-18
2016-10-17
2016-10-18
OR if you have no issues working with 2-digit years, something like this:
Code:
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  OUTREC OVERLAY=(81:3,2,6,2)                                   
  OUTFIL INCLUDE=((81,4,Y2T,EQ,Y'DATE2'-1,AND,9,2,ZD,GE,17),OR,
                  (81,4,Y2T,EQ,Y'DATE2',AND,9,2,ZD,LE,18)),
  BUILD=(1,80)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    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 LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us