Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Can we delete records older than 14 months using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Can we delete records older than 14 months using SORT
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: 8593
Location: Back in jolly old England

PostPosted: Thu Aug 06, 2009 1:00 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Aug 06, 2009 8:31 pm    Post subject:
Reply with quote

K2,

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

http://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    Post subject:
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 Moderator


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

PostPosted: Sat Aug 08, 2009 4:16 am    Post subject:
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    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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us