Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us