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

access the last host command


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

Active User


Joined: 31 Oct 2006
Posts: 139
Location: brisbane

PostPosted: Thu Apr 06, 2023 5:53 am
Reply with quote

Does anyone know if the last issued host command gets captured in a (special) variable?

eg, if i have :
address DSNREXX "EXECSQL DECLARE C1 CURSOR FOR S1"

it would be useful to have access to the last host command, eg, for error reporting.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Fri Apr 07, 2023 5:25 am
Reply with quote

I do not think the host commands are saved anywhere.

Try something like this:
Code:

last_host_command = "EXECSQL DECLARE C1 CURSOR FOR S1"
address DSNREXX last_host_command


Though, I am pretty sure that rexx will normally stop on a DB2 error. And it will tell you on what rexx statement the error occurred.
Back to top
View user's profile Send private message
jzhardy

Active User


Joined: 31 Oct 2006
Posts: 139
Location: brisbane

PostPosted: Tue Apr 11, 2023 4:18 am
Reply with quote

yes, that is what I ended up doing - i couldn't find any other way. It's a bit inelegant as I have a large number of separate cursor statements to deal with, but it does the job.
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 REXX/CMS How to place command console... CLIST & REXX 4
No new posts Help needed in automation cics transa... CLIST & REXX 1
No new posts How to Login in to cics region and is... CICS 9
No new posts Passing containers on START command CICS 4
No new posts Access to macro definitions PL/I & Assembler 4
Search our Forums:

Back to Top