Skip to main content

Problem:

An ASP file is displayed okay from a Cobol DISPLAY statement except nothing is shown for simple ASP functions, such as current date and time. However, the same ASP file gets displayed properly by IIS server.

[cobol]

working-storage section.

1  OutASPForm is external-form identified by

                                    ASPFileName.

77 ASPFileName                pic x(256) value

         "TestASP.asp".

procedure division.

     display OutASPForm

    stop run.

[TestASP.asp]

<HTML>

<HR width=80% size=4 color="green">

This is a test of ASP showing the date = <%= date() %> and the time = <%= time() %>

<HR width=80% size=4 color="green">

</HTML>

Resolution:

The extended ACCEPT/DISPLAY statements within Net Express are for use with HTML pages only.

The DISPLAY statement simply sends the output to the console of the program which formats it as an HTML Response packet and sends it back to the browser.

There is no interaction with the IIS Web Server.

ASP and pages are handled by an ISAPI add-in of IIS so that when these pages are requested, IIS recognizes the extension and hands them over to the ASP ISAPI program which will process all of the "runat=server" or <�te%> embedded server functions prior to sending the rendered HTML page back to the browser.

So when you display the page from COBOL it is not processed by the ASP ISAPI extension but is instead simply sent as is back to the browser.

Net Express does not support ASP but Net Express 5.0 for .NET does have direct support for ASP.NET.

Old KB# 3927