Page 1 of 2

To get the scrname as a member name

PostPosted: Sun Apr 26, 2020 3:55 am
by arya_starc
I am trying to change the current Scrname to the current member name on which I submitted my ISPF rexx.
But I am getting error message on the line where I am giving SCRNAME syntax.
Below is my code

/* REXX */                    
TRACE I                        
"ISREDIT MACRO"                
"ISREDIT (DSN) = DATASET"      
"ISREDIT (DSM) = MEMBER"      
"ISPEXEC SCRNAME(DSM)"        
SAY DSN                        
SAY DSM                        
 

if I submit this rexx in my ISPF view screen in my pds - test.mypds.rexx(sample)..so I am expecting my scrname for this window should change to sample.
Below is the error message I am getting on submitting above code

******************************************************************************
* ISPS100                                                                    *
*                                                                            *
* Invalid service name                                                       *
* 'SCRNAME(DSM)' exceeds the allowable length of 8.                          *
*                                                                            *
*                                                                            *
*                                                                            *
*                                                                            *
*                                                                            *
*                                                                            *
* Current dialog statement:                                                  *
* SCRNAME(DSM)                                                               *
*                                                                            *
* Enter HELP command for further information regarding this error.           *
* Press ENTER key to terminate the dialog.                                   *
*                                                                            *
*                                                                            *
*                                                                            *
*                                                                            *
 


Please let me know where I am getting wrong.Thanks in advance.

Re: To get the scrname as a member name

PostPosted: Sun Apr 26, 2020 4:14 am
by Pedro
SCRNAME is not a valid ISPF service name.

I think you should assign the screen name that you want to variable ZSCRNAME and save it to the SHARED pool. See ISPF Dialog Developers Guide, appendix E. In particular, see the example after the table.

See ISPF Services Guide for a list of the valid ISPF services.

Re: To get the scrname as a member name

PostPosted: Sun Apr 26, 2020 2:20 pm
by willy jensen
SCRNAME is a parameter of the SELECT command. You can set the ZSCRNAME variable like Pedro suggests before displaying a panel, but the screen name reverts to the current one when the display ends.
By the way your syntax is wrong, the dsm varible must outside the quotes like "SCRNAME("dsm")".

Extract from one of my programs, showing SELECT .. SCRNAME


 Address Ispexec                                                    
 "control errors return"                                            
 /* ensure correct applid for dialog, set screenname */              
 "vget zapplid"                                                      
 if zapplid<>'MLCZ' then do                                          
   parse source sys type whoami ddn whereami .                      
   "Select cmd(%"whoami arg(1)") newappl(MLCZ) passlib scrname(MLCZ)"
   exit rc                                                          
 end      

Re: To get the scrname as a member name

PostPosted: Sun Apr 26, 2020 11:30 pm
by Pedro
Willy, I think the poster's situation is different than your example. He wants to show the member name that is currently being edited, presumably so that he can use SCRNAME ON and be able to know which split screen session it is. Because it is in the shared pool, I think it will remain as long as he is editing that member.

It would be terribly intrusive to use an EXEC with SELECT service to launch the editor instead of just using the normal editor.

Re: To get the scrname as a member name

PostPosted: Mon Apr 27, 2020 1:50 pm
by willy jensen
Pedro, I know, I just wanted show one way of using the SCRNAME parameter. I should have been clear about that.

Re: To get the scrname as a member name

PostPosted: Mon Apr 27, 2020 7:57 pm
by arya_starc
Hi Pedro,
I think you should assign the screen name that you want to variable ZSCRNAME and save it to the SHARED pool.


As suggested I am trying to using VPUT syntax for getting the screen. Seems it is not correct, could you please provide some more insight.


/* REXX */                  
TRACE I                      
"ISREDIT MACRO"              
"ISREDIT (DSN) = DATASET"    
"ISREDIT (DSM) = MEMBER"    
ZSCRNAME = DSM              
"VPUT (ZSCRNAME) SHARED"    
SAY DSN                      
SAY DSM                      
 


Thanks so much.

Re: To get the scrname as a member name

PostPosted: Mon Apr 27, 2020 8:24 pm
by willy jensen
You can't do it like that. The screen name is reset when the EDIT is closed, so unlesss you display something during the edit, you are out of luck. Experimentation shows that the zscrname variable must be set prior to displaying a panel, so it must be set before the EDIT, not as part of it, i.e.:

zscrname='ALCPDSEG'
address ispexec "vput zscrname shared"
address ispexec "edit dataset('WJENSEN.LIB.CNTL(ALCPDSEG)')"

Re: To get the scrname as a member name

PostPosted: Wed Apr 29, 2020 3:08 am
by Pedro
using VPUT syntax for getting the screen. Seems it is not correct

It seems that you did not tell us what errors you are getting. Can you elaborate?

Re: To get the scrname as a member name

PostPosted: Thu Apr 30, 2020 2:09 pm
by arya_starc
Hi Pedro,

I was getting below error when executing the below code:-
Code:


/* REXX */                  
TRACE I                      
"ISREDIT MACRO"              
"ISREDIT (DSN) = DATASET"    
"ISREDIT (DSM) = MEMBER"    
ZSCRNAME = DSM              
"VPUT (ZSCRNAME) SHARED"    
SAY DSN                      
SAY DSM                      
 


Error:

IKJ56500I COMMAND VPUT NOT FOUND    
    11 *-* "VPUT (ZSCRNAME) SHARED"  
       +++ RC(-3) +++                
TEST.ABCD.CLIST                      
TESTNAME                            
 


TEST.ABCD.CLIST -->> pds name
TESTNAME -->> member

Re: To get the scrname as a member name

PostPosted: Thu Apr 30, 2020 2:17 pm
by arya_starc
Hi Wily,Pedro

After executing below code the scrname is getting assign to the screen using VPUT. But the problem is that it is assign to the new screen which open in top of same screen.


 000001 /* REXX */                                      
 000002 "ISREDIT MACRO"                                
 000003 "ISREDIT (DSN) = DATASET"                      
 000004 "ISREDIT (DSM) = MEMBER"                        
 000005 ZSCRNAME = DSM                                  
 000006 ADDRESS ISPEXEC "VPUT ZSCRNAME SHARED"          
 000007 ADDRESS ISPEXEC "VIEW DATASET( "DSN"("DSM") )"  
 


I am just trying to assign the name to the same opened screen.
How can I assign the ZCRNAME to the already open scrname.

Thanks....