22.09.2013 Views

NetCOBOL for SPARC Architecture SAF Subroutines User's Guide

NetCOBOL for SPARC Architecture SAF Subroutines User's Guide

NetCOBOL for SPARC Architecture SAF Subroutines User's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

24 Chapter 3. How to Use <strong>SAF</strong> <strong>Subroutines</strong><br />

Example: Calling COBW3_INIT by the parent program and calling COBW3_FREE by<br />

the child program B.<br />

Parent program<br />

IDENTIFICATION DIVISION.<br />

PROGRAM-ID. "MainProc".<br />

DATA DIVISION.<br />

WORKING-STORAGE SECTION.<br />

COPY COBW3.<br />

LINKAGE SECTION.<br />

01 <strong>SAF</strong>CTX POINTER.<br />

PROCEDURE DIVISION USING <strong>SAF</strong>CTX.<br />

MOVE LOW-VALUE TO COBW3.<br />

MOVE <strong>SAF</strong>CTX TO COBW3-CONTEXT.<br />

CALL "COBW3_INIT" USING COBW3.<br />

:<br />

CALL "B" USING COBW3<br />

*<br />

EXIT PROGRAM.<br />

Child program<br />

IDENTIFICATION DIVISION.<br />

PROGRAM-ID. B.<br />

DATA DIVISION.<br />

LINKAGE SECTION.<br />

COPY COBW3<br />

PROCEDURE DIVISION USING COBW3.<br />

:<br />

CALL "COBW3_FREE" USING COBW3.<br />

EXIT PROGRAM.<br />

Set the Work Environment and Acquire Web Parameter<br />

COBW3_INIT<br />

Set the work environment <strong>for</strong> <strong>SAF</strong> subroutines. Get a Web parameter and set it to<br />

the work area to be used by <strong>SAF</strong> subroutines.<br />

Note: Initialize COBW3 in the interface area with LOW-VALUE be<strong>for</strong>e calling<br />

COBW3_INIT.<br />

Format:<br />

CALL "COBW3_INIT" USING COBW3.<br />

COBW3 Data <strong>for</strong> Call:<br />

•<br />

•<br />

COBW3-CONTEXT [required]<br />

Specify the Linkage Section pointer to the data work area with the <strong>SAF</strong> director.<br />

Do not change the specified value.<br />

COBW3-DMODE [optional]<br />

Specify error message output of <strong>SAF</strong> subroutines.<br />

COBW3-DMODE is valid only when the operation code is ASCII.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!