To get the scrname as a member name



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

To get the scrname as a member name

Postby arya_starc » Sun Apr 26, 2020 3:55 am

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.
arya_starc
 
Posts: 132
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Re: To get the scrname as a member name

 

Re: To get the scrname as a member name

Postby Pedro » Sun Apr 26, 2020 4:14 am

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.
Pedro Vera
User avatar
Pedro
 
Posts: 622
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 44 times

Re: To get the scrname as a member name

Postby willy jensen » Sun Apr 26, 2020 2:20 pm

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      
willy jensen
 
Posts: 299
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 42 times

Re: To get the scrname as a member name

Postby Pedro » Sun Apr 26, 2020 11:30 pm

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.
Pedro Vera
User avatar
Pedro
 
Posts: 622
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 44 times

Re: To get the scrname as a member name

Postby willy jensen » Mon Apr 27, 2020 1:50 pm

Pedro, I know, I just wanted show one way of using the SCRNAME parameter. I should have been clear about that.
willy jensen
 
Posts: 299
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 42 times

Re: To get the scrname as a member name

Postby arya_starc » Mon Apr 27, 2020 7:57 pm

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.
arya_starc
 
Posts: 132
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Re: To get the scrname as a member name

Postby willy jensen » Mon Apr 27, 2020 8:24 pm

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)')"
willy jensen
 
Posts: 299
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 42 times

Re: To get the scrname as a member name

Postby Pedro » Wed Apr 29, 2020 3:08 am

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?
Pedro Vera
User avatar
Pedro
 
Posts: 622
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 44 times

Re: To get the scrname as a member name

Postby arya_starc » Thu Apr 30, 2020 2:09 pm

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
arya_starc
 
Posts: 132
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Re: To get the scrname as a member name

Postby arya_starc » Thu Apr 30, 2020 2:17 pm

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....
arya_starc
 
Posts: 132
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Next

Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post