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

Dates and comparisons


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

New User


Joined: 15 Feb 2006
Posts: 11
Location: Tampa, FL

PostPosted: Tue May 09, 2006 8:02 pm
Reply with quote

I'm trying to pull all records from a file that have an effective date (which is in a field in the file) during the last month. I know I could hardcode it each month to pull what I want, but wanted to try to automate it. I know I've done other good stuff with sort and icetool, so hopefully somebody will be able to help. Here's one of the many things I've tried, all of which give syntax errors. I've also tried moving it to the include, using ADD and/or SUB, and other things. Is it possible to manipulate the date for comparison purposes?

INREC FIELDS=(DATE2,DATE2-1,1,261)
INCLUDE COND=(14,7,CH,EQ,C'150ALRM',AND,
219,6,CH,LT,1,6,AND,
219,6,CH,GE,7,6)
SORT FIELDS=COPY
OUTREC FIELDS=(13,261)
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 May 09, 2006 8:51 pm
Reply with quote

You can use DATE2 and DATE2-1 in the INCLUDE, OMIT, INREC, OUTREC and OUTFIL statements with DFSORT, but you'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006). If you don't have it, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTFs, see:

Use [URL] BBCode for External Links

I'm not sure of the positions of your fields, but I'd guess the control statements you need are:

Code:

   INCLUDE COND=(2,7,CH,EQ,C'150ALRM',AND,   
     213,6,CH,LT,DATE2,AND,                 
     213,6,CH,GE,DATE2-1)                   
   SORT FIELDS=COPY                         
Back to top
View user's profile Send private message
tampakenny

New User


Joined: 15 Feb 2006
Posts: 11
Location: Tampa, FL

PostPosted: Tue May 09, 2006 9:15 pm
Reply with quote

That's exactly what I needed. Thanks for the link to the doc too. It's much appreciated. I'll get with the systems guys and see if we can get this PTF installed.
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 Amount of days between two dates PL/I & Assembler 8
No new posts Dates compare on specific dates using... DFSORT/ICETOOL 2
No new posts Comparing dates in different formats SYNCSORT 4
No new posts Sort Card : To get the records with ... DFSORT/ICETOOL 7
No new posts difference between dates in months C... Testing & Performance 6
Search our Forums:

Back to Top