Does a CLIST know its own name?



IBM's Command List programming language & Restructured Extended Executor

Does a CLIST know its own name?

Postby jsavoye » Thu Dec 29, 2016 8:03 pm

Well, if this is a silly question, at least it may provide some entertainment value. (The title of the topic necessarily sounds like an existential quandary.)

If I have a CLIST created under ISPF as aaaaa.bbbbb.cccc(clname) is there any way that the clist knows it is clname (or aaaaa.bbbbb.cccc(clname))? I have tried what seem to be all the system variables, such as &SYSICMD, &SYSPCMD, etc., at the very beginning of the code, and none of them appear to list anything that resembles the name. For now, I have had to code the name of the clist as a variable within the code, but it would be nice to have it assignable dynamically. Thanks.
jsavoye
 
Posts: 23
Joined: Wed Dec 08, 2010 8:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Does a CLIST know its own name?

Postby prino » Fri Dec 30, 2016 12:38 am

That's why people now use REXX...
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: Does a CLIST know its own name?

Postby jsavoye » Fri Dec 30, 2016 8:34 pm

So, does a REXX procedure know its own name?
jsavoye
 
Posts: 23
Joined: Wed Dec 08, 2010 8:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Does a CLIST know its own name?

Postby Akatsukami » Fri Dec 30, 2016 9:31 pm

Yes; it is the third token gotten from PARSE SOURCE.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Does a CLIST know its own name?

Postby jsavoye » Fri Dec 30, 2016 9:44 pm

Interesting, although I am not looking forward to converting these CLISTs to REXX. The lack of a GOTO means a complete rewrite (and no, I don't think the elimination of GOTO really helps.) most of our users are also accustomed to entering a small bit of input at the end of a preformatted line (CLIST's WRITENR), but SAY and PULL in REXX don't quite support this format, at least as far as I can tell. Still, I thank you for the tip.
jsavoye
 
Posts: 23
Joined: Wed Dec 08, 2010 8:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Does a CLIST know its own name?

Postby Akatsukami » Fri Dec 30, 2016 9:59 pm

Rexx is technically a GOTOless language; to the left, the signal instruction will provide the same functionality.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Does a CLIST know its own name?

Postby NicC » Sat Dec 31, 2016 2:26 am

You can also call al little clist to: receive a prompt string from the rexx program, do a writenr, read the response and, finally, store the reponse in an ispf variable for your rexx program to retrieve and process.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Does a CLIST know its own name?

Postby jsavoye » Thu Jan 05, 2017 10:26 pm

Actually, I did consider using a CLIST to display a string of text and get the response, but I did not have any luck in getting it back to the REXX. I am not really familiar with VPUT/VGET. It seems strange that user input is one area where CLISTs have a slight edge (although hardly very elegant in any case).

If it were simply a Y or N response, I suppose I could use one of the system variables that allow setting, but I would need to hold up to 8 characters of text.

And I was hoping not to go to all the overhead of writing the data to a temporary member just to read it back again. At some point, the trouble eliminates the utility of trying to keep a user from seeing anything different.
jsavoye
 
Posts: 23
Joined: Wed Dec 08, 2010 8:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Does a CLIST know its own name?

Postby NicC » Fri Jan 06, 2017 4:31 am

Another alternative is to use a panel for interfacing with the user. If you have the rexx toolkit installed you can use CHAROUT to issue a prompt - it does not issue a carriage return.
For the CLIST solution I have/had a working test program which is where I got the information.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Does a CLIST know its own name?

Postby willy jensen » Fri Jan 06, 2017 4:36 pm

If you just need a dynamic 1-line prompt with response, then this may be used. Clearly not as simple as the CLIST WRITENR, but at least you can use the same panel for different prompts.
Save this panel as AREA1:

)Attr                                    
 @ area(dynamic) extend(on) scroll(on)  
 " type(dataout) color(green) caps(off)  
 # type(datain ) color(turq) caps(off)  
)Body expand(\\)                        
@area1   \ \@                            
)Init                                    
)Proc                                    
)End                                    

Use as in this REXX snippet:

 prompt=' "Please enter name'                        
 area1 =left(prompt'#',60)                            
 address ispexec "addpop"                            
 address ispexec "display panel(area1) cursor(area1)",
                 "csrpos("length(prompt)+2")"        
 address ispexec "rempop"                            
 parse var area1 . '#' resp                          
 say 'response:' resp                                
 
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post