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: 1715
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: 7234

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: 2164
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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts How to get previous month in SYMNAMES Suganya87 SYNCSORT 9 Fri Oct 28, 2016 1:37 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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