MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Date comparision in JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
nbdtrjk1
Beginner


Joined: 12 Apr 2007
Posts: 76
Topics: 41

PostPosted: Mon Sep 20, 2010 4:52 am    Post subject: Date comparision in JCL Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12369
Topics: 75
Location: San Jose

PostPosted: Mon Sep 20, 2010 10:17 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
nbdtrjk1
Beginner


Joined: 12 Apr 2007
Posts: 76
Topics: 41

PostPosted: Mon Sep 20, 2010 11:32 pm    Post subject: Reply with quote

Thanks kolusu..it is working fine
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group