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

Omit records which are more than 5 years old


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

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Thu Sep 13, 2007 11:57 am
Reply with quote

Hi,

I want to exclude the records which are more than 5 years old.
The problem is, i can't give the specific year.
It should run for each year automatically.

Is there any way to do it?

regards,
sharad
Back to top
View user's profile Send private message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Thu Sep 13, 2007 11:58 am
Reply with quote

sorry to bother you again?
the constraint is, i need to do it thru SORT?
please advice.

-
sharad
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu Sep 13, 2007 12:06 pm
Reply with quote

sharad,

How do you identify the record which is more than 5 years old? Do you have nay field for this, what is the date format?
Back to top
View user's profile Send private message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Thu Sep 13, 2007 12:08 pm
Reply with quote

yes!...
we have a certain field for them.
say it starts with cloumn 5 and ends with cloumn 8. ie. total length is 4.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Thu Sep 13, 2007 12:15 pm
Reply with quote

What is this col 5 to 8 looks like.

Anyway with some assumption Im posting this:

In the SORT omit condition you can use date function with relative -5 to years.
Back to top
View user's profile Send private message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Thu Sep 13, 2007 12:23 pm
Reply with quote

please explain it a bit more.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Thu Sep 13, 2007 12:26 pm
Reply with quote

Quote:
say it starts with cloumn 5 and ends with cloumn 8. ie. total length is 4.

what data is in this field?
Back to top
View user's profile Send private message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Thu Sep 13, 2007 12:33 pm
Reply with quote

it looks like

$$$$2007

where $ represent any character?

now i want that only 2007 - 2003 should be included?
i hope it is more of a clear now.
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 Sep 13, 2007 8:05 pm
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
* Create DFSORT Symbol as follows:
* Year,'yyyy'
* where yyyy is current year - 4
  INREC OVERLAY=(21:DATE2,
    1:C'Year,''',21,4,ZD,SUB,+4,EDIT=(TTTT),C'''',21:60X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...   input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
* Use Year symbol in INCLUDE statement
  INCLUDE COND=(5,4,CH,GE,Year)
/*
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 and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top