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
 

 

Date comparison

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
abhishek mitra

New User


Joined: 24 Feb 2008
Posts: 48
Location: Kolkata

PostPosted: Thu Oct 22, 2009 4:55 pm    Post subject: Date comparison
Reply with quote

Hi,

In my file I have to date fields Like below -

Code:
Start-Date______________End-date
(AN)                                   (AN)
01/01/2004                       31/12/2004
01/01/2005                       31/12/2005
...
...
01/01/2011                       31/12/2011
Code'd
All are alphanumeric data.
I want to get all the values between start-date 01/01/2006 and end-date 31/12/2010 using ICETOOL.

How can this be done?
Back to top
View user's profile Send private message

abhishek mitra

New User


Joined: 24 Feb 2008
Posts: 48
Location: Kolkata

PostPosted: Thu Oct 22, 2009 5:26 pm    Post subject: Re: Date comparison
Reply with quote

abhishek mitra wrote:
Hi,

In my file I have to date fields Like below -

Start-Date______________End-date
(AN) (AN)
01/01/2004_____________31/12/2004
01/01/2005_____________31/12/2005
...
...
01/01/2011_____________31/12/2011

All are alphanumeric data.
I want to get all the values between start-date 01/01/2006 and end-date 31/12/2010 using ICETOOL.

How can this be done?


just edited the input for better visual presentation.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Oct 22, 2009 9:31 pm    Post subject:
Reply with quote

abhishek mitra,

Use the following DFSORT JCL . I assumed that your input is FB and lrecl of 80. You just need to re-arrange the dates in CCCYMMDD format and then use INCLUDE cond on outfil

Code:

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                       
01/01/2004 31/12/2004   DROP                           
01/01/2005 31/12/2005   DROP                           
01/01/2006 31/12/2006   PICK                           
01/01/2007 31/12/2007   PICK                           
01/01/2008 31/12/2008   PICK                           
01/01/2009 31/12/2009   PICK                           
01/01/2010 31/12/2010   PICK                           
01/01/2011 31/12/2011   DROP                           
01/01/2012 31/12/2012   DROP                           
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                       
  SORT FIELDS=COPY                                     
  INREC OVERLAY=(81:7,4,4,2,1,2,X,18,4,15,2,12,2)     
  OUTFIL BUILD=(1,80),                                 
  INCLUDE=(81,8,ZD,GE,20060101,AND,90,8,ZD,LE,20101231)
/*


The output of this job is
Code:

01/01/2006 31/12/2006   PICK
01/01/2007 31/12/2007   PICK
01/01/2008 31/12/2008   PICK
01/01/2009 31/12/2009   PICK
01/01/2010 31/12/2010   PICK
Back to top
View user's profile Send private message
abhishek mitra

New User


Joined: 24 Feb 2008
Posts: 48
Location: Kolkata

PostPosted: Fri Oct 23, 2009 1:44 pm    Post subject:
Reply with quote

Can you please put a few words explaining DROP and PICK? I haven't use it anyday.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1506
Location: Chennai

PostPosted: Fri Oct 23, 2009 1:53 pm    Post subject:
Reply with quote

Hi,

I guess DROP and PICK are just indicators, to have a better viewing of output.
They are not statements or options.(Which I too thought were options initially icon_wink.gif )

Regards,
Back to top
View user's profile Send private message
abhishek mitra

New User


Joined: 24 Feb 2008
Posts: 48
Location: Kolkata

PostPosted: Fri Oct 23, 2009 2:06 pm    Post subject:
Reply with quote

vasanthz wrote:
Hi,

I guess DROP and PICK are just indicators, to have a better viewing of output.
They are not statements or options.(Which I too thought were options initially icon_wink.gif )

Regards,


GR8 icon_lol.gif

Thanks to both of you for your kind attention.
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 add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm


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