Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
giofil Absent Member.
Absent Member.
886 views

EXTERNAL-FORM CLAUSE

Jump to solution

Let's assume the following situation.

On a web page on site A a cgi-script is started on server B which starts a cobol program named P1 passing parameters; program P1 calls a second program P2.

The program P1, which has been two parameters "field1" and "field2", use a CGI form to have available "field1":

01 Cgi-Form-P1 Is External-Form.
       05 Field1 Pic X(10) Is Identified By "field1".

and the statement: Accept Cgi-Form-P1

Now, "field2" parameter should be used only by the P2 program.

To achieve this I declare a structure as follows:

01 Cgi-Form-P2 Is External-Form.
       05 Field2 Pic X(10) Is Identified By "field2."

and the statement: Accept Cgi-Form-P2

I did some testing and it seems to work but I'm not sure.
I would like to know if this configuration is correct or if it has limitations, and it may cause problems.

Thank you all.

 

P.S. Sorry for my English...

0 Likes
1 Solution

Accepted Solutions
Chuck Edgin Absent Member.
Absent Member.

RE: EXTERNAL-FORM CLAUSE

Jump to solution

Yes, what you are describing will work as you expect.

  • ACCEPT CGI-Form-P1 <-- in program P1
  • program P1 CALLS program P2
  • ACCEPT CGI-Form-P2 <-- in program P2

The ACCEPT'ing of external-form items can be done from any program in the same run unit. For that matter, you could DISPLAY external-form items as well from different programs (again, within the same run unit) and the output would all be channeled by the runtime back to the web server via STDOUT.

View solution in original post

0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

RE: EXTERNAL-FORM CLAUSE

Jump to solution
Is 01 Cgi-Form-P2 in Program P2? I would think not, but wanted to check. If not, you do not need a separate 01 level, but no harm in having one. The values for field1 and field2 are sent at the same time. You shouldn't need a second ACCEPT statement.
01 Cgi-Form-P1 Is External-Form.
05 Field1 Pic X(10) Is Identified By "field1".
05 Field2 Pic X(10) Is Identified By "field2."

Accept Cgi-Form-P1

I would think that Program P1 is the receiver, and receives values for field1 and field2, then P1 call P2 using field2
0 Likes
giofil Absent Member.
Absent Member.

RE: EXTERNAL-FORM CLAUSE

Jump to solution
Yes, CGI-Form-P2 is declared in Program P2. I try to explain.
P1 master program calls a series of subcall P2 P3 P4 .... and each subcall only uses a portion of the parameters that are in Cgi-Form-P1.
Now, the exchange area CGI EXTERNAL-FORM in P1, that is Cgi-Form-P1, has become very wide; it would be convenient to be able to declare in each subcall strictly necessary CGI parameters in order to remove them from the master program P1.
So also there would be the advantage of no longer having to pass these parameters in linkage to subcall P2 P3 P4 ...
Many thanks for the answer.
0 Likes
Chuck Edgin Absent Member.
Absent Member.

RE: EXTERNAL-FORM CLAUSE

Jump to solution

Yes, what you are describing will work as you expect.

  • ACCEPT CGI-Form-P1 <-- in program P1
  • program P1 CALLS program P2
  • ACCEPT CGI-Form-P2 <-- in program P2

The ACCEPT'ing of external-form items can be done from any program in the same run unit. For that matter, you could DISPLAY external-form items as well from different programs (again, within the same run unit) and the output would all be channeled by the runtime back to the web server via STDOUT.

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.