View previous topic :: View next topic
|
Author |
Message |
jecsanb
New User
Joined: 24 Jun 2021 Posts: 2 Location: USA
|
|
|
|
Hello,
I'm trying to run a console commands like $DSPL through USS.
I thought that this should be possible either through built in USS shell through "tsocmd" or via REXX in USS. The following runs but I get no output? Any advice. ( I'm very new to the mainframe :] )
Code: |
/* REXX */
CALL outtrap out.
ADDRESS TSO
"CONSOLE ACTIVATE,NAME("NEWCON")"
"$DSPL"
do i=1 to out.0
say out.i
end |
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
The CONSOLE command does not use the mechanisms that outtrap relies on. There is no command response available to trap.
Use the GETMSG function to retrieve the command response. See www.ibm.com/docs/en/zos/2.1.0?topic=tef-getmsg#getmsg Search this forum for GETMSG examples. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
Also, you must terminate the trapping by zz=OUTTRAP('OFF') before you can show the stem. |
|
Back to top |
|
|
jecsanb
New User
Joined: 24 Jun 2021 Posts: 2 Location: USA
|
|
|
|
So I tried something like this
Code: |
/* REXX */
ADDRESS TSO
"CONSOLE ACTIVATE,NAME("NEWCON")"
"$DSPL"
msg = GETMSG('out.','SOL')
do i=1 to out.0
say out.i
end
|
And got this, so I'm not sure what is the proper way to call it. I also tried using the CART but I get the same result.
Code: |
IRX0250E System abend code 0C4, reason code 00000017.
IRX0253E Abend in external function GETMSG.
5 +++ msg = GETMSG('out.','SOL')
IRX0040I Error running ./test1.rexx, line 5: Incorrect call to routine |
Pedro wrote: |
The CONSOLE command does not use the mechanisms that outtrap relies on. There is no command response available to trap.
Use the GETMSG function to retrieve the command response. See www.ibm.com/docs/en/zos/2.1.0?topic=tef-getmsg#getmsg Search this forum for GETMSG examples. |
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Quote: |
Try running the same from TSO instead of USS. |
That is, try running it to make sure it works, to eliminate the possibility of some programming error instead of an environment problem. |
|
Back to top |
|
|
|