Le 18/03/2025 à 10:08, Marc Rauzier a écrit :
Le 18/03/2025 à 05:42, Don Brown via MIDRANGE-L a écrit :
System is V7R5

We are NOT using BRMS

Running a save with multiple volumes.

How can I determine what was the last volume used by the save.

Currently joblogs are on the output queue - NOT in *Pending status.

I could copy the joblog to a file and parse the file looking for the last volume name message but I was hoping there may be a better option.

Any suggestions or comments appreciated.

Try this.

Oups, sorry, it will work if the job is active or in pending status, but not if the joblog is produced in a spool file. But you can implement this method for next time.

In your specific case, for a one shot, look at the end of the spool file and scroll up to find the last CPCxxxx completion message.
You can also use HISTORY_LOG_INFO table function (https://www.ibm.com/docs/en/i/7.5?topic=services-history-log-info-table-function) with the same CPCxxxx message id selection.

You should be able to use JOBLOG_INFO table function (https://www.ibm.com/docs/en/i/7.5?topic=services-joblog-info-table-function).

First, look at the last CPCxxxx completion message stating that objects, libraries or IFS files are saved (the message id depends on your backup sequence). Then look at the detail of the CPCxxxx message (DSPMSGD) to find out the position of the variable which contains the volume name.

Finally run an SQL statement as below (CPC3721 is sent at the end of SAVLIB *ALLUSR) to retrieve the volume id

|SELECT SUBSTR(MESSAGE_TOKEN, 103, 32) FROM TABLE(QSYS2.JOBLOG_INFO('qualified_job_name')) AS A WHERE A.MESSAGE_ID = 'CPC3721' ORDER BY ORDINAL_POSITION DESC FETCH FIRST 1 ROW ONLY;|

If you include this statement in the same job as the backup job, qualified_job_name can be *.

Warning : not tested as I can't

Thanks
Don


Brisbane - Sydney - Melbourne

Don Brown

Senior Consultant



P: 1300 088 400




DISCLAIMER. Before opening any attachments, check them for viruses and defects. This email and its attachments may contain confidential information. If you are not the intended recipient, please do not read, distribute or copy this email or its attachments but notify sender and delete it. Any views expressed in this email are those of the individual sender

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.