IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

select records with date range(mmddyy)


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rohanatl

New User


Joined: 21 Oct 2005
Posts: 22

PostPosted: Sat Jun 25, 2011 3:20 am
Reply with quote

Hi All,

Please help me to solve the requirement, From the input file we have to pull records in the date range( greater or equal june-01-2007 and less or equal OCT-31-2010)

Sample file
in_date(mmddyy)...
1----- 6---------------80
102907
110507
121108
111908
120309
121008
121508

I tried with the below code but , not giving the correct results.
sort fileds=copy
include cond=(1,6,ZD,GT,060107 and 1,6,ZD,LE,083110)

120309 is GT 060107 but its not LT 083110


Please let me know how we can pull the records in the date range mention ie GE,060107 and LE, 083110
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat Jun 25, 2011 3:42 am
Reply with quote

rohanatl,

You need to use Y2W format instead of ZD format. Isn't OCT the 10th month of the year? You say october and you use 08 as month. use the following DFSORT JCL. use Y'date' in yymmdd format to compare.

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                               
052907                                                         
102907                                                         
110507                                                         
121108                                                         
111908                                                         
120309                                                         
121008                                                         
121508                                                         
111510                                                         
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                             
  INCLUDE COND=(1,6,Y2W,GE,Y'070601',AND,1,6,Y2W,LE,Y'101031')
//*
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Jun 25, 2011 3:50 am
Reply with quote

I came up with the same solution as Kolusu, but used:

Code:

  OPTION COPY,Y2PAST=1980


to make sure the century window was ok (1980-2079).
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts To get the count of rows for every 1 ... DB2 3
Search our Forums:

Back to Top