ISPF / Rexx / NEWAPPL

58 views
Skip to first unread message

Lars Höglund

unread,
Jan 18, 2023, 10:01:32 AM1/18/23
to ispf-...@nd.edu

I’m trying to fetch content in variables lying in another APPL(zapplid)

 

I’m starting the “subroutine” from a Rexx like this

 

(sample code is just a small part…)

 

I can’t use RETURN rcode ‘text’, so I’m trying to “QUEUE” the result but that don’t work either

 

Does anyone have another (working) solution?

 

 

/* REXX */                                              

trace r                                                 

  address "ISPEXEC" "SELECT CMD(%TSTAPPL2) NEWAPPL(ABCD)"

  say 'Back from TSTAPPL2 RC='rc                         

  pull tstappl2_result                                  

  say 'From TSTAPPL2' strip(tstappl2_result)            

  exit 0

 

Subroutine:

 

/* REXX */                                    

trace r                                        

  say 'Entering TSTAPPL2'                     

  address ispexec 'vget zapplid shared'       

  say 'TSTAPPL2: zapplid='zapplid             

  queue 'This is a return text from TSTAPPL2' 

  return 0                                    

 

The result is

                                              

     3 *-* address "ISPEXEC" "SELECT CMD(%TSTAPPL2) NEWAPPL(ABCD)"

       >>>   "SELECT CMD(%TSTAPPL2) NEWAPPL(ABCD)"                

     3 *-* say 'Entering TSTAPPL2'                                

       >>>   "Entering TSTAPPL2"                                  

Entering TSTAPPL2                                                 

     4 *-* address ispexec 'vget zapplid shared'                  

       >>>   "vget zapplid shared"                                

     5 *-* say 'TSTAPPL2: zapplid='zapplid                        

       >>>   "TSTAPPL2: zapplid=ABCD"                              

TSTAPPL2: zapplid=ABCD                                            

     6 *-* queue 'This is a return text from TSTAPPL2'            

       >>>   "This is a return text from TSTAPPL2"                

     7 *-* return 0                                                

       >>>   "0"                                                  

COMMAND THIS NOT FOUND   ç= this seems to be “before” we are exiting the subroutine                                          

       +++ RC(12) +++                                             

     4 *-* say 'Back from TSTAPPL2 RC='rc                         

       >>>   "Back from TSTAPPL2 RC=12"                           

Back from TSTAPPL2 RC=12                                          

     5 *-* pull tstappl2_result         ç== here it’s waiting…                                

                                                                   

  //Lasse                                                                

 

                                               

Frank Clarke

unread,
Jan 18, 2023, 10:32:40 AM1/18/23
to ispf-...@nd.edu
The queued string is being handed to the system to be executed, it looks like.  Try putting an
    address TSO "NEWSTACK"
before the 'SELECT CMD( )', and 
    address TSO "DELSTACK"
after the pull.  It may work to isolate the queued string.




--
You received this message because you are subscribed to the Google Groups "ISPF discussion list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ispf-l-list...@nd.edu.
To view this discussion on the web visit https://groups.google.com/a/nd.edu/d/msgid/ispf-l-list/AM7PR03MB650078AC0E9F0DF1BBD2D65A8DC79%40AM7PR03MB6500.eurprd03.prod.outlook.com.

Lars Höglund

unread,
Jan 18, 2023, 10:40:12 AM1/18/23
to ispf-...@nd.edu

robhb...@gmail.com

unread,
Jan 18, 2023, 10:44:56 AM1/18/23
to ispf-...@nd.edu

I realize that you’re looking for a way to return a string on the stack, and I don’t know why that isn’t working.  But I’m distracted by the return code from the subroutine.  Why 12?  The subroutine seems to run correctly, and explicitly returns 0.  Seems to me there might be a clue there.

 

---

Bob Bridges, robhb...@gmail.com, cell 336 382-7313

 

/* When I was ten, I read fairy tales in secret and would have been ashamed if I had been found doing so. Now that I am fifty I read them openly. When I became a man I put away childish things, including the fear of childishness and the desire to be very grown up.  -C.S. Lewis */

 

 

--

lbd...@gmail.com

unread,
Jan 18, 2023, 11:14:29 AM1/18/23
to ispf-...@nd.edu
This works - not pretty but it should give you the idea of how to do it:

/* rexx */
parse arg opt
address ispexec 'vget (zapplid)'
appl = zapplid
if opt = '' then do
address ispexec 'select cmd(%tappl 1' appl') newappl(xyz)'
address ispexec 'vget (string) profile'
say 'string:' string
address ispexec 'verase (string)'
say rc
exit 0
end
if word(opt,1) = 1 then do
parse value opt with opt appl
string = 'abc def'
address ispexec 'select cmd(%tappl 2' string') newappl('appl')'
return 0
end
if word(opt,1) = 2 then do
parse value opt with opt string
address ispexec 'vput (string) profile'
exit 0


Lionel B. Dyck <><
Website: https://www.lbdsoftware.com
Github: https://github.com/lbdyck

“Worry more about your character than your reputation. Character is what you are, reputation merely what others think you are.” - - - John Wooden

From: ispf-...@nd.edu <ispf-...@nd.edu> On Behalf Of Lars Höglund
Sent: Wednesday, January 18, 2023 9:40 AM
To: ispf-...@nd.edu
Subject: Sv: [ISPF-L] ISPF / Rexx / NEWAPPL

Same result

Från: 'Frank Clarke' via ISPF discussion list <mailto:ispf-...@nd.edu>
Skickat: den 18 januari 2023 16:33
Till: mailto:ispf-...@nd.edu
Ämne: Re: [ISPF-L] ISPF / Rexx / NEWAPPL

The queued string is being handed to the system to be executed, it looks like. Try putting an
address TSO "NEWSTACK"
before the 'SELECT CMD( )', and
address TSO "DELSTACK"
after the pull. It may work to isolate the queued string.




COMMAND THIS NOT FOUND ⇐= this seems to be “before” we are exiting the subroutine
+++ RC(12) +++
4 *-* say 'Back from TSTAPPL2 RC='rc
>>> "Back from TSTAPPL2 RC=12"
Back from TSTAPPL2 RC=12
5 *-* pull tstappl2_result ⇐== here it’s waiting…

//Lasse


--
You received this message because you are subscribed to the Google Groups "ISPF discussion list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailto:ispf-l-list...@nd.edu.
To view this discussion on the web visit https://groups.google.com/a/nd.edu/d/msgid/ispf-l-list/AM7PR03MB650078AC0E9F0DF1BBD2D65A8DC79%40AM7PR03MB6500.eurprd03.prod.outlook.com?utm_medium=email&utm_source=footer.
--
You received this message because you are subscribed to the Google Groups "ISPF discussion list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailto:ispf-l-list...@nd.edu.
To view this discussion on the web visit https://groups.google.com/a/nd.edu/d/msgid/ispf-l-list/951783408.2571840.1674055955168%40mail.yahoo.com?utm_medium=email&utm_source=footer.
--
You received this message because you are subscribed to the Google Groups "ISPF discussion list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailto:ispf-l-list...@nd.edu.
To view this discussion on the web visit https://groups.google.com/a/nd.edu/d/msgid/ispf-l-list/AM7PR03MB6500543B2853C71FD722A2BD8DC79%40AM7PR03MB6500.eurprd03.prod.outlook.com?utm_medium=email&utm_source=footer.

Marvin Knight

unread,
Jan 18, 2023, 6:08:57 PM1/18/23
to ispf-...@nd.edu
Alternatively, to what Lionel suggested you can use table services rather than using VPUT to a profile.
A profile is a 1 row all extension variable table. So just use table services and create your own global profile.
This could work across multiple applid's. For instance

/* rexx */
d = '23456'
e = '27890'
address ISPEXEC
"TBCREATE GLBL NOWRITE"
"TBADD GLBL SAVE(D E)" /* create row 1 and pass vars d and e */
"SELECT CMD(RX2) NEWAPPL(ABCD)"
"TBGET GLBL"
say "a is " a
say "b is " b
say "c is " c
say "d is " d
say "e is " e
"TBEND GLBL "

/* rexx RX2 */
address ispexec
"TBGET GLBL"
SAY "vars passed" d e
a = '2AaA'
b = '2b'
c = '2c'
e = 'e was changed'
"TBPUT GLBL SAVE(A B C D E)" /* update row 1 and add ext vars a b c,changing e*/

If you want to keep the variables, then actually save/write the table. This is essentially what is done with ISPSPROF.

Marvin Knight
To view this discussion on the web visit https://groups.google.com/a/nd.edu/d/msgid/ispf-l-list/951783408.2571840.1674055955168%40mail.yahoo.com?utm_medium=email&utm_source=footer .
--
You received this message because you are subscribed to the Google Groups "ISPF discussion list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailto:ispf-l-list...@nd.edu.
To view this discussion on the web visit https://groups.google.com/a/nd.edu/d/msgid/ispf-l-list/AM7PR03MB6500543B2853C71FD722A2BD8DC79%40AM7PR03MB6500.eurprd03.prod.outlook.com?utm_medium=email&utm_source=footer .

--
You received this message because you are subscribed to the Google Groups "ISPF discussion list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ispf-l-list...@nd.edu.
To view this discussion on the web visit https://groups.google.com/a/nd.edu/d/msgid/ispf-l-list/034901d92b57%24ef9ec850%24cedc58f0%24%40gmail.com .

Lars Höglund

unread,
Jan 19, 2023, 3:42:10 AM1/19/23
to ispf-...@nd.edu
Thanks all

I did the ISPF-table solution, works fine

//Lasse

-----Ursprungligt meddelande-----
Från: ispf-...@nd.edu <ispf-...@nd.edu> För Marvin Knight
Skickat: den 19 januari 2023 00:09
Till: ispf-...@nd.edu
Ämne: RE: [ISPF-L] ISPF / Rexx / NEWAPPL
To view this discussion on the web visit https://groups.google.com/a/nd.edu/d/msgid/ispf-l-list/SN7PR15MB42242663325049A811C9590D81C79%40SN7PR15MB4224.namprd15.prod.outlook.com.

lbd...@gmail.com

unread,
Jan 19, 2023, 6:58:13 AM1/19/23
to ispf-...@nd.edu
Good one - I thought of that but decided the extra work to create/open/save/open/delete the table wasn't worth it when a profile variable was less code and worked.

What this proves is there are different ways to solve a problem.


Lionel B. Dyck <><
Website: https://www.lbdsoftware.com
Github: https://github.com/lbdyck

“Worry more about your character than your reputation. Character is what you are, reputation merely what others think you are.” - - - John Wooden

To view this discussion on the web visit https://groups.google.com/a/nd.edu/d/msgid/ispf-l-list/SN7PR15MB42242663325049A811C9590D81C79%40SN7PR15MB4224.namprd15.prod.outlook.com.

Reply all
Reply to author
Forward
0 new messages