HOUSE KEEPING STREAM FILES

pts.
Tags:
AS/400
CLP
DataCenter
RPG
RPGLE
I would like to write a utility which housekeeps stream files in the ifs based upon how many days ago the file was CREATED. Does any body know an API for this (an API which is easy enough to work with 'RPG' and/or 'CL' and NOT 'C') The DSPLNK CL command doesn't provide the creation date it would appear and the closest API I can find is QHFOPNDIR, which I have been told is for QDLS and not IFS?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Ron Turull did such a utility a while ago and the source can be found at http://tinyurl.com/mje65.

All the best

Jonathan

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • MilesButler
    Use the UNIX shell within CLP to analise the IFS directory Command STRQSH This will allow you to use UNIX type commands "LS" list, "RM" remove etc (almost like "DOS" but annoyingly different). You can redirect the output from the "unix" commands back to a physical file within your CLP. Example: /* Redirect output from STRQSH session to IFS file */ ADDENVVAR ENVVAR(QIBM_QSH_CMD_OUTPUT) + VALUE('FILE=/IFSDirectory/LISTFILE.TXT') + REPLACE(*YES) MONMSG MSGID(CPFA980) /* Creates a Directory listing in LISTFILE.TXT in IFSDirectory */ CHGVAR VAR(&CMD) VALUE('LS /IFSDirectory/(files to list)) STRQSH CMD(&CMD) MONMSG MSGID(QSH0002) /* Copy Directory Listing from the previous step to iSeries PF QTEMP/CSPLSOUT CPYFRMSTMF FROMSTMF('/IFSDirectory/LISTFILE.TXT') + TOMBR('/QSYS.LIB/QTEMP.LIB/iSeriesFile.FILE/ iSeriesFile + .MBR') MBROPT(*REPLACE) MONMSG MSGID(CPFA0A9 CPFA095) Analise the data on the iSeries and then use the RM remove unix command. Other Unix commands may be mor apropriate. Miles
    0 pointsBadges:
    report
  • MTharp
    You could also use C procedure Qp01GetAttr(). The return data structure includes a 10 digit integer variable listing the number of seconds from epoch (01/01/1970 00hh 00mm 00ss) allowing you to calculate the date/time the object was created. The procedure can be prototyped and invoked within an RPG program. Reference material on iSeries UNIX type IFS APIs can be found on the IBM InfoCenter Website.
    0 pointsBadges:
    report
  • JPLamontre
    look at this RPG tool : http://jplamontre.free.fr/AS400/DSPIFS.htm it walks IFS, can show data inside file. In the code, there is 3 calls to the 'stat' api : rc = stat (pathdirs: myStat ); rc = stat64 (pathdirs: myStat64 ); rc = statvfs(pathdirs: myStatVFS ); here is one solution to your question.
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following