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: 8657
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 numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am

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