Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
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.
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).
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
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.
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
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
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.