Re: Capturing response from SCS
Note that you can also add a message tag to the RSCS command, so that you can match the command with the asynchronous replies by prefixing the command with (ML.tag). SM RSCS (ML.mytag) QUERY SYSTEM QUEUE SM RSCS (ML.tag2) QUERY SYSTEM See also HELP RSCS CRI Ronald van der Laan
Re: Capturing response from SCS
Hi, Richard. Go to the IBM VM download site at http://www.vm.ibm.com/download/packages/ and get the NETLIST package. It will show you how to capture the responses back from RSCS and may even do what you want right out of the box. Have a good one, too. DJ On 07/20/2011 10:28 AM, Richard Baek wrote: I'm writing a REXX exec in which I'm issuing a command 'SM RSCS Q LINKS' and I'd like to capture the response back from RSCS. Does anyone know how to do this? Maybe you have an example of the code I need to use? -- Dave Jones V/Soft Software www.vsoft-software.com Houston, TX 281.578.7544
Re: Capturing response from SCS
This will do it: /* REXX */ address COMMAND CP SET MSG IUCV PIPE (ENDCHAR ?) STARMSG *MSG CP SMSG RSCS QUERY LINKS , | specs 17-* 1, /* Drop the first 16 chars */ | STEM REC., | LITERAL +5 | DELAY, | PIPESTOP say HowMany rec.0 Do i = 1 to rec.0 say rec.i End exit /Fran Hensler at Slippery Rock University of Pennsylvania USA for 48 years mailto:f...@zvm.sru.edu http://zvm.sru.edu/~fjh +1.724.794.6172 Yes, Virginia, there is a Slippery Rock -- On Wed, 20 Jul 2011 10:28:49 -0500 =?iso-8859-1?Q?Richard_Baek?= said: I'm writing a REXX exec in which I'm issuing a command 'SM RSCS Q LINKS' and I'd like to capture the response back from RSCS. Does anyone know how to do this? Maybe you have an example of the code I need to use?
Re: Capturing response from SCS
/* * * ROUTINE: RSCS REXX (pipeline driver for RSCS 3.1) * * PURPOSE: Pipeline driver to issue RSCS 3.1 command and trap *output. No inputs; output sent to primary output. * * PACKAGE: USERTOOL * * CALLS:CP SET SMSG * * DEPENDENCIES: Calling programs may need to be aware that this *driver can CP SET SMSG IUCV at beginning and *CP SET SMSG OFF at the end. * * AUTHOR: Robert Fowles RBF@PSUVM 2/25/92 * * REVISIONS: */ arg RSCScmd '(' opts call Scanopts if setsmsg then address command 'CP SET SMSG IUCV' sig = right(time('L'),6) /* Unique CRI signature for this call */ 'maxstrm output' if rc = 0 then sec = '' else sec = '\ Rscs: | *.output.1:' /* Write to secondary */ 'CALLPIPE (end \)', '|STARMSG *MSG CP SM RSCSX (SL.'sig')' RSCScmd, '|Rscs: find 0004RSCS', /* only SMSGS from RSCS */ '|spec 22-*', /* Strip STARMSG header and part of othr*/ '|locate 20.6 /'sig'/',/* Just ones with CRI signature */ '|tolabel 0001'||, /* Until End of Response msg num */ '|spec 31-*', /* Keep just message text */ '|buffer', /* Prevent halt before last line */ '|f: fanout', /* Save output for below */ '|take 1', /* Discard output */ '|c: faninany',/* Come here to stop pipeline */ '|spec /pipmod stop/', /* Set up to stop */ '|subcom cms', /* Stop STARMSG and DELAY */ '\literal +00:10', /* Set timer to stop pipeline */ '|delay', '|c:', /* Go stop pipeline */ '\immcmd stop', /* Set immediate command stop */ '|c:', /* Go stop pipeline */ '\ f:', /* Send to primary output */ '|*:', sec if setsmsg then address command 'CP SET SMSG OFF' exit rc ScanOpts: setsmsg = 1 rscs = 'RSCSX' do while opts '' parse var opts opt opts select when opt = 'NOSET' then setsmsg = 0 when opt = 'RSCS' then do parse var opts rscs opts if rscs = '' then rscs = 'RSCSX' end otherwise call Errstop 'Incorrect argument' end end parse value diagrc(8,'QUERY USER' rscs) with cprc cpcc m if cprc 0 then exit cprc return Errstop: say arg(1) exit 100
Re: Capturing response from SCS
Okay, as long as we're posting code... My version is a bit more generic, but also takes into account that it might be issued from a SECUSER-ed disconnected id. /* ** SMSG's an arbitrary target SVM, captures responses and inserts ** into the pipeline. */ Parse Upper arg tgtmach what '(' opts ')' ignored Call InitRtn 'CallPipe (Name GetSMsgResp End ?)', 'Literal' timeout_value, '|Delay', '|stopper:Faninany', '|xx:Gate', '?', 'Starmsg *MSG CP SMSG' tgtmach what ||, '|xx:', '|ours:Find 0001' || Left(tgtmach,8,'_') ||, '|dec:Fanout', '|Take 1', '|Spec /' || msg_wait || '/ 1', '|Elastic', '|Delay', '|stopper:', '?dec:', '|Spec 17-* n', '|*:', '?ours:', '|obnd:Pick 17.10 == /HCPMSG045E/', '|Elastic', '|stopper:', '?obnd:', '|Spec /From/ 1 9.8 strip nw /:/ n 17-* nw', '|Cons' Call CleanUp Exit xRc InitRtn: timeout_value = '+20';msg_wait='+1' what = Strip(what) Parse value Diag(8,'Q SET') with . 'MSG' wasmsg . 'CPCONIO' wascpcio . wasmsg = Strip(wasmsg,'T',',') wascpcio = Strip(wascpcio,'T',',') iRc = 0 popts='' Do while opts '' Parse var opts opt opts Select When Abbrev('TIMEOUT',opt,1) |, Abbrev('DELAY',opt,3) then Do Parse var opts timeout_value opts If Pos('.',timeout_value)=1 then timeout_value='0'timeout_value timeout_value = '+' || timeout_value End When Abbrev('WAITCONT',opt,1) |, Abbrev('WAITON',opt,1) then Do Parse var opts msg_wait opts If pos('.',msg_wait)=1 then msg_wait='0'msg_wait msg_wait = '+' || msg_wait End Otherwise popts = Strip(popts opt) End /* select */ End If popts'' then what = what'('popts')' If iRc 0 then Exit iRc /*---*---*---*---*---*---*/ /* Ensure secuser isn't directing msgs elsewhere */ /*---*---*---*---*---*---*/ dscd = Word(Diag(8,'Q CONS'),3) == 'DISCONNECTED' If dscd then Do Parse value DiagRc(8,'Q PRIV') with . '15'x . ':' myprivs . '15'x If Verify(myprivs,'AC','M')0 then do_me = '*' Else do_me = '' Parse value DiagRc(8,'Q SECUSER *'), with . '15'x . '15'x suinfo '15'x Parse var suinfo . whoisit . If whoisit'not' then Parse value DiagRc(8,'SET SECUSER' do_me 'OFF') with . Else whoisit = '' End 'Commit 0' /* hot to trot */ x=Diag(8,'SET MSG IUCV' || '15'x || 'SET CPCONIO IUCV') Return CleanUp: xRc = Rc x = Diag(8,'SET MSG' wasmsg || '15'x || 'SET CPCONIO' wascpcio) If dscd then if whoisit'' then Parse value Diag(8,'SET SECUSER' do_me whoisit) with . Return -- Mike Harding z/VM System Support mhard...@us.ibm.com mike.b.hard...@kp.org mikehard...@mindless.com (925) 926-3179 (w) (925) 323-2070 (c) IM: VMBearDad (AIM), mbhcpcvt (Y!) The IBM z/VM Operating System IBMVM@LISTSERV.UARK.EDU wrote on 07/20/2011 10:09:48 AM: From: A. Harry Williams ha...@vm.marist.edu To: IBMVM@LISTSERV.UARK.EDU Date: 07/20/2011 10:11 AM Subject: Re: Capturing response from SCS Sent by: The IBM z/VM Operating System IBMVM@LISTSERV.UARK.EDU /* * * ROUTINE: RSCS REXX (pipeline driver for RSCS 3.1) -- etc --
Re: Capturing response from SCS
What is line 78 supposed to do? 'Commit 0' /* hot to trot */ /Fran Hensler at Slippery Rock University of Pennsylvania USA for 48 years mailto:f...@zvm.sru.edu http://zvm.sru.edu/~fjh +1.724.794.6172 Yes, Virginia, there is a Slippery Rock -- On Wed, 20 Jul 2011 10:27:15 -0700 Michael Harding said: Okay, as long as we're posting code... My version is a bit more generic, but also takes into account that it might be issued from a SECUSER-ed disconnected id. /* ** SMSG's an arbitrary target SVM, captures responses and inserts ** into the pipeline. */ Parse Upper arg tgtmach what '(' opts ')' ignored Call InitRtn 'CallPipe (Name GetSMsgResp End ?)', 'Literal' timeout_value, '|Delay', '|stopper:Faninany', '|xx:Gate', '?', 'Starmsg *MSG CP SMSG' tgtmach what ||, '|xx:', '|ours:Find 0001' || Left(tgtmach,8,'_') ||, '|dec:Fanout', '|Take 1', '|Spec /' || msg_wait || '/ 1', '|Elastic', '|Delay', '|stopper:', '?dec:', '|Spec 17-* n', '|*:', '?ours:', '|obnd:Pick 17.10 == /HCPMSG045E/', '|Elastic', '|stopper:', '?obnd:', '|Spec /From/ 1 9.8 strip nw /:/ n 17-* nw', '|Cons' Call CleanUp Exit xRc InitRtn: timeout_value = '+20';msg_wait='+1' what = Strip(what) Parse value Diag(8,'Q SET') with . 'MSG' wasmsg . 'CPCONIO' wascpcio . wasmsg = Strip(wasmsg,'T',',') wascpcio = Strip(wascpcio,'T',',') iRc = 0 popts='' Do while opts '' Parse var opts opt opts Select When Abbrev('TIMEOUT',opt,1) |, Abbrev('DELAY',opt,3) then Do Parse var opts timeout_value opts If Pos('.',timeout_value)=1 then timeout_value='0'timeout_value timeout_value = '+' || timeout_value End When Abbrev('WAITCONT',opt,1) |, Abbrev('WAITON',opt,1) then Do Parse var opts msg_wait opts If pos('.',msg_wait)=1 then msg_wait='0'msg_wait msg_wait = '+' || msg_wait End Otherwise popts = Strip(popts opt) End /* select */ End If popts'' then what = what'('popts')' If iRc 0 then Exit iRc /*---*---*---*---*---*---*/ /* Ensure secuser isn't directing msgs elsewhere */ /*---*---*---*---*---*---*/ dscd = Word(Diag(8,'Q CONS'),3) == 'DISCONNECTED' If dscd then Do Parse value DiagRc(8,'Q PRIV') with . '15'x . ':' myprivs . '15'x If Verify(myprivs,'AC','M')0 then do_me = '*' Else do_me = '' Parse value DiagRc(8,'Q SECUSER *'), with . '15'x . '15'x suinfo '15'x Parse var suinfo . whoisit . If whoisit'not' then Parse value DiagRc(8,'SET SECUSER' do_me 'OFF') with . Else whoisit = '' End 'Commit 0' /* hot to trot */ x=Diag(8,'SET MSG IUCV' || '15'x || 'SET CPCONIO IUCV') Return CleanUp: xRc = Rc x = Diag(8,'SET MSG' wasmsg || '15'x || 'SET CPCONIO' wascpcio) If dscd then if whoisit'' then Parse value Diag(8,'SET SECUSER' do_me whoisit) with . Return
Re: Capturing response from SCS
It's a plumbing thing .. HELP PIPE COMMIT .. commit 0 requests that the commit level of the TCOMMT stage be raised to 0. The TCOMMT stage is then suspended until all the other stages in the pipeline have committed at least to level 0 or have ended. The return code from COMMIT is then set to the current aggregate code. That explains it - right? ;-) Scott Rohling On Wed, Jul 20, 2011 at 2:34 PM, Fran Hensler f...@zvm.sru.edu wrote: What is line 78 supposed to do? 'Commit 0' /* hot to trot */ /Fran Hensler at Slippery Rock University of Pennsylvania USA for 48 years mailto:f...@zvm.sru.edu http://zvm.sru.edu/~fjh +1.724.794.6172 Yes, Virginia, there is a Slippery Rock -- On Wed, 20 Jul 2011 10:27:15 -0700 Michael Harding said: Okay, as long as we're posting code... My version is a bit more generic, but also takes into account that it might be issued from a SECUSER-ed disconnected id. /* ** SMSG's an arbitrary target SVM, captures responses and inserts ** into the pipeline. */ Parse Upper arg tgtmach what '(' opts ')' ignored Call InitRtn 'CallPipe (Name GetSMsgResp End ?)', 'Literal' timeout_value, '|Delay', '|stopper:Faninany', '|xx:Gate', '?', 'Starmsg *MSG CP SMSG' tgtmach what ||, '|xx:', '|ours:Find 0001' || Left(tgtmach,8,'_') ||, '|dec:Fanout', '|Take 1', '|Spec /' || msg_wait || '/ 1', '|Elastic', '|Delay', '|stopper:', '?dec:', '|Spec 17-* n', '|*:', '?ours:', '|obnd:Pick 17.10 == /HCPMSG045E/', '|Elastic', '|stopper:', '?obnd:', '|Spec /From/ 1 9.8 strip nw /:/ n 17-* nw', '|Cons' Call CleanUp Exit xRc InitRtn: timeout_value = '+20';msg_wait='+1' what = Strip(what) Parse value Diag(8,'Q SET') with . 'MSG' wasmsg . 'CPCONIO' wascpcio . wasmsg = Strip(wasmsg,'T',',') wascpcio = Strip(wascpcio,'T',',') iRc = 0 popts='' Do while opts '' Parse var opts opt opts Select When Abbrev('TIMEOUT',opt,1) |, Abbrev('DELAY',opt,3) then Do Parse var opts timeout_value opts If Pos('.',timeout_value)=1 then timeout_value='0'timeout_value timeout_value = '+' || timeout_value End When Abbrev('WAITCONT',opt,1) |, Abbrev('WAITON',opt,1) then Do Parse var opts msg_wait opts If pos('.',msg_wait)=1 then msg_wait='0'msg_wait msg_wait = '+' || msg_wait End Otherwise popts = Strip(popts opt) End /* select */ End If popts'' then what = what'('popts')' If iRc 0 then Exit iRc /*---*---*---*---*---*---*/ /* Ensure secuser isn't directing msgs elsewhere */ /*---*---*---*---*---*---*/ dscd = Word(Diag(8,'Q CONS'),3) == 'DISCONNECTED' If dscd then Do Parse value DiagRc(8,'Q PRIV') with . '15'x . ':' myprivs . '15'x If Verify(myprivs,'AC','M')0 then do_me = '*' Else do_me = '' Parse value DiagRc(8,'Q SECUSER *'), with . '15'x . '15'x suinfo '15'x Parse var suinfo . whoisit . If whoisit'not' then Parse value DiagRc(8,'SET SECUSER' do_me 'OFF') with . Else whoisit = '' End 'Commit 0' /* hot to trot */ x=Diag(8,'SET MSG IUCV' || '15'x || 'SET CPCONIO IUCV') Return CleanUp: xRc = Rc x = Diag(8,'SET MSG' wasmsg || '15'x || 'SET CPCONIO' wascpcio) If dscd then if whoisit'' then Parse value Diag(8,'SET SECUSER' do_me whoisit) with . Return
Re: Capturing response from SCS
Good answer, and it's there because in one application there was another stage which wouldn't go to ready (commit 0) until everyone else did. In most cases it's a harmless artifact. -- Mike Harding z/VM System Support mhard...@us.ibm.com mike.b.hard...@kp.org mikehard...@mindless.com (925) 926-3179 (w) (925) 323-2070 (c) IM: VMBearDad (AIM), mbhcpcvt (Y!) The IBM z/VM Operating System IBMVM@LISTSERV.UARK.EDU wrote on 07/20/2011 02:45:41 PM: From: Scott Rohling scott.rohl...@gmail.com To: IBMVM@LISTSERV.UARK.EDU Date: 07/20/2011 02:46 PM Subject: Re: Capturing response from SCS Sent by: The IBM z/VM Operating System IBMVM@LISTSERV.UARK.EDU It's a plumbing thing .. HELP PIPE COMMIT .. commit 0 requests that the commit level of the TCOMMT stage be raised to 0. The TCOMMT stage is then suspended until all the other stages in the pipeline have committed at least to level 0 or have ended. The return code from COMMIT is then set to the current aggregate code. That explains it - right? ;-) Scott Rohling On Wed, Jul 20, 2011 at 2:34 PM, Fran Hensler f...@zvm.sru.edu wrote: What is line 78 supposed to do? 'Commit 0' /* hot to trot */ /Fran Hensler at Slippery Rock University of Pennsylvania USA for 48 years mailto:f...@zvm.sru.edu http://zvm.sru.edu/~fjh +1.724.794.6172 Yes, Virginia, there is a Slippery Rock