View previous topic :: View next topic
|
Author |
Message |
Naturalist
New User
Joined: 07 Mar 2024 Posts: 2 Location: Russia
|
|
|
|
Hello!
I try place the console output of a CMS command to variable. I need get a response of a TRANSFER command and extract a spoolid.
My sample:
Code: |
/* */
'PIPE CMS TRANSFER userid RDR spoolid TO userid PRT ! VAR RESP.'
SAY SUBWORD(RESP.1,3,1)
EXIT |
Please explain me, how to get the console output to a stack or to variable. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2146 Location: USA
|
|
|
|
Why not to RTFM, or to google?
Code: |
x = OUTTRAP('var.') /* trap output */
"LISTC" /* or any other command */
SAY 'The number of lines trapped is' var.0
x = OUTTRAP('OFF') /* stop trapping */
Do I = 1 To var.0
Say var.I
End I |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
unfortunately the TS is working in a CMS environment running on z/VM |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 736 Location: Denmark
|
|
|
|
I haven't worked with CMS pipes, but I assume that you can write the response to a file, and the EXECIO that file to a stem? |
|
Back to top |
|
|
Naturalist
New User
Joined: 07 Mar 2024 Posts: 2 Location: Russia
|
|
|
|
Thanks to everyone for the answers. I solved my problem a little differently:
Code: |
'PIPE CP Q RDR ! STEM RESP.'
LAST = RESP.0
SAY RESP.LAST |
The strange thing is that there is no obvious way to redirect a standard output. |
|
Back to top |
|
|
|