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 How to select record x+7 or x+2 based... JoAnn Kulcyk SYNCSORT 6 Tue Jan 16, 2018 10:49 pm
No new posts Skip records depends on count lakshmiibmmainframes DFSORT/ICETOOL 5 Sun Dec 24, 2017 9:51 pm
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm
No new posts Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 9 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm

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