Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
select records with date range(mmddyy)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: select records with date range(mmddyy)
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    Post subject:
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 Moderator


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

PostPosted: Sat Jun 25, 2011 3:50 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us