Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2408
Location: Hampshire, 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

Moderator Emeritus


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

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: 2482
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 Required Date Format in Include Sort ... vivky_vivek DFSORT/ICETOOL 6 Fri Aug 14, 2020 6:52 am
No new posts Trying to add current date in place o... shub2204 DFSORT/ICETOOL 8 Wed Aug 12, 2020 4:14 pm
No new posts Determine what library member is in, ... mdwait JCL & VSAM 9 Thu Jul 23, 2020 3:02 am
No new posts Populating Date and Sequence numer in... PORYES SYNCSORT 11 Thu Jul 16, 2020 5:01 pm
No new posts How to filter out certain records bas... manugeorge2004 JCL & VSAM 5 Wed Jun 17, 2020 10:05 pm

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