Multiple Sel/endsel in skeleton

IBM's Command List programming language & Restructured Extended Executor
shiisama
Posts: 5
Joined: Fri Apr 23, 2021 4:35 pm
Skillset: z/os
Referer: google

Multiple Sel/endsel in skeleton

Postby shiisama » Fri Apr 23, 2021 4:45 pm

Hi,
I did a rexx panels where you can enter some choices, i use the variables &W and &K.
And i did a squels (skeleton) where i want to use the SEL/ENDSEL function.

I want when &K= O && &W = N
It doessomething
And when &W= O && &K = N
Do an other thing.

Actually when &K = O && W = N , it work but the other function doesn't.


Do someone know how to do it ?
Thanks
You do not have the required permissions to view the files attached to this post.

willy jensen
Posts: 474
Joined: Thu Mar 10, 2016 5:03 pm
Skillset: assembler rexx zOS ispf racf smf
Referer: saw it in the experts foprum thought I could help here

Re: Multiple Sel/endsel in skeleton

Postby willy jensen » Fri Apr 23, 2021 10:51 pm

Try listing the values before the )SEL statement, just to make sure that they are as you expect, i..e

K = &K
W =&W

willy jensen
Posts: 474
Joined: Thu Mar 10, 2016 5:03 pm
Skillset: assembler rexx zOS ispf racf smf
Referer: saw it in the experts foprum thought I could help here

Re: Multiple Sel/endsel in skeleton

Postby willy jensen » Fri Apr 23, 2021 10:52 pm

And please use the 'code' tags instead of screen shots.

User avatar
sergeyken
Posts: 458
Joined: Wed Jul 24, 2019 10:12 pm
Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
Referer: Internet search

Re: Multiple Sel/endsel in skeleton

Postby sergeyken » Fri Apr 23, 2021 11:47 pm

Why not:

Code: Select all

)IF &K= O && &W = N THEN )DO
        It does something
)ENDDO
)ELSE )IF &W= O && &K = N THEN )DO
        Do another thing.
)ENDDO
Javas and Pythons come and go, but JCL and SORT stay forever.

shiisama
Posts: 5
Joined: Fri Apr 23, 2021 4:35 pm
Skillset: z/os
Referer: google

Re: Multiple Sel/endsel in skeleton

Postby shiisama » Sat Apr 24, 2021 5:09 am

willy jensen wrote:And please use the 'code' tags instead of screen shots.


If i list the variable before the sel statement it doesn't work anymore

shiisama
Posts: 5
Joined: Fri Apr 23, 2021 4:35 pm
Skillset: z/os
Referer: google

Re: Multiple Sel/endsel in skeleton

Postby shiisama » Sat Apr 24, 2021 7:28 am

sergeyken wrote:Why not:

Code: Select all

)IF &K= O && &W = N THEN )DO
        It does something
)ENDDO
)ELSE )IF &W= O && &K = N THEN )DO
        Do another thing.
)ENDDO


i tried the loop with if and it doesn't work too
only the sel loop is working

willy jensen
Posts: 474
Joined: Thu Mar 10, 2016 5:03 pm
Skillset: assembler rexx zOS ispf racf smf
Referer: saw it in the experts foprum thought I could help here

Re: Multiple Sel/endsel in skeleton

Postby willy jensen » Sat Apr 24, 2021 1:40 pm

What do you mean, it doesnt work anymore if you add those 2 displays? Do you get an error message from the FTINCL command?
Anyway, I did a quick test and it works as expected, including listing the variables:

Code: Select all


)SET W = O            
)SET K = N            
                       
K = &K                
W = &W                
                       
)SEL &K = O && &W = N  
 k=O and W=N          
)ENDSEL                
                       
)SEL &K = N && &W = O  
 k=N and W=O          
)ENDSEL  

willy jensen
Posts: 474
Joined: Thu Mar 10, 2016 5:03 pm
Skillset: assembler rexx zOS ispf racf smf
Referer: saw it in the experts foprum thought I could help here

Re: Multiple Sel/endsel in skeleton

Postby willy jensen » Sat Apr 24, 2021 9:32 pm

Re error messages, I recommend that you do something like this:

Code: Select all


Address ispexec "control errors return"
Address ispexec "TBOPEN ..."
zerrlm=''
Address ispexec "TBINCL" skelname
if rc<>0 then say 'Include skel' skelname 'rc' rc 'msg' zerrlm

shiisama
Posts: 5
Joined: Fri Apr 23, 2021 4:35 pm
Skillset: z/os
Referer: google

Re: Multiple Sel/endsel in skeleton

Postby shiisama » Sat Apr 24, 2021 11:19 pm

[quote="willy jensen"]What do you mean, it doesnt work anymore if you add those 2 displays? Do you get an error message from the FTINCL command?

I don't have any error but the loop doesn't execute anymore.
For example when i just have the sel loop for w = o
The rexx gonna execute and work
And if i had before the sel loop
w =&w
The rexx execute, it say "the program have been executed" but it doesn't work

willy jensen
Posts: 474
Joined: Thu Mar 10, 2016 5:03 pm
Skillset: assembler rexx zOS ispf racf smf
Referer: saw it in the experts foprum thought I could help here

Re: Multiple Sel/endsel in skeleton

Postby willy jensen » Sun Apr 25, 2021 2:49 am

I am confused, you started talking about a problem in skeleton services, but now you say that you have a logical problem in a REXX?
I would really like to see a trace of the REXX portion that fails, especially the part with the FTINCL command. Please list the ZERRLM variable after FTINCL, like SAY 'errlm='ZERRLM. Also a list of the skeleton would be helpful.


  • Similar Topics
    Replies
    Views
    Last post