Help to copy Any User's Joblog in PDS members



IBM's Command List programming language & Restructured Extended Executor

Help to copy Any User's Joblog in PDS members

Postby nickelll » Mon Jun 22, 2009 1:37 am

Hi All,
I am trying to copy joblogs for any user onto members of a PDS.But I am facing issues using ReXX with TSO ST command.
I want to do the following:
1. type on command line TSO <rexx code name> <userid>
and copy the members to a PDS. I use:
Arg Id . 
---then alloc dataset with--
If Sysdsn(Dsn) <> 'OK' Then                                   
  Do                                                         
    "Alloc Ds('" || Out || "') Lrecl(134) Recfm(F b a) Cyl,   
     space(250,100) Dir(250) Blksize(0) rel f(input2)"       
     If Rc = 0 Then                                           
        Say 'Output PDS ' Out ' Created successfully..'       
     Else                                                     
        Do                                                   
          Say 'Output file creation failed .. RC: ' Rc       
          Exit                                               
        End                                                   
  End                                                         
  Else                                                       
    "Alloc da('" || Out || "') f(Input2) Shr"           

Now,I have to access other user's spool whose Id I used as Arg.So,

X = Outtrap('List.')
ADDRESS TSO
"STATUS Id"
X = Outtrap('OFF')

Then the prob comes.............STATUS doesn't take the Id value .
But a normal TSO STATUS <any user Id> returns the status of the jobs run under anyuser's Id.But, the same value is not here after STATUS.
Is there a way to pass the argument Id inside the OUTTRAP function?
Please help...
nickelll
 
Posts: 2
Joined: Mon Jun 22, 2009 1:24 am
Has thanked: 0 time
Been thanked: 0 time

Re: Help to copy Any User's Joblog in PDS members

Postby MrSpock » Mon Jun 22, 2009 4:14 am

Isn't Id a variable? If so, then shouldn't the code be written:

"STATUS "Id
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Help to copy Any User's Joblog in PDS members

Postby nickelll » Tue Jun 23, 2009 12:48 am

Yes sir. It should be that.
But then the following happens after the PDS is created successfully....

Output PDS XXXXXX.D090622.T010201.JOBOUT Created successfully..

28 *-* End
31 *-* X = Outtrap('List.')
>L> "List."
>F> "LIST."

32 *-* ADDRESS TSO

33 *-* "STATUS" Id
>L> "STATUS"
>V> "C5LMKM" --------------------->other person's userid
>O> "STATUS C5LMKM"

34 *-* X = Outtrap('OFF')
>L> "OFF"
>F> "OFF"

35 *-* Do I = 1 TO List.0
>L> "1"
>V> "48"

36 *-* Jobname = ''
>L> ""

37 *-* Mem = ''
>L> ""
38 *-* Parse Var List.i Msgid Iat Owner '(' Jobid ')' 'IS' Jobname '00'x
>C> "LIST.1"
>>> "JOB"
>>> "C5LMKM"
>>> ""
>>> "JOB51253"
>>> ""
39 *-* If Msgid = 'IAT8969' & Index(List.i,'TIME') = 0
>V> "JOB"
>L> "IAT8969"
>O> "0"
>C> "LIST.1"
>V> "JOB C5LMKM(JOB51253) ON OUTPUT QUEUE+"
>L> "TIME"
>F> "0"
>L> "0"
>O> "1"
>O> "0"
78 *-* End
35 *-* Do I = 1 TO List.0
36 *-* Jobname = ''
>L> ""
37 *-* Mem = ''
>L> ""
38 *-* Parse Var List.i Msgid Iat Owner '(' Jobid ')' 'IS' Jobname '00'x
>C> "LIST.2"
>>> "IAT8969"
>>> "JOB"
>>> "C5LMKM "
>>> "JOB51253"
>>> " OWNED BY (C5LMKM ) " ------------>this doesn't come when ST is checked for my own id.
39 *-* If Msgid = 'IAT8969' & Index(List.i,'TIME') = 0
>V> "IAT8969"
>L> "IAT8969"
>O> "1"
>C> "LIST.2"
>V> "IAT8969 JOB C5LMKM (JOB51253) IS OWNED BY (C5LMKM )
??"
>L> "TIME"
>F> "0"
>L> "0"
>O> "1"
>O> "1"

*-* Then
40 *-* Do

41 *-* Jobname = Strip(Jobname)
>V> " OWNED BY (C5LMKM ) "
>F> "OWNED BY (C5LMKM )"

*-* Then
46 *-* Mem = Jobname
>V> "OWNED BY (C5LMKM )"

47 *-* Inc = 1
>L> "1"

48 *-* Do Forever

49 *-* If Inc > 99 & ,(Length(Mem) = 7 | Length(Mem) = 8)
>V> "1"
>L> "99"
>O> "0"
>V> "OWNED BY (C5LMKM )"
>F> "22"
>L> "7"
>O> "0"
>V> "OWNED BY (C5LMKM )"
>F> "22"

If I use ST for my Id the jobname taken is proper but when the ST <userid> is used jobname contains OWNED BY (other user's id ).
Is there anyway I get rid of it as it is causing extraneous information being passed to variable jobname below:

X = Outtrap('List.')
ADDRESS TSO
"STATUS" Id
X = Outtrap('OFF')
Do I = 1 TO List.0
Jobname = ''
Mem = ''
Parse Var List.i Msgid Iat Owner '(' Jobid ')' 'IS' Jobname '00'x
If Msgid = 'IAT8969' & Index(List.i,'TIME') = 0 Then
Do
Jobname = Strip(Jobname)
Jobid= Strip(Jobid)
Save = 'Y'
Jobname = Strip(Jobname)
If Mem = '' Then
Mem = Jobname
Inc = 1
Do Forever
If Inc > 99 & ,
(Length(Mem) = 7 | Length(Mem) = 8) Then
Do
Say 'Error: Member Name Suffix exceeds 99, ' Jobname ' Not saved'
Save = 'N'
Leave
End
"Member " Mem
If Rc = 0 Then
Do
If Length(Mem) = 8 Then
Mem = Substr(Mem,1,6) || Inc
Else
Mem = Mem || Inc
Inc = Inc + 1
End
Else
Leave
End
RouteCode = Substr(Jobname,7,2)
If Save <> 'N' Then
Do
If RouteCode <> '' Then
"Out " || Jobname || "(" || Jobid || ") Print('" || Out || ,
"(" || Mem || ")') begin keep hold "
If Rc = 0 Then
Say 'Job ' Jobname '(' || Jobid || ') Copied into member ' Mem
End
End
End
"Free f(Input2)"
nickelll
 
Posts: 2
Joined: Mon Jun 22, 2009 1:24 am
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post