Page 1 of 1

Fetch records using JCL based on current date (yyyy-mm-dd)

PostPosted: Thu Dec 01, 2016 6:50 pm
by mounika1041
I have a file of record length 592 . I have a date field in yyyy-mm-dd format . Now, i should get records only of current date.
I have written jcl code

SORT FIELDS=COPY
INCLUDE COND=(583,7,ZD,EQ,DATE1P)

This is working only for format yyyymmdd but my requirement is to get records of current date which has format yyyy-mm-dd
can anyone please help me ?

Re: Fetch records using JCL based on current date (yyyy-mm-

PostPosted: Fri Dec 02, 2016 1:29 am
by BillyBoyo
What happens when your step runs after midnight? Or you want to do a re-run? Or for testing of any type?

Good systems have a "calendar file(e)" which have all the dates you need. Does your system have one?

Re: Fetch records using JCL based on current date (yyyy-mm-

PostPosted: Fri Dec 02, 2016 2:13 am
by Robert Sample
I have written jcl code

SORT FIELDS=COPY
INCLUDE COND=(583,7,ZD,EQ,DATE1P)
Please note that this is NOT "jcl code" (sic). You have written SORT control records which are used by an invocation of SORT within your JCL. JCL starts with // or /* (as stated in the JCL Reference manual talking about what JCL is -- see table 1).