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

Rexx to capture output from TSO HSEND Q CDS


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

Active User


Joined: 28 Sep 2017
Posts: 124
Location: India

PostPosted: Mon Apr 03, 2023 9:47 pm
Reply with quote

Hi,

We have a requirement to capture output from the below command using rexx
TSO HSEND Q CDS

I have tried below rexx but it's not working.

Code:

/* REXX */                 
x = OUTTRAP('var.')       
ADDRESS TSO "HSEND Q CDS" 
x = OUTTRAP('off')         
DO i = 1 TO var.0         
  SAY var.i               
END                       


Any assistance or suggestions?

Thanks.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2081
Location: USA

PostPosted: Mon Apr 03, 2023 10:14 pm
Reply with quote

You cannot get any answer without clear explanation (with the exact copy of received results/messages): what exactly "is not working, and how"?
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 124
Location: India

PostPosted: Mon Apr 03, 2023 10:17 pm
Reply with quote

Hi,

OUTTRAP is not capturing command results and command output is displaying in Mainframe terminal while executing the command in rexx .

Thanks..
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 124
Location: India

PostPosted: Mon Apr 03, 2023 10:37 pm
Reply with quote

Hi,
To give more clarity on my query..

I am executing the below rexx

Code:

/* REXX                                                                 
TRACE 'I' */                                                           
x = OUTTRAP('var.')                                                     
ADDRESS TSO "HSEND Q CDS"                                               
x = OUTTRAP('off')                                                     
SAY 'The number of lines trapped is' var.0     
DO i = 1 TO var.0                                                       
  SAY var.i                                   
END   


After executing above rexx am getting below output in Mainframe teriminal

Code:

ARC0101I QUERY CONTROLDATASETS COMMAND STARTING ON HOST=1                     
ARC0947I CDS SERIALIZATION TECHNIQUE IS RESERVE                               
ARC0148I MCDS TOTAL SPACE=1044000 K-BYTES, CURRENTLY ABOUT 22% FULL, WARNING   
ARC0148I (CONT.) THRESHOLD=90%, TOTAL FREESPACE=93%, EA=NO, CANDIDATE VOLUMES=0
ARC0948I MCDS INDEX TOTAL SPACE=0006300 K-BYTES, CURRENTLY ABOUT 010% FULL,   
ARC0948I (CONT.) WARNING THRESHOLD=090%, CANDIDATE VOLUMES=0                   
ARC0148I BCDS TOTAL SPACE=1005120 K-BYTES, CURRENTLY ABOUT 86% FULL, WARNING   
ARC0148I (CONT.) THRESHOLD=90%, TOTAL FREESPACE=48%, EA=NO, CANDIDATE VOLUMES=0
ARC0948I BCDS INDEX TOTAL SPACE=0002814 K-BYTES, CURRENTLY ABOUT 086% FULL,   
ARC0948I (CONT.) WARNING THRESHOLD=090%, CANDIDATE VOLUMES=0                   
ARC0148I OCDS TOTAL SPACE=574560 K-BYTES, CURRENTLY ABOUT 86% FULL, WARNING   
ARC0148I (CONT.) THRESHOLD=90%, TOTAL FREESPACE=63%, EA=NO, CANDIDATE VOLUMES=0
ARC0948I OCDS INDEX TOTAL SPACE=0001638 K-BYTES, CURRENTLY ABOUT 086% FULL,   
ARC0948I (CONT.) WARNING THRESHOLD=090%, CANDIDATE VOLUMES=0                   
ARC0148I JOURNAL TOTAL SPACE=688898 K-BYTES, CURRENTLY ABOUT 001% FULL,       
ARC0148I (CONT.) WARNING THRESHOLD=080%, TOTAL FREESPACE=099%, EA=NO, CANDIDATE
ARC0148I (CONT.) VOLUMES=0                                                     
ARC0101I QUERY CONTROLDATASETS COMMAND COMPLETED ON HOST=1                     
The number of lines trapped is 0                                               
***                               


The number of lines trapped is 0, So how can I capture about output in rexx. So that I can write the output to a dataset..

Thanks..
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Apr 03, 2023 11:37 pm
Reply with quote

HSM commands are in a class called 'Foreground Initiated Batch commands'. I do not think it is possible to trap the output.

You should be able to get some results using the TSO CONSOLE command (you might need to get some permissions).

The Rexx Reference manual, SA22-7790, has a chapter for "Writing REXX Execs to perform MVS operator activities" which describes how to use CONSOLE from rexx.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Apr 03, 2023 11:41 pm
Reply with quote

Another avenue to explore is continue using HSEND command, but to use the SDSF rexx interface to get the SYSLOG information. Sorry, I do not have any examples.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Tue Apr 04, 2023 3:16 am
Reply with quote

Pedro wrote:
Another avenue to explore is continue using HSEND command, but to use the SDSF rexx interface to get the SYSLOG information. Sorry, I do not have any examples.
I don’t have an example either, but SDSF has an excellent command called RGEN that will create a Rexx program for you to get started with.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 720
Location: Denmark

PostPosted: Tue Apr 04, 2023 5:06 am
Reply with quote

As I recall then HSM commands cannot be trapped. You can send the ouput to a dataset and then read that. This is from the top of my head, it has been a while since I dealt with HSM.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Apr 04, 2023 10:34 am
Reply with quote

re: "You can send the output to a dataset and then read that"

The HLIST command has an OUTDATASET parameter, so its command response can be routed to a data set. But the poster wants to use the QUERY CDS command and I do not think it supports that parameter.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1295
Location: Bamberg, Germany

PostPosted: Tue Apr 04, 2023 11:36 am
Reply with quote

You can only retrieve the SDSF/Console output for the command. There is no other possibility (yet).
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 Compare 2 alphabets in a REXX and fin... CLIST & REXX 2
No new posts Call an hlasm from REXX in batch and ... CLIST & REXX 4
No new posts How to turn off 'ACTION' SDSF output ... TSO/ISPF 2
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
Search our Forums:

Back to Top