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 Profile Log in to check your private messages Log in
 
Omitting records from input file based on the date

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

New User


Joined: 09 Jan 2006
Posts: 11

PostPosted: Wed Oct 10, 2007 10:25 pm    Post subject: Omitting records from input file based on the date
Reply with quote

I have requirement is that want to remove records from the input file based on the date.

ie If datefield values greater than 10 years, I don't want to copy to output files.

Date field format yyyy-dd-dd, my file contains records for 2007 and older years.

Thanks & Regards
Suresh
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 Oct 10, 2007 10:40 pm    Post subject:
Reply with quote

Please show an example of your input records and what you expect for output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of all relevant fields.
Back to top
View user's profile Send private message
rksuresh

New User


Joined: 09 Jan 2006
Posts: 11

PostPosted: Wed Oct 10, 2007 10:50 pm    Post subject:
Reply with quote

Hi,

See this
starting pos- 189
ending pos- 198
format yyyy-mm-dd
value - 1991-06-04

My file size is 640 LRECL ,the date field comes in the starting position of 189.based on that field i want check year ,if it is greater than 10 years i want to remove.(i mean not want populate to output file).

Thanks & Regards
Suresh
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 Oct 10, 2007 11:02 pm    Post subject:
Reply with quote

Quote:
if it is greater than 10 years i want to remove


It's not clear what you mean by this. Greater than 10 years from when? Do you mean earlier than 10 years from the run date (e.g. 2007-10-10 is today's run date)? 1991-06-04 is earlier than today's date. Are you looking at just the year or the year, month and day? For example, 2007-10 years would be 1997, so would any 1997 date qualify or only certain 1997 dates based on their month and day and the month and day of the run date (e.g. would 1997-05-10 qualify? would 1997-12-15 qualify?).

You need to be more clear about what exactly you want to do. Showing a good example of your input records with dates that meet your criteria and don't meet your criteria, and your expected output records, would help.
Back to top
View user's profile Send private message
rksuresh

New User


Joined: 09 Jan 2006
Posts: 11

PostPosted: Wed Oct 10, 2007 11:17 pm    Post subject:
Reply with quote

Hi,

Thanks for your feedback
yes you are correct .
Example of input file

Code:

+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----
**************************** Top of Data **********************************
 85007406047 ACADEMY ORTHOPEDICS LLC                  1991-06-04 2007-06-04
 16095503964 LINARES, JESUS                           2007-06-08 2007-06-08
 85098262761 ALABAMA ORTHOPAEDIC CLINIC PC            1992-06-13 2007-06-13
 85007403985 HARRISON MEMORIAL HOSPITAL               2007-04-06 2007-04-06
 44098583667 WALTER W STRAUSER MD INC                 1993-07-09 2007-07-09
 85007406369 BOSTON UNIVERSITY ORTHOPAEDIC            2007-07-02 2007-07-02
 60091772833 KENTUCKY PAIN PHYSICIANS PSC             1994-06-21 2007-06-21
 67097887409 HLTH & MEDCL PRAC ASSOC                  1995-06-11 2007-06-11


I want to check only year not the month and date.
from the 1st input file date value is "1991-06-04 " in this year is greater than 10 year.So i dont want this record.If it is 97 to 2007 records i want to populate to output file.

from the above samlpe file information my output file need only 3 records.
Thanks & Regards
Suresh
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: Thu Oct 11, 2007 2:15 am    Post subject:
Reply with quote

Here's a DFSORT job that will do what I think you want. I assumed you want to keep all input records that have current_year-10 (e.g. 2007-10=1997) or higher in positions 89-92.

Code:

//S1    EXEC  PGM=ICEMAN                                             
//SYSOUT    DD  SYSOUT=*                                             
//SYMNAMES DD *                                                     
YR,S'&YR4'                                                           
//SORTIN DD *                                                       
RECORD                                                               
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)     
//SYSIN    DD    *                                                   
  OPTION COPY                                                       
  INREC OVERLAY=(51:YR,1:C'TARG_YR,+',51,4,ZD,SUB,+10,EDIT=(TTTT))   
//S2    EXEC  PGM=ICEMAN                                             
//SYSOUT    DD  SYSOUT=*                                             
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)                               
//SORTIN DD DSN=&&IN,DISP=(OLD,PASS)                                 
//SORTOUT DD SYSOUT=*                                               
//SYSIN    DD    *                                                   
  OPTION COPY                                                       
  INCLUDE COND=(89,4,ZD,GE,TARG_YR)                                 
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 Validate the Date girishb2 DFSORT/ICETOOL 8 Tue Sep 19, 2017 1:12 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

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