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

Can we delete records older than 14 months using SORT


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

New User


Joined: 12 Jun 2005
Posts: 44
Location: Boston

PostPosted: Thu Aug 06, 2009 12:52 pm
Reply with quote

Can we use a sort to delete records which are 14 months older? This process needs to run on a monthly basis, so we cannot hard-code a date to compare.

Any suggestions are welcome.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Aug 06, 2009 1:00 pm
Reply with quote

Is the date stored in the record, if so, at which location and in which format.

If not, how would you determine the age of a record.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Aug 06, 2009 2:20 pm
Reply with quote

Show us some sample records from the file..

Also RECFM,LRECL of file.
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 Aug 06, 2009 8:31 pm
Reply with quote

K2,

You can use the technique discussed in the "Include records using relative dates" Smart DFSORT Trick at:

www.ibm.com/support/docview.wss?rs=0&uid=isg3T7000094

If you need more specific help, give more details.
Back to top
View user's profile Send private message
kkxlnc

New User


Joined: 12 Jun 2005
Posts: 44
Location: Boston

PostPosted: Sat Aug 08, 2009 4:04 am
Reply with quote

The DATE1(-)-56 operand corresponds to a C'yyyy-mm-dd' constant for today's date minus 56 days. So the following
control statement will include only those records with a C'yyyy-mm-dd' date in positions 14-23 greater than
today's date - 56 days.

Code:

  INCLUDE COND=(14,10,CH,GT,DATE1(-)-56)


Thank you Frank. That was perfect.
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: Sat Aug 08, 2009 4:16 am
Reply with quote

Glad I could help.
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 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts DELETE SPUFI DB2 1
Search our Forums:

Back to Top