Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to use PURGE command on VAX 1

Status
Not open for further replies.

shaily123

Programmer
Feb 5, 2005
17
US
Hi,

I am working on VAX/VMS with COBOL.

I have a cobol program runs by a command procedure and it creates report name test_report_'p1'.rpt

Here p1 is the current date. This command procedure runs every day with nightly_job. So every day reports created with test_report_'p1'.rpt.

Rigth now there are around 200 reports and i need to purge it and keep 12 reports.

Question : I need purge statement which keeps 12 reports and purge rest of them.

I tried

$ purge/keep=12 test_report_*.rpt but it is not working as p1 always gives different value and if i do a DIR then it looks like

$dir
test_report_08072005.rpt;1
test_report_08082005.rpt;1
test_report_08092005.rpt;1
test_report_08102005.rpt;1
test_report_08112005.rpt;1
test_report_08122005.rpt;1
test_report_08132005.rpt;1
test_report_08142005.rpt;1

In this version of all the files are 1 so it's not purging. I think I have to use DELETE/SINCE=DATE but do not know how to read correct DATE for SINCE.

Please help.

Thank you.
 
shaily123,

Ah, why oh why are you posting a COBOL question in an RPG forum?

Confused,
MdnghtPgmr
 
Hi,

Use:
$delete/before="-12-" test_report_????????.rpt;*

To delete all report older than 12days.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top