For CGI applications, manipulating an environment variable from a Web application causes no problem on the system because one environment variable block is allocated to each process and a CGI application runs as a process. For an ISAPI application, however, modifying the contents of an environment variable may influence IIS or other applications because an ISAPI application runs as multiple threads in the process of IIS itself. Additionally, an application may not run as expected because the contents of an environment variable, when referenced, is not guaranteed to be unchanging. Thus, you need to change a CGI application's section that manipulates an environment variable in order not to use an environment variable, when running under ISAPI.
You need to also be careful of a function that implicitly uses the current folder because the current folder used when an application is invoked is not guaranteed to be fixed. One example is manipulating a file by specifying a relative path from the current folder. Instead of attempting to use this method, you can do as follows:
Description in a CGI application
MOVE "RESPONSE.HTM" TO COBW3-HTML-FILENAME. CALL "COBW3_PUT_HTML" USING COBW3.
Modified description in an ISAPI application
MOVE "C:\COBOL\ISAPI\RESPONSE.HTM" TO COBW3-HTML-FILENAME. CALL "COBW3_PUT_HTML" USING COBW3.
To get a physical path corresponding to the virtual directory, use COBW3_GET_REQUEST_INFO.
Description in a CGI application
MOVE "RESPONSE.HTM" TO COBW3-HTML-FILENAME. CALL "COBW3_PUT_HTML" USING COBW3.
Modified description in an ISAPI application
SET COBW3-PHYSICALPATH TO TRUE. CALL "COBW3_GET_REQUEST_INFO" USING COBW3. MOVE COBW3-REQUEST-INFO TO COBW3-HTML-FILENAME. MOVE "\RESPONSE.HTM" TO COBW3-HTML-FILENAME(COBW3-REQUEST-INFO-LENGTH + 1:13). CALL "COBW3_PUT_HTML" USING COBW3.
In relation to the above description, be careful of specifying a file in the run-time initialization file (COBOL85.CBR). For a CGI application, you can specify both absolute and relative paths. For an ISAPI application, you can specify only an absolute path. Since no alternative method is provided, modify the run-time initialization file so that it uses only absolute paths.
COBOL85.CBR in a CGI application
[program-name] access-name=SEQFILE.DAT
Modified COBOL85.CBR in an ISAPI application
[program-name] access-name=C:\COBOL\ISAPI\SEQFILE.DAT