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
 

 

Sort to include date check for mmddyy format

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Aneesh

New User


Joined: 30 Sep 2006
Posts: 60

PostPosted: Fri Oct 17, 2008 9:32 pm    Post subject: Sort to include date check for mmddyy format
Reply with quote

Hi,

I have a FB file of length 80 that has a date field in positions 10-15 - the date is in the format mmddyy.

I need to extract all records with the date greater than current date - 7 days (all records in the past week).

Can this be done in a sort step?

Thanks in advance,
Aneesh.
Back to top
View user's profile Send private message

Skolusu

Senior Member


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

PostPosted: Fri Oct 17, 2008 10:12 pm    Post subject:
Reply with quote

Aneesh,

use the following control cards

Code:

//SYSIN    DD *                       
  SORT FIELDS=COPY                     
  INCLUDE COND=(10,6,Y2W,GT,Y'DATE1'-7)
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Sat Oct 18, 2008 12:15 am    Post subject:
Reply with quote

My first suggestion would be exec the designer.
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 Oct 18, 2008 12:54 am    Post subject:
Reply with quote

??????? Could you be a little more cryptic.
Back to top
View user's profile Send private message
Aneesh

New User


Joined: 30 Sep 2006
Posts: 60

PostPosted: Sat Oct 18, 2008 2:25 am    Post subject: Reply to: Sort to include date check for mmddyy format
Reply with quote

Thanks Kolusu - but i have one confusion. The following is from one of the sort manuals. The DATE1 constant is specified for yymmdd. The format that i have the input is mmddyy - am i looking at something wrong?

Operand Constant
DATE1, DATE1-d, DATE1+d C'yyyymmdd'
DATE1(c), DATE1(c)-d, DATE1(c)+d C'yyyycmmcdd'
DATE1P, DATE1P-d, DATE1P+d +yyyymmdd
DATE2, DATE2-m, DATE2+m C'yyyymm'
DATE2(c), DATE2(c)-m, DATE2(c)+m C'yyyycmm'
DATE2P, DATE2P-m, DATE2P+m +yyyymm
DATE3, DATE3-d, DATE3+d C'yyyyddd'
DATE3(c), DATE3(c)-d, DATE3(c)+d C'yyyycddd'
DATE3P, DATE3P-d, DATE3P+d +yyyyddd
DATE4 C'yyyy-mm-dd-hh.mm.ss'
Y'DATE1', Y'DATE1'-d, Y'DATE1'+d Y'yymmdd'
Y'DATE2', Y'DATE2'-m, Y'DATE2'+m Y'yymm'
Y'DATE3', Y'DATE3'-d, Y'DATE3'+d Y'yyddd'

Thanks,
Aneesh.
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 Oct 18, 2008 2:39 am    Post subject:
Reply with quote

Kolusu knows what he's doing.

Y2W is for an mmddyy date. DATE1 is for yymmdd date. But when you use Y2W vs Y'DATE1'-d, DFSORT is smart enough to handle the comparison between mmddyy and yymmdd correctly (trust me - I wrote the code).

For more information on comparisons with Y2x format, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.7.12.1
Back to top
View user's profile Send private message
Aneesh

New User


Joined: 30 Sep 2006
Posts: 60

PostPosted: Sat Oct 18, 2008 2:58 am    Post subject: Reply to: Sort to include date check for mmddyy format
Reply with quote

Thanks a lot, Frank, Kolusu. It was not an attempt to question the masters - just wanted to clear the doubt. It was a mistake from my side not reading the manual carefully enough - i apologize.

Once again, thanks.

Thanks,
Aneesh.
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 Oct 18, 2008 3:15 am    Post subject:
Reply with quote

Oh, that's ok. It is a rather subtle point. I didn't mean to imply that you were questioning Kolusu's understanding of the function.
Back to top
View user's profile Send private message
eytellene

New User


Joined: 19 May 2009
Posts: 16
Location: Philippines

PostPosted: Mon May 25, 2009 11:51 am    Post subject:
Reply with quote

hi

what if I want to extract the previous months details, would that be possible to?

thanks icon_smile.gif
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue May 26, 2009 8:42 pm    Post subject:
Reply with quote

eytellene wrote:
hi

what if I want to extract the previous months details, would that be possible to?

thanks icon_smile.gif


Depends on what you meant by previous month. Show us an example of your input and desired output and we will show you a way to do it
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    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 pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


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