DSPLNK Details not complete

225 pts.
Tags:
DSPLNK
We are trying to use DSPLNK to get details of an IFS directory so we can deletd files created more than a certain number of days old.

We user the format

DSPLNK OBJ('/xxx/*') OUTPUT(*PRINT) OBJTYPE(*STMF) DETAIL(*EXTENDED)

The problem is the directory has over 25000 objects in it and the output from the above command only gives us the detailed records of about 9500 of them and those the most recent ones.

Can anyone advise a way around this?



Software/Hardware used:
i-series RPG400

Answer Wiki

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

Hi,

You can use a QSHELL command to do it for you

1.- Start a QSHELL session

STRQSH

2.- Type this command
find /<b>path</b>/<b>dir</b> -ctime <b>+15</b> -exec rm {} \;

Where path and dir are the Path and directory to clean and +15 the number of days to stay in disk (so if a file was created more than 15 days ago it will be removed.

Regards
Wilson

Discuss This Question: 7  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
  • RobertHart
    Have just had someone point out that there are actually over 200,000 objects in the directory, hense the need to do a purge.
    225 pointsBadges:
    report
  • TomLiotta
    ...over 200,000 objects... For your example DSPLNK command, I would expect some 9.2 million print lines out of that many streamfiles. Perhaps around half a million pages... With only 9500 objects, I'd think in terms of 20k pages with maybe 437k print lines. (Give or take some percentage...) Is this a multi-level directory? If so, do you intend to retain subdirectories? Tom
    125,585 pointsBadges:
    report
  • RobertHart
    Wilson, We have tried that method. The problem was that -ctime reports the Last Changed Time and our client wants it based on Creation Time. Rob
    225 pointsBadges:
    report
  • RobertHart
    Tom, I totally agree, that is what I am querying. No, it is a second tier directory that we are reading but all the objects we want to check are in the one level. We get the 200,000 figure from the IFS Catalog created using qsrsrv. The report I get from DSPLNK is 5838 pages. The first 461 list the short names (giving 461 x 55pp = 25355obj), the next 460 report Long names and the rest are the display attributes. Having looked again I see that each object takes 2 pages to report where my original calculation was made on 2 a page. So It actually only reports full detail on 2500 (approx) objects.
    225 pointsBadges:
    report
  • TomLiotta
    For any OUTPUT(*PRINT) function, the size of the resulting spooled file should be estimated ahead of time. The size should be compared to the MAXRCDS() attribute of the printer file to understand what can happen when the spooled file is larger than MAXRCDS. (Note that print lines are records, rather than pages.) As for "creation date/time", I'm not sure if that's available anywhere outside of i5/OS-specific APIs, in particular Qp0lGetAttr(). I.e., it's displayed/printed with DSPLNK, but I suspect that the same or a similar API is used. The Qp0lGetAttr() API isn't pretty for those who are unfamiliar with that type of API. In general, if I was doing this, I'd use opendir() to open the directory, I'd read the directory entries with readdir() and use Qp0lGetAttr() to retrieve creation time and then... Well, actually, I might just use RTVDIRINF for the directory and name some work library to build the information files in. You'll possibly find the database format of the resulting QAEZD0001O output file easier to work with than either a spooled file or the funky API sequences. Tom
    125,585 pointsBadges:
    report
  • RobertHart
    Hi Tom, Thanks for that. I changed the Number of records on the QSYSPRT file to *nomax and that stopped it halting but it gave the same result. I will look at the rest. Rob
    225 pointsBadges:
    report
  • RobertHart
    Thanks for your help on this. We have gone back to the QSHELL Find command and within it's constraints our client is happy with the results.
    225 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