IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to pass the previous month date in include condition


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   This topic is locked: you cannot edit posts or make replies.
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
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: 2448
Location: Hampshire, UK

PostPosted: Mon Oct 31, 2016 4:18 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Mon Oct 31, 2016 4:22 pm
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
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
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: 2481
Location: @my desk

PostPosted: Mon Oct 31, 2016 7:34 pm
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. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Date conversion using SORT SYNCSORT 4
No new posts include cond ascii constant DFSORT/ICETOOL 4
No new posts Execute step regardless of previous s... JCL & VSAM 2
No new posts REMOVE DUPLICATE RECORDS BASED ON A S... DFSORT/ICETOOL 4
No new posts Last day of the month via SYNCSORT. SYNCSORT 5
Search our Forums:

Back to Top