MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
nbdtrjk1 Beginner Joined: 12 Apr 2007 Posts: 76 Topics: 41
Posted: Mon Sep 20, 2010 4:52 am Post subject: Date comparision in JCL
All,
I have a dataset which have set records in the format of MM/DD/YYYY below Data.
Code: 11/25/2009
10/10/2009
10/12/2009
06/29/2009
09/21/2009
10/30/2009
09/12/2009
08/20/2009
07/16/2009
09/27/2009
04/15/2010
10/14/2009
09/20/2009
11/02/201
I would like to filter the records(using pgm=sort) which is older than today date by using the below control statements.
Code: SORT FIELDS=COPY
INCLUDE COND=(1,10,LT,&DATE(MD4/)),FORMAT=ZD
OUTREC FIELDS=(1,30)
but i am getting syntax error
Can someone please help me to correct the above error.
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Mon Sep 20, 2010 10:17 am Post subject:
nbdtrjk1 ,
It is not a valid syntax. You cannot compare MM/DD/YYYY date. you need to format it to YYYY/MM/DD and then perform the comparision
Assuming your Input lrecl is FB 30 bytes use the following control cards
Code:
//SYSIN DD *
SORT FIELDS=COPY
INREC OVERLAY=(31:7,4,1,2,4,2,DATE1)
OUTFIL BUILD=(1,30),INCLUDE=(31,8,CH,LT,39,8,CH)
//*
_________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
nbdtrjk1 Beginner Joined: 12 Apr 2007 Posts: 76 Topics: 41
Posted: Mon Sep 20, 2010 11:32 pm Post subject:
Thanks kolusu..it is working fine
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum