Thank you Evan,
I will give this a try next week.
Regular expressions is definitely not my strong suit, I need to find a
good learning site.
Really appreciate your assistance!
Cheers
Don
Don Brown
Senior Consultant
[1]OneTeam IT Pty Ltd
P: 1300 088 400
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Evan
Harris
Sent: Friday, 21 March 2025 7:32 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: What was the last volume used on a save
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: [2]
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
> [3]
https://archive.midrange.com/midrange-l.
>
> Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
> related questions.
>
>
--
Regards
Evan Harris
--
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: [4]
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
[5]
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
--
Message protected by MailGuard: e-mail anti-virus, anti-spam and content
filtering.
[6]
https://www.mailguard.com.au
References
Visible links
1.
https://www.oneteamit.com.au/
2.
https://lists.midrange.com/mailman/listinfo/midrange-l
3.
https://archive.midrange.com/midrange-l.
4.
https://lists.midrange.com/mailman/listinfo/midrange-l
5.
https://archive.midrange.com/midrange-l.
6.
https://www.mailguard.com.au/
As an Amazon Associate we earn from qualifying purchases.