REXX w/ ISPEXEC VIEW and obtaining data from it



IBM's Command List programming language & Restructured Extended Executor

REXX w/ ISPEXEC VIEW and obtaining data from it

Postby Jeff R » Fri Dec 09, 2022 7:12 pm

Trying to figure out how to gather data from an ISPEXEC VIEW session initiated from within a REXX, code to initiate the VIEW (user inputs TYPE, LIBRARY and MEMBER) :

"ISPEXEC VIEW DATASET('"VALUE(TYPE"."LIBRARY)"("MEMBER")')"

when in the VIEW session, I need to obtain various data...i.e. ZTITLE, data in current line (after issuing a FIND command to locate specific data string)

example of a portion of the VIEW session screen after the FIND issued (FIND 'STEP03') :

File Edit Edit_Settings Menu Utilities Compilers Test Help
------------------------------------------------------------------------------
VIEW CCP.BASE.PROCLIB(C@D0039) - 01.33 CHARS 'STEP03' found
Command ===> Scroll ===> PAGE
000051 // INCLUDE MEMBER=($SYSOUT)
000052 //STEP03 EXEC PGM=SORT,COND=(0,LT)
000053 //********************************************************************
000054 //*** SORT ***
000055 //********************************************************************
000056 //SORTIN DD DSN=&HLQ3.D0039.&RGN.QTEMP.TRAN&BR0,DISP=&D1
000057 //SORTOUT DD DSN=&HLQ3.D0039.&RGN.QTEMP.WORK(+1),DISP=&D3,

Thanks in advance !!
Jeff R
 
Posts: 27
Joined: Fri Dec 09, 2022 6:59 pm
Has thanked: 4 times
Been thanked: 0 time

Re: REXX w/ ISPEXEC VIEW and obtaining data from it

Postby prino » Fri Dec 09, 2022 10:30 pm

You have to invoke the view session with a macro that saves (VPUT) whatever needs to be passed back in the shared pool.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

Re: REXX w/ ISPEXEC VIEW and obtaining data from it

Postby Jeff R » Fri Dec 09, 2022 10:40 pm

Could you provide me an example of using the VPUT with the ISPEXEC command I supplied ?...for example to obtain the ZTITLE in a variable
Jeff R
 
Posts: 27
Joined: Fri Dec 09, 2022 6:59 pm
Has thanked: 4 times
Been thanked: 0 time

Re: REXX w/ ISPEXEC VIEW and obtaining data from it

Postby prino » Fri Dec 09, 2022 11:09 pm

You might want to have a look at editclip, a REXX exec which invokes itself as a macro to do some processing.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

Re: REXX w/ ISPEXEC VIEW and obtaining data from it

Postby Jeff R » Fri Dec 09, 2022 11:30 pm

Not too helpful...I'm new to using ISPF within REXX
Jeff R
 
Posts: 27
Joined: Fri Dec 09, 2022 6:59 pm
Has thanked: 4 times
Been thanked: 0 time

Re: REXX w/ ISPEXEC VIEW and obtaining data from it

Postby willy jensen » Sat Dec 10, 2022 3:54 am

To pull data from within a VIEW (and EDIT) session, i think the only way is to use the ZSCREENI variable to capture the screen image.

Sample REXX driver:
address ispexec "VIEW DATASET('your.dataset.name') PANEL(testpnl)"
say left(pimage,50)  


Sample panel )PROC section:
)PROC  
&pimage   = &zscreeni  
willy jensen
 
Posts: 467
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 70 times

Re: REXX w/ ISPEXEC VIEW and obtaining data from it

Postby willy jensen » Sat Dec 10, 2022 4:03 am

Just realized that you have to write a new edit panel or modify an existing one. Here is the entire panel I used for the test:

)ATTR                                
)BODY EXPAND(//)                      
%EDIT / /+                            
%Command ===>_ZCMD / / #Scroll_scrl%  
+                                    
)INIT    
 &scrl = 'CSR'                            
)PROC                                
 &pimage   = &zscreeni                
)END      
willy jensen
 
Posts: 467
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 70 times

Re: REXX w/ ISPEXEC VIEW and obtaining data from it

Postby Jeff R » Sat Dec 10, 2022 4:25 am

Thanks...but not looking to use the Screen Image...looking to grab the ZTITLE ("CCP.BASE.PROCLIB(C@D0039) - 01.33" in my screen example) and grab row of data from the file after FIND issued (issued "FIND STEP03" which I can address via LINE_AFTER .ZCSR) but I haven't been able to grab ZTITLE or ZCSR while in the VIEW session
Jeff R
 
Posts: 27
Joined: Fri Dec 09, 2022 6:59 pm
Has thanked: 4 times
Been thanked: 0 time

Re: REXX w/ ISPEXEC VIEW and obtaining data from it

Postby Pedro » Sat Dec 10, 2022 8:06 am

Not too helpful...I'm new to using ISPF within REXX

This is likely beyond your skill level.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: REXX w/ ISPEXEC VIEW and obtaining data from it

Postby Pedro » Sat Dec 10, 2022 8:58 am

It is non-trivial because you want to invoke view AND also intercept your find command. My suggestion involves three separate rexx programs:

1. In your current rexx program, invoke view and specify the name of the initial editor macro.
"ISPEXEC VIEW DATASET('"VALUE(TYPE"."LIBRARY)"("MEMBER")') MACRO(mymacro)"
 


2. The editor macro is a separate rexx program that you supply. In this rexx program (named MYMACRO in this example), use Address ISREDIT to set an alias for 'F', so that when you issue the FIND, it runs a third rexx program. I am unsure of the syntax, but something like this:
Address ISREDIT F ALIAS myfind01
Address ISREDIT FIND ALIAS myfind01
 


3. The third rexx program (named MYFIND01 in this example) will:
a. take any supplied parameters.
b. Address ISREDIT BUILTIN "FIND" inparms
c. Use the return code to determine if the FIND was successful.
d. Address ISREDIT LINE (mydata) = LINE .zcsr /* to get data from line */
Use VPUT to save any data that you want to save.

Your requirement was not clear. If it is always the same FIND command, you can do it from within the MYMACRO program instead of needing the third rexx program.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post