External functions in Rexx



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Re: External functions in Rexx

Postby willy jensen » Mon Oct 28, 2019 9:59 pm

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

Re: External functions in Rexx

Postby willy jensen » Wed Oct 30, 2019 10:03 pm

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

These users thanked the author willy jensen for the post:
LasseH (Tue Nov 05, 2019 4:33 pm)
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Re: External functions in Rexx

Postby LasseH » Tue Nov 05, 2019 4:32 pm

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
LasseH
 
Posts: 70
Joined: Mon Nov 08, 2010 2:51 pm
Has thanked: 7 times
Been thanked: 1 time

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post