IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Reroute print output via REXX/SDSF


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kokido

New User


Joined: 20 Jun 2024
Posts: 8
Location: Netherlands

PostPosted: Thu Sep 05, 2024 3:38 pm
Reply with quote

Hello,
Currently working on rerouting printoutput with REXX/SDSF.
In my REXX I can nicely get the token that is associated with the spooldataset that is associated with a destination.
It seems that ISFACT does not let me reroute via PARM(dest newdest).
Code:

Address SDSF "ISFACT H TOKEN('"TOKEN.rowix"') PARM(DEST newdest)"



Another way to do it would be via ISFEXEC or ISFSLASH, but then how do I pull out the specific spooldataset?

Code:

Address SDSF ISFSLASH "$TO"Jxxxxx",OUTGRP=?.?.?,DEST="newdest

Help would be appreciated.
Kind regards,
Hans Kok
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2583
Location: Silicon Valley

PostPosted: Fri Sep 06, 2024 4:05 am
Reply with quote

re: It seems that ISFACT does not let me reroute via PARM(dest newdest)

Perhaps provide here whatever message or return code that you got??
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2583
Location: Silicon Valley

PostPosted: Fri Sep 06, 2024 4:20 am
Reply with quote

Can you explain how you got the token? My recollection is that you have to go to H panel to see a list of jobs, then issue a ? line command to show the individual output files for a particular job.

Don't you also need these two steps in your rexx program?
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 724
Location: Denmark

PostPosted: Fri Sep 06, 2024 12:45 pm
Reply with quote

The combination
Address SDSF "ISFACT ST TOKEN('"TOKEN.jn"') PARM(NP SA)"
Address SDSF "ISFACT ST TOKEN('"TOKEN.jn"') PARM(NP ?) (prefix j_"
should give you everything that SDSF knows about the output.
Then assuming that the output has a something to distinguish itself, like a different output class, you can use the variable J_OGNAME.ix to build the $T command. Check the SDSF display for a job, it must have the O-Grp-N value something other than 1.
Back to top
View user's profile Send private message
kokido

New User


Joined: 20 Jun 2024
Posts: 8
Location: Netherlands

PostPosted: Fri Sep 06, 2024 2:10 pm
Reply with quote

The rexx I use is generated with RGEN, with some filtering, and it gives me the output I want including the tokens, and jobid.
I chose the long way round and grab the OUTGRP from ULOG after a $DOJ….(LONG) command.
I find the REXX/RGEN combination nice, but the documentation is limited, it would be nice to have some more examples.
The code to pull out the OUTGRP I “borrowed” from the internet.
Thanks anyway
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 724
Location: Denmark

PostPosted: Fri Sep 06, 2024 7:02 pm
Reply with quote

Here is an example which, for a given job, will route any output in output class 'C' to destination TEST.
Code:
jobmask='TESTPRT '                                                     
rc = ISFCALLS('ON')                                                   
Address SDSF "ISFEXEC ST" jobmask                                     
do jn=1 to jname.0                                                     
  Address SDSF "ISFACT ST TOKEN('"TOKEN.jn"') PARM(NP ?)"             
  do dn=1 to ddname.0                                                 
    if oclass.dn<>'C' then iterate                                     
    say 'Job' jname.jn jobid.jn 'output dsid' dsid.dn ,               
        'outclass' oclass.dn 'outgrp' ogname.dn 'will be rerouted'     
    Address SDSF,                                                     
     "ISFSLASH '$TO"jobid.jn",OUTGRP="ogname.dn".1.1,DEST=TEST' (WAIT)"
  end                                                                 
end   

By the way, you were missing single quotes in your ISFSLASH command.
And I must emphasize that you need some distinguishing factor to identify the output, like output class.
SDSF will generate a lot of variables, but I think that they are all documented in the SDSF Users Guide. I often find it easier just to list them, using the REXXVARS program found at either 'https://harders-jensen.com' or at 'https://cbttape.org' in file 669. Sample: call rexxvars 'list var(job* *.5)'.
Back to top
View user's profile Send private message
kokido

New User


Joined: 20 Jun 2024
Posts: 8
Location: Netherlands

PostPosted: Mon Sep 09, 2024 1:08 pm
Reply with quote

Thanks Willy for your reply, works quick and I see more possibilities now.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Concatenate 2 input datasets and give... JCL & VSAM 2
No new posts How can I add/create a new INIT(initi... TSO/ISPF 2
No new posts Get RECORD LENGTH, allocated space of... CLIST & REXX 7
No new posts SDSF and Rexx TSO/ISPF 4
No new posts Compare 2 alphabets in a REXX and fin... CLIST & REXX 2
Search our Forums:

Back to Top