View previous topic :: View next topic
|
Author |
Message |
upendrasri
Active User
Joined: 28 Sep 2017 Posts: 124 Location: India
|
|
|
|
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 |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2153 Location: USA
|
|
|
|
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 |
|
|
upendrasri
Active User
Joined: 28 Sep 2017 Posts: 124 Location: India
|
|
|
|
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 |
|
|
upendrasri
Active User
Joined: 28 Sep 2017 Posts: 124 Location: India
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2598 Location: Silicon Valley
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2598 Location: Silicon Valley
|
|
|
|
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 |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 767 Location: Whitby, ON, Canada
|
|
|
|
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 |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 740 Location: Denmark
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2598 Location: Silicon Valley
|
|
|
|
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 |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1347 Location: Bamberg, Germany
|
|
|
|
You can only retrieve the SDSF/Console output for the command. There is no other possibility (yet). |
|
Back to top |
|
|
|