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.

WORKING-STORAGE SECTION.<br />

COPY COBW3<br />

Chapter 2. Creating Web Applications Using <strong>SAF</strong> <strong>Subroutines</strong> 11<br />

To use <strong>SAF</strong> specific functions, include the <strong>SAF</strong> specific data area.<br />

WORKING-STORAGE SECTION.<br />

COPY COBW3.<br />

COPY COBW3<strong>SAF</strong>. *>Interface with a <strong>SAF</strong> specific subroutine<br />

These libraries (COBW3.cbl and COBW3<strong>SAF</strong>.cbl) are stored in the folder in which<br />

Fujitsu <strong>NetCOBOL</strong> has been installed.<br />

• LINKAGE SECTION<br />

Define a pointer item <strong>for</strong> the interface with NES.<br />

LINKAGE SECTION.<br />

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

PROCEDURE DIVISION<br />

Write the following in order to con<strong>for</strong>m to the calling conventions of NES.<br />

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

<strong>SAF</strong>CTX obtained above is required <strong>for</strong> the <strong>SAF</strong> subroutines to communicate with<br />

NES, so initialize COBW3-CONTEXT as follows.<br />

MOVE LOW-VALUE TO COBW3.<br />

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

To use <strong>SAF</strong> specific functions, initialize COBW3-<strong>SAF</strong>-CONTEXT.<br />

MOVE LOW-VALUE TO COBW3<strong>SAF</strong>.<br />

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

Given the sample settings above, the skeleton of this program would appear as<br />

follows:<br />

IDENTIFICATION DIVISION.<br />

PROGRAM-ID. "<strong>SAF</strong>APL".<br />

ENVIRONMENT DIVISION.<br />

DATA DIVISION.<br />

WORKING-STORAGE SECTION.<br />

COPY COBW3.<br />

* COPY COBW3<strong>SAF</strong>.<br />

LINKAGE SECTION.<br />

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

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

*<br />

MOVE LOW-VALUE TO COBW3.<br />

* MOVE LOW-VALUE TO COBW3<strong>SAF</strong>.<br />

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

* SET COBW3-<strong>SAF</strong>-CONTEXT TO <strong>SAF</strong>CTX<br />

*<br />

* Write the process on demand.<br />

*<br />

EXIT PROGRAM.

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

Saved successfully!

Ooh no, something went wrong!