Hi Don

I had a crack at this out of interest this morning using the
HISTROY_LOG_INFO SQL service. It might not be quite what you want but
perhaps it provides a starting point or alternative approach.

SELECT
A.FROM_JOB,
A.FROM_JOB_USER,
A.FROM_JOB_NAME,
A.FROM_JOB_NUMBER,
*REGEXP_SUBSTR*(MESSAGE_SECOND_LEVEL_TEXT, (
'(saved on volumes\s+)(.+?)(\s)'), *1*, *1*,'',*2* ) as "Volume",
*DATE*(A.MESSAGE_TIMESTAMP) as START_DATE,
*TIME*(A.MESSAGE_TIMESTAMP) as START_TIME
FROM TABLE(QSYS2.HISTORY_LOG_INFO( START_TIME *=>* (*CURRENT_TIMESTAMP* -
*24* hours ) )) A
WHERE A.FROM_JOB_NAME LIKE 'BACKUPJOB'
AND A.MESSAGE_ID = 'CPC3701'
ORDER BY A.MESSAGE_TIMESTAMP DESC
FETCH FIRST *1* ROW ONLY;

Change the job name to whatever your backup job is called.
The fields are mostly to return something, except for the REGEXP_SUBSTR
which is extracting the volume ID from the SECOND_LEVEL_TEXT.
You might need to tweak the start time and how many hours the query looks
back from current timestamp.
I sorted by timestamp in descending order and fetched the first row only so
as to get the last record (that was my thinking anyway) - there might be a
better way to do this.
I have used similar queries with the db2 command in strqsh to return
specific values into (for example) a specific data area, so I will leave
that part as an exercise for you.



On Tue, Mar 18, 2025 at 5:43 PM Don Brown via MIDRANGE-L <
midrange-l@xxxxxxxxxxxxxxxxxx> wrote:

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.

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
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.