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

Omitting records from input file based on the date


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Wed Oct 10, 2007 10:40 pm
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
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 Developer


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

PostPosted: Wed Oct 10, 2007 11:02 pm
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
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 Developer


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

PostPosted: Thu Oct 11, 2007 2:15 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top