View previous topic :: View next topic
|
Author |
Message |
Suganya87
New User
Joined: 09 May 2016 Posts: 12 Location: India
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Every month you will have the same dates? Are you sure? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Does this relate to your other question? Amaze me, and say No. |
|
Back to top |
|
|
Suganya87
New User
Joined: 09 May 2016 Posts: 12 Location: India
|
|
|
|
Yes I have same date , but I need to pass the month dynamically |
|
Back to top |
|
|
Suganya87
New User
Joined: 09 May 2016 Posts: 12 Location: India
|
|
|
|
hi bill,
yes it is related to my other questions I have posted already.
Thanks |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
|
|