Posted by Frank Schubert on June 04, 2008 at 12:22:44:
In Reply to: SYSLOG CAPTURE posted by Bob Chapman on June 03, 2008 at 14:52:38:
: I'm trying to snap the syslog to a dataset after an IPL. I found an example of a REXX that was written years ago, to write it to a PDS but it looks like it was written for an enviroment that only had 1 system per jes node. Here is what I have so far:
: /*REXX */
: TRACE I /*
:
: 'PROFILE MSGID'
: PARSE SOURCE . . CMD . . . . . ENV .
: IF ENV <> 'IOF' THEN DO
: PUSH 'IOF * OPTMENU.%'CMD
: EXIT
: END
: ADDRESS IOF
: 'IOF SYSLOG RUNNING'
: '1 BROWSE'
: 'UP MAX'
: "SD DA('dataset.xyz')"
: SDRC = RC
: "SNAP 9999999 LINES"
: "SNAPCLOS"
: "JUMP X"
: EXIT 0
: Unfornately, the 1 BROWSE is not exactly what I need. In my enviroment, I have 2 to 4 systems up, therefore, I have 2 to 4 different SYSLOGS running. I am interesting in obtaining the log for the system that my job is running on.
: In IOF, I have this:
: -------JOBNAME--JOBID---ACT-STAT-SYID-------CPU-------I/O-STEP-----PROCSTEP-SWP
: _ 1 SYSLOG S061992 3811
: _ 2 SYSLOG S076747 1841 43:57 1101.49 IN
: _ 3 SYSLOG S084764 1831
:
: Do you have any thoughts on how I can go about figuring out which SYSLOG is the one that I am after, prior to the SNAP? The one in this case would be the #2 or the one SWAPPED IN.
: Thanks,
: Bob
Hi Bob,
Yes, this is not too difficult. What you need to do is exclude all jobs from the JOB List menu that do not have the same sysid as the batch job running the Rexx exec. I also added some parms to the invocation of IOF. So, the line:
'IOF SYSLOG RUNNING'
is changed to:
'TSICOPY NAME(XEQSYSID) TO(REXX) FROM(LIST)'
'IOF SYSLOG RUNNING SELECT(SYSLOG) JOBLIST SCOPE(ALL) DEST'
'EXCL SYSID NE' xeqsysid
After falling through the "ADDRESS IOF" statement, the Rexx exec is positioned on the "IOF Options Menu". At this point, we can query IOF for the JES2 sysid that we are running on. Hence the TSICOPY statment grabs the execution sysid. Then we issue the IOF command to find all of the SYSLOG jobs. I have added the SELECT clause to be sure we find the real SYSLOG job and not a batch job that is named SYSLOG. The other parameters, SCOPE and DEST, are there to override any setting from a profile dataset that might exist. And the JOBLIST parameter is present to ensure that IOF does not automatically select a job. These parameters are, in general, redundant, but they do ensure reliability.
After issuing the IOF command, the next thing is to exclude any jobs on the "IOF Job List Menu" that do not have a SYSID that matches the execution SYSID. That should leave you with just the one job, which should always be SYSLOG for the system this is running on.
Here is your sample, with my suggested modifications.
/*REXX */
/*TRACE R*/'PROFILE MSGID'
PARSE SOURCE . . CMD . . . . . ENV .
IF ENV <> 'IOF' THEN DO
PUSH 'IOF * OPTMENU.%'CMD
EXIT
END
ADDRESS IOF
'TSICOPY NAME(XEQSYSID) TO(REXX) FROM(LIST)'
'IOF SYSLOG RUNNING SELECT(SYSLOG) JOBLIST SCOPE(ALL) DEST'
'EXCL SYSID NE' xeqsysid
'1 BROWSE'
'UP MAX'
"SD DA('dataset.xyz')"
SDRC = RC
"SNAP 9999999 LINES"
"SNAPCLOS"
"JUMP X"
EXIT 0