How to use SRAM with dynamic calls from VISION:Report.
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 SRAM CALL entries:
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:Report can then be used with SRAM:
OPTION IFNUM=YES,SPIE=NO,TRACECT=1
EQU FILLER WST
EQU SRAMPARM (56)
EQU SRAMPARM
EQU DDNAME (8) C'SRAMWORK'
EQU CORE (4)-B X'00040000'
EQU RECLEN (2)-B X'0160'
EQU MODESRT (2)-B X'FFFF'
EQU KEYFLD (40) C'(4,7,C,A,11,26,C,A)'
EQU RECORD (352)
EQU RECORD
EQU FINDEOF (2)-B
EQU FILLER (1)
EQU SORT-KEY (7)
CALL SRTOPEN SRAMPARM /* OPEN SRAMWORK FILE
100
GET INF ATEND 200
MOVE INF1-352 TO RECORD
MOVE RECORD TO PRT1 X'0064'
CALL SRTFILL SRAMPARM RECORD /* FILL SRAMWORK WITH A RECORD
GOTO 100
200
MOVE MODESRT TO FINDEOF
MOVE HIGH-VALUES TO SORT-KEY /* HIGH-VALUES TO SORT KEY
CALL SRTFILL SRAMPARM RECORD /* FILL SRAMWORK WITH EOF REC
300
CALL SRTGETR SRAMPARM RECORD /* GET SRAMWORK SORTED RECORD
IF FINDEOF IS NOT EQ MODESRT
GOTO 300
ENDIF
CALL SRTCLSE SRAMPARM /* CLOSE SRAMWORK FILE
400
CALL SRTROPN SRAMPARM /* REOPEN SRAMWORK FILE
MOVE C'SORTED' TO PRT1
500
CALL SRTGETR SRAMPARM RECORD /* GET SRAMWORK SORTED RECORD
IF FINDEOF IS NOT EQ MODESRT
MOVE RECORD TO PRT1 X'0064'
GOTO 500
ENDIF
CALL SRTCLSE SRAMPARM /* CLOSE SRAMWORK FILE