Using SRAM With Dynamic Calls with VISION:Results

Document ID : KB000031103
Last Modified Date : 14/02/2018
Show Technical Document Details

CA SRAM can be used with programs, applications, and products that use dynamic calls. 

The calling program is not required to statically linked SRAM's SRAMASCB module for dynamic calls.

All that is required is that the CALL entries be link-edited to the SRAMASCB module as an ALIAS.              

For instance, following CA SRAM  CALL entries:

·         SRTOPEN or CAOPN

·         SRTFILL or CAFIL

·         SRTGETR or CAGET

·         SRTCLSE or CACLS

·         SRTROPN or CAROP

would be linked to SRAMASCB as follows:

//IEWL  EXEC PGM=IEWL,REGION=2048K,                            

//             PARM='MAP,LET,LIST,NCAL'                          

//SYSLIB   DD  DSN=CAI.SRAMLIB,DISP=SHR  

//SYSLMOD  DD  DSN=CAI.SRAMLIB,DISP=SHR  

//SYSLIN   DD  *                                                 

INCLUDE SYSLIB(SRAMASCB)                                      

ALIAS    SRTOPEN                                              

ALIAS    SRTFILL                                              

ALIAS    SRTGETR                                              

ALIAS    SRTCLSE 

ALIAS    SRTROPN                                             

NAME SRAMASCB(R)                                              

//SYSUT1   DD  UNIT=SYSDA,SPACE=(CYL,(1,1))          

//SYSPRINT DD  SYSOUT=*

//           

 

VISION:Results can then be used with CA SRAM:   

 

OPTION STRUCTURED2 QLF                                                 

FILE ARFILE STATUS EOFILE                                             

ARREC   352   1                                                       

ACCOUNT   7   4  CH                                                   

BALANCE   5 170  PD 2 A                                               

                                                                       

FILE ININ F 80 DUMMY                                                  

                                                                       

WORKAREA                                                              

SRAMPARM 56   1                                                       

DDNAME    8   1  CH VALUE   'SRAMWORK'                                

CORE      4   9  BI VALUE  X'00040000'                                

RECLEN    2  13  BI VALUE   352                                       

MODESRT   2  15  BI VALUE  X'FFFF'                                    

KEYFLD   40  17  CH VALUE   '(4,7,CH,A,170,5,PD,A)'                    

                                                                       

WORKAREA NAMED SRAM                                                   

RECAREA 352   1                                                       

FINDEOF   2   1  BI                                                   

ACCOUNT   7   4  CH                                                    

NAME     26  11  CH                                                    

BALANCE   5 170  PD 2 A                                                 

                                                                        

CALL SRTOPEN USING SRAMPARM          ; OPEN SRAMWORK FILE              

                                                                        

READINF:                                                               

READ ARFILE                                                            

IF EOFILE EQ 'E'                                                       

  GOTO SORTREC                                                          

ENDIF                                                                  

MOVE ARREC TO RECAREA                                                  

CALL SRTFILL USING SRAMPARM RECAREA  ; FILL SRAMWORK WITH A RECORD     

GOTO READINF                                                           

                                                                        

SORTREC:                                                               

MOVE MODESRT TO FINDEOF                                                 

MOVE X'FFFFFFFFFFFFFF' TO SRAM.ACCOUNT  ; HIGH VALUES TO SORT KEY      

CALL SRTFILL USING SRAMPARM RECAREA  ; FILL SRAMWORK WITH EOF RECORD   

READSORT:                                                             

CALL SRTGETR USING SRAMPARM RECAREA  ; GET SRAMWORK SORTED RECORD     

IF FINDEOF EQ MODESRT                                                 

  CALL SRTCLSE USING SRAMPARM        ; CLOSE SRAMWORK FILE            

  GOTO REOPSORT                                                        

ENDIF                                                                 

LIST SRAM.ACCOUNT SRAM.NAME SRAM.BALANCE                              

GOTO READSORT                                                         

                                                                       

REOPSORT:                                                             

CALL SRTROPN USING SRAMPARM          ; REOPEN SRAMWORK FILE           

                                                                       

READAGN:                                                              

CALL SRTGETR USING SRAMPARM RECAREA  ; GET SRAMWORK SORTED RECORD     

IF FINDEOF EQ MODESRT                                                 

  CALL SRTCLSE USING SRAMPARM        ; CLOSE SRAMWORK FILE            

  STOP                                                                

ENDIF                                                                 

PRINT RECAREA                                                          

GOTO READAGN                                                          

T1 'SRAM EXAMPLE'                               

T1+2  DYLDATE4                                  

T1+90  DYLPAGE