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 Usergroups Profile Log in to check your private messages Log in
 

 

Omit records which are more than 5 years old

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Omit records which are more than 5 years old
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Thu Sep 13, 2007 12:06 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Sep 13, 2007 8:05 pm    Post subject:
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    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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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