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
 
Extracting records with INCLUDE based on YYMMDD date.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Extracting records with INCLUDE based on YYMMDD date.
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    Post subject: Re: Extracting records with INCLUDE based on YYMMDD date.
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Aug 25, 2009 10:24 pm    Post subject:
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    Post subject:
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    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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

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