Page 2 of 2

Re: External functions in Rexx

PostPosted: Mon Oct 28, 2019 9:59 pm
by willy jensen
I think that you are missing my point, you must do away with the count and filler fields. I imagine something like this:

WORKING-STORAGE SECTION.
01          ispf-service    pic  x(08).                  
01          ispf-key-list   pic  x(60).                              
01          ispf-name-list  pic  x(60).                              
01          ispf-table-name pic  x(08).                  
01          ispf-option1    pic  x(08).                  
01          ispf-option2    pic  x(08).
   
PROCEDURE DIVISION.
   move 'TBCREATE'         to  ispf-service    
   move 'TESTTBL1'         to  ispf-table-name
   move SPACES TO ispf-name-list
   move SPACES TO ispf-key-list
   move '(VAR1 VAR2) '     to  ispf-name-list
   move '        '         to  ispf-key-list    
   move 'NOWRITE '         to  ispf-option1    
   move 'REPLACE '         to  ispf-option2
   CALL 'ISPLINK' USING ispf-service ispf-table-name
   ispf-name-list ispf-key-list ispf-option1 ispf-option2.
 

Again, I'm not a COBOL person.

Re: External functions in Rexx

PostPosted: Wed Oct 30, 2019 10:03 pm
by willy jensen
This works:
       IDENTIFICATION DIVISION.                                  
         PROGRAM-ID.  COBTISP1.                                    
        Data Division.                                            
         WORKING-STORAGE SECTION.                                  
          01          ispf-service    pic  a(08).                  
          01          ispf-key-list   pic  a(60).                  
          01          ispf-name-list  pic  a(60).                  
          01          ispf-table-name pic  a(08).                  
          01          ispf-option1    pic  a(08).                  
          01          ispf-option2    pic  a(08).                  
                                                                   
        PROCEDURE DIVISION.                                        
            move 'TBCREATE'         to  ispf-service              
            move 'TESTTBL1'         to  ispf-table-name            
            move spaces             to  ispf-name-list            
            move '(VAR1 VAR2)'      to  ispf-name-list            
            move spaces             to  ispf-key-list              
            move 'NOWRITE '         to  ispf-option1              
            move 'REPLACE '         to  ispf-option2              
            CALL 'ISPLINK' USING ispf-service ispf-table-name      
            ispf-key-list ispf-name-list ispf-option1 ispf-option2.
                                                                   
            STOP RUN.                                              

REXX script:
address ispexec                                    
 "control errors return"                            
 "tbend   TESTTBL1"                                
 "Select pgm(COBTISP1)"                            
 say 'pgm rc' rc                                    
 "tbquery TESTTBL1 names(nl) keys(kl) rownum(rn)"  
 say 'query rc' rc                                  
 say 'names' nl 'keys' kl 'rows' rn                
 "tbend   TESTTBL1"                                

Shows
TBCREATE                            
(VAR1 VAR2)                          
                                     
pgm rc 0                            
query rc 0                          
names (VAR1 VAR2) keys  rows 00000000

Re: External functions in Rexx

PostPosted: Tue Nov 05, 2019 4:32 pm
by LasseH
That's definitly another way of doing it. I was using "Model" in ISPF and there they don't mention this way at all.
Tnxs