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
 
selecting records using date format mm/dd/yy

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

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Wed Jul 29, 2009 3:25 am    Post subject: selecting records using date format mm/dd/yy
Reply with quote

Hi,

I need to select records from a dataset (LRECL=80 and RECFM=FB) which are created in last 45 days.

My file contain data as below:

FEAIX115 06/01/08 (DATE FIELD start at 10th Position)
FEAIX116 07/03/08
FEAIX117 07/05/07
FEAIX118 09/22/07
FEAIX120 06/13/09
FEAIX121 06/16/09
FEAIX122 07/02/09
FEAIX123 06/01/09
FEAIX124 06/05/09
FEAIX125 08/04/09
My Sysin contain the below code..
SORT FIELDS=COPY
INREC FIELDS=(1,11,13,2,15,2,2X,19,61)
INCLUDE COND=(10,6,Y2W,GE,Y'DATE1'-45)

But my output is showing "FEAIX118" which is created in 2007.
Can anybody let me know what I am missing? Please correct me.
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: Wed Jul 29, 2009 3:49 am    Post subject:
Reply with quote

The INCLUDE statement is processed before the INREC statement. Y'DATE1'-45 is a constant in the form yymmdd but the field you're comparing it to is yy/mm/dd so you won't get a match. You need to reformat the field to yymmdd so you can compare them. You can use INREC with UFF to extract yymmdd from yy/mm/dd and then use OUTFIL INCLUDE to do the compare. OUTFIL is processed after INREC.

I'd show you how to do it, but I'm having trouble matching your INREC to your input data since you say the date starts at 10, but you have 1,11 etc in INREC so I don't know what you want the output to look like.

If you need more help with this, show me an example of your input records with ubb code tags and the expected output with ubb code tags. Tell me the RECFM and LRECL of the input file and the starting position, length and format of each input and output field.
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Wed Jul 29, 2009 4:25 am    Post subject: Reply to: selecting records using date format mm/dd/yy
Reply with quote

I tried using OUTFIL INCLUDE and UFF in Inrec Build, but still I am getting the same problem.
My Input data - Input file record Length=80 and RECFM=FB
Code:

FEAIX115 06/01/08
FEAIX116 07/03/08
FEAIX117 07/05/07
FEAIX118 09/22/07
FEAIX120 06/13/09
FEAIX121 06/16/09
FEAIX122 07/02/09
FEAIX123 06/01/09
FEAIX124 06/05/09
FEAIX125 08/04/09


Output Record Length =80 and Recfm=FB, Output will contain below records

Code:

FEAIX121 06/16/09
FEAIX122 07/02/09
FEAIX125 08/04/09
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Jul 29, 2009 5:40 am    Post subject: Reply to: selecting records using date format mm/dd/yy
Reply with quote

surya_pathaus,

use the following control cards.

Code:

//SYSIN    DD *                                         
  SORT FIELDS=COPY                                       
  INREC OVERLAY=(81:10,8,UFF,ZD,LENGTH=6)               
  OUTFIL BUILD=(1,80),INCLUDE=(81,6,Y2W,GE,Y'DATE1'-45) 
/*
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Thu Jul 30, 2009 1:38 am    Post subject: Reply to: selecting records using date format mm/dd/yy
Reply with quote

Kolusu,

When I executed the JCL with the code provided by you, following data is written into output

Code:

FEAIX115 06/01/08 
FEAIX116 07/03/08 
FEAIX117 07/05/07 
FEAIX118 09/22/07 
FEAIX121 06/16/09 
FEAIX122 07/02/09 
FEAIX125 08/04/09 


When I compared the output 2009 data (FEAIX120,FEAIX123,FEAIX124 are execluded) is compared successfully and required records (FEAIX121,FEAIX122,FEAIX125) are written into output. As I understood, Y2W window starts from 2009 year.. I think that is the reason it is not comparing the records which are from 2008 and 2007.

Let me know your comments and suggestions.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Jul 30, 2009 3:51 am    Post subject: Reply to: selecting records using date format mm/dd/yy
Reply with quote

surya_pathaus,

Looks like your shop has set the Y2past value to 1909. If you looked at the sysout you should have found
Code:

ICE168I 0 CENTURY WINDOW FOR Y2 FORMAT FIELDS IS FROM 1909 TO 2008


which tells you the century window used. You can override the Y2PAST option to increase the century window

use the following control cards
Code:

//SYSIN    DD *
  OPTION Y2PAST=1929                                   
  SORT FIELDS=COPY                                     
  INREC OVERLAY=(81:10,8,UFF,ZD,LENGTH=6)               
  OUTFIL BUILD=(1,80),INCLUDE=(81,6,Y2W,GE,Y'DATE1'-45)
//*


and your sysout will have this

Code:

ICE168I 0 CENTURY WINDOW FOR Y2 FORMAT FIELDS IS FROM 1929 TO 2028   
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 Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am

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