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

Printing spool details of a job to a dataset


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sathish Gurumoorthy

New User


Joined: 12 Feb 2009
Posts: 33
Location: Chennai, India

PostPosted: Mon Jun 01, 2009 5:34 pm
Reply with quote

Hi,
I use the below rexx code to print the spool output of a particular job to a dataset.

Code:
000001 /* REXX */                                                             
000002 ADDRESS TSO                                                             
000003 JOBNAME = 'TMS047BB'                                                       
000004 JOBID   = '7558'                                                         
000005 DSNAME = USERID()||"SP.OUTPUT"                                         
000007  "OUTPUT "JOBNAME"("JOBID") PRINT("DSNAME") BEGIN HOLD KEEP"


i get the error as " INVALID JOBNAME"

Code:
 INVALID JOBNAME, TMS047BB(7558)                           
 ***                                                       


The job is available in spool. Can anyone tell me why it is not printing the job spool to the dataset?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Jun 01, 2009 5:49 pm
Reply with quote

The format is:

JOBNAME(JOBnnnnn),

so try:

Code:

/* REXX */                                                             
JOBNAME = 'TMS047BB'                                                       
JOBID   = '07558'     
DSNAME = USERID()||".SP.OUTPUT"                                         
"OUTPUT "JOBNAME"(JOB"JOBID") PRINT('"DSNAME"') BEGIN HOLD KEEP"
Back to top
View user's profile Send private message
Sathish Gurumoorthy

New User


Joined: 12 Feb 2009
Posts: 33
Location: Chennai, India

PostPosted: Mon Jun 01, 2009 5:56 pm
Reply with quote

I tried with the above format and it says "Command is not a macro". The dataset isn't get printed with data.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Jun 01, 2009 6:01 pm
Reply with quote

OK. Well, the code I posted was tested and does work correctly.

How about you post a run-time TRACE of your code, and maybe the results of a TSO STATUS command for the same job you want the OUTPUT for, just so we're all sure that the job really does exist on the held output spool.
Back to top
View user's profile Send private message
Sathish Gurumoorthy

New User


Joined: 12 Feb 2009
Posts: 33
Location: Chennai, India

PostPosted: Mon Jun 01, 2009 6:09 pm
Reply with quote

i tried the below code with TSO STATUS.
Code:
000001 /* REXX */                                                         
000002    TRACE R                                                         
000003 ADDRESS TSO                                                       
000004 JOBNAME = 'TMS047BB'                                               
000005 JOBID   = '7558'                                                   
000006 DSNAME = USERID()||"SP.OUTPUT"                                     
000007 "STATUS" JOBNAME"(JOB"JOBID")"                                     
000008 "OUTPUT "JOBNAME"(JOB"JOBID") PRINT("DSNAME") BEGIN HOLD KEEP"     


the trace results are
Code:
      3 *-* ADDRESS TSO                                                         
      4 *-* JOBNAME = 'TMS047BB'                                               
        >>>   "TMS047BB"                                                       
      5 *-* JOBID   = '7558'                                                   
        >>>   "7558"                                                           
      6 *-* DSNAME = USERID()||"SP.OUTPUT"                                     
        >>>   "TMS047SP.OUTPUT"                                                 
      7 *-* "STATUS" JOBNAME"(JOB"JOBID")"                                     
        >>>   "STATUS TMS047BB(JOB7558)"                                       
 JOB TMS047BB(JOB07558) ON OUTPUT QUEUE                                         
      8 *-* "OUTPUT "JOBNAME"(JOB"JOBID") PRINT("DSNAME") BEGIN HOLD KEEP"     
        >>>   "OUTPUT TMS047BB(JOB7558) PRINT(TMS047SP.OUTPUT) BEGIN HOLD KEEP"
  ***                                                                           
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Jun 01, 2009 6:13 pm
Reply with quote

So it worked?? I don't see any errors.
Back to top
View user's profile Send private message
Sathish Gurumoorthy

New User


Joined: 12 Feb 2009
Posts: 33
Location: Chennai, India

PostPosted: Mon Jun 01, 2009 6:17 pm
Reply with quote

It still says 'Command is not a macro". Output dataset is not getting printed with data.
is there anything like we can't access SDSF via REXX like normal Rexx routines?
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Jun 02, 2009 11:44 am
Reply with quote

Quote:
It still says 'Command is not a macro".


I sounds like you are issuing your command from the editor command line. And the message is correct... it is not an editor macro. I think you just need to add "Address ISREDIT 'MACRO' " to make it an editor macro.

Quote:
is there anything like we can't access SDSF via REXX like normal Rexx routines?

Please rephrase your question... it is not clear what you are asking.
Back to top
View user's profile Send private message
Sathish Gurumoorthy

New User


Joined: 12 Feb 2009
Posts: 33
Location: Chennai, India

PostPosted: Tue Jun 02, 2009 12:05 pm
Reply with quote

My question here is, can we access SDSF using Rexx in view/edit command lines? are we able to run edit macros to access SDSF only in SDSF panel?
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Jun 02, 2009 8:31 pm
Reply with quote

You should be able to use the rexx api of SDSF to get job output, and do it outside of SDSF panels. See IBM manual SG24-7419-00
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top