IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Extracting records with INCLUDE based on YYMMDD date.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kasibhatla_hari

New User


Joined: 20 May 2005
Posts: 11
Location: IRELAND

PostPosted: Tue Aug 25, 2009 8:36 pm
Reply with quote

I have a requirement where I need to extract records based on a date field in Y2 Format. i.e. in YYMMDD.

The req is to extract all the records which are generated today i.e. the date in 149 POSITION of file and will be 250809 for todays records.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Aug 25, 2009 8:42 pm
Reply with quote

kasibhatla_hari wrote:
Hi,
I have a requirement where I need to extract records based on a date field in Y2 Format. i.e. in YYMMDD.

The req is to extract all the records which are generated today i.e. the date in 149 POSITION of file and will be 250809 for todays records.

I request if some one has a code to do it by DFSORT else I need to go with Easytrieve or COBB.

Thanks a mill


250809 or 090825?

What is the format of the date, Zoned decimal, packed decimal, binary?
Back to top
View user's profile Send private message
kasibhatla_hari

New User


Joined: 20 May 2005
Posts: 11
Location: IRELAND

PostPosted: Tue Aug 25, 2009 8:50 pm
Reply with quote

Hi Craq, Apologise for the unduly chaos created by me. The date is in 090825 format.

Sample data furnished below: Pl. ack. Thanx a mill.

Code:
 COMMAND ===>
-5----+----6----+----7----+----8
840228X       010823       03
840228X       020307       09
840704X       010301       00
871021X       010307       06
840228X       090714P      1ZZ 0
840228X       970623       1ZZ 0
961022X       010927       03
020306X       020515       09
Code'd
Back to top
View user's profile Send private message
kasibhatla_hari

New User


Joined: 20 May 2005
Posts: 11
Location: IRELAND

PostPosted: Tue Aug 25, 2009 9:34 pm
Reply with quote

I tried the below SYSIN but I couldn't figure it out what I am missing. I tried (153,6,Y2W,EQ,Y'DATE1')( its a VB file so 149 +4). But the output is picking up OLD dates.

Code:

//SYSIN    DD  *
     SORT  FIELDS=(COPY)
     OPTION VLSHRT
     INCLUDE COND=((248,01,CH,EQ,C'F'),OR,
                   (014,15,CH,EQ,C'AAAAAAAAAAAAAAA'),OR,
                   (014,15,CH,EQ,C'ZZZZZZZZZZZZZZZ'),AND,
                   (153,6,Y2W,EQ,Y'DATE1'))
     OUTFIL FNAMES=SORTOUT,OUTREC=(1:1,4,5:5,748),VLFILL=C' '
/*


OUTPUT:

Command ===>
-5----+----6----+----7----+
071123X.......090209 ......
010417X.......011123 ......
000504X.......020307 ......
990119X.......020307 ......
840503X.......020307 ......
010907X.......020308 ......
010222X.......020307 ......
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Aug 25, 2009 10:24 pm
Reply with quote

Y2W is for a CH or ZD date in mmddyy form. Y2T is for a CH or ZD date in yymmdd form.

It's not really clear which form of the date you have and where it is.

If it's really in 149+4 = 153 and in the form 'yymmdd', then 153,6,Y2T,EQ,Y'DATE1' should work.

I'd also suggest using VLSCMP instead of VLSHRT.

If that doesn't work, then you need to do a better job of showing your input records and expected output and giving the correct starting position, length and format and form of the date.
Back to top
View user's profile Send private message
kasibhatla_hari

New User


Joined: 20 May 2005
Posts: 11
Location: IRELAND

PostPosted: Tue Aug 25, 2009 10:50 pm
Reply with quote

Perfect Frank its working. Thanx a mill for all your help. I didn't change VLSHRT to VLSCMP.

WORKING CODE:
--------------------

Code:

  SORT  FIELDS=(COPY)
  OPTION VLSHRT
  INCLUDE COND=(((153,6,Y2T,EQ,Y'DATE1'),AND,
               (248,01,CH,EQ,C'F')),OR,
              ((014,15,CH,EQ,C'AAAAAAAAAAAAAAA'),OR,
               (014,15,CH,EQ,C'ZZZZZZZZZZZZZZZ')))
  OUTFIL FNAMES=SORTOUT,OUTREC=(1:1,4,5:5,748),VLFILL=C' '
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top