I have a requiremet that I need to run a savlib command if the particular library has more than 100 objects.[Br style="padding: 0px; margin: 0px;" />How this can be done?[Br style="padding: 0px; margin: 0px;" />[Br style="padding: 0px; margin: 0px;" />Help me out with this!
First i have to create a SAVF.
how to create a savf.
and also
i need the code to do the above condition....
Please...
[Br style="padding: 0px; margin: 0px;" />
Software/Hardware used:
AS400
ASKED:
January 9, 2011 7:14 AM
UPDATED:
January 12, 2011 10:37 AM
This should help you.
“How to create a Save file”
and
CL Programming
This appears to be a homework type of question. You need to post the work that you have already done so that any discussion can guide towards a solution. In general, you should always post what you have done.
Your specific question was:
how to create a savf.
Run the Create Save File command. You should know how to find all commands that “Create” objects as well as all commands that process “save files”. Do you need guidance on how to find commands?
Tom
To get to the number of Objects in a library a DSPLIB with output *PRINT will give you a spoolfile that lists the number of objects. You will have to extract that information from the spool in case you need to use that in a Program. Another option to seek out is the info returned by the (QLIRLIBD) API.
You could also use DSPOBJD yourlib/*ALL to an outfile.
Then either count the number of objects in that outfile
or do a DSPFD of that outfile to a 2nd outfile and read that 2nd outfile which could give you the record count.
Hope htis helps,
Bill Poulin
Well Bill, that’s the classic CL programming technique, but if you want a serious performance boost API is the way to go although it may require some more effort from the programmers side.
Peter