External functions in Rexx

Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS
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: 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:

Code: Select all


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: 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: External functions in Rexx

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

This works:

Code: Select all

       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:

Code: Select all

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

Code: Select all

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

LasseH
Posts: 70
Joined: Mon Nov 08, 2010 2:51 pm
Skillset: ISPF/REXX
Referer: Internet

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


  • Similar Topics
    Replies
    Views
    Last post