Highlighted
Absent Member.
Absent Member.
1440 views

Compilation Error

Hello,

I am trying to compile existing Server Express cobol code in Visual Cobol Development hub on Solaris platform. Having issues during compilation.

1. Syntax error. GIVING not allowed.

This is the piece of code which is giving error.

PROCEDURE DIVISION USING KCT-ID-IN, IGN-IND-IN,
WS-CODE-AFK, WS-REDEN-AFK,
SQLCA, ORACA
GIVING WS-RET-CODE.

Any help will be appreciated.

Thank you,

Ramesh

0 Likes
8 Replies
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: Compilation Error

do not use the word giving before ws-ret-code. Fill the ws-ret-code in your subprogram and you will become the result in you calling program!  

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Compilation Error

Hello Greiner,

This piece of code is from sub program itself.

PROCEDURE DIVISION USING KCT-ID-IN, IGN-IND-IN,

WS-CODE-AFK, WS-REDEN-AFK,

SQLCA, ORACA

GIVING WS-RET-CODE.

Thank you,

Ramesh

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Compilation Error

Please raise a support incident with Customer Care as there is definitely a difference in behavior between NX/SX and Visual COBOL for the GIVING and RETURNING phrases.

In NX/SX this was allowed in the default DIALECT"MF" and compiled cleanly. In VC this will give you an error in the default DIALECT:MF". If you specify a different dialect like DIALECT"ISO2002" or DIALECT"ENTCOBOL" then it will compile without an error.

GIVING is actually not documented as being supported in either product for anything but a program prototype but RETURNING should work in a subprogram as well as in a method or function.

Please open an incident and reference my name so that it is redirected to me and I will create a bug report for this behavior.

Thanks.

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: Compilation Error

LINKAGE SECTION.

01  lnk-aera,

     03  kct-id-in           pic ?.

     03  ign-ind-in         pic ?.

     03  ws-code-afk    pic ?.

     03  ws-reden-afk   pic ?.

     03  sqlca               pic ?.

     03  oraca               pic ?.

     03  ws-ret-code     pic ?.

PROCEDURE DIVISION USING KCT-ID-IN IGN-IND-IN WS-CODE-AFK WS-REDEN-AFK SQLCA ORACA WS-RET-CODE.

call 'SUBPRG' using lnk-aera.

SUBPRG.

move return-code to ws-ret-code

exit program.

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Compilation Error

Hi Chris,

2877062 is created and requested to redirect to you.

Thank You,

Ramesh

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: Compilation Error

it's so easy!

How can i help you?

Send a extract from you code from master program and subprogram, i will test it for you!

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: Compilation Error

customer help customer and then we have specialist as Chris, then the Hotline!

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Compilation Error

Yes, as you say the workaround is to not use GIVING and simply pass the parameter in the USING list instead. You could also compile with a different directive such as DIALECT"ISO2002" but I expect that would cause even more problems.

The reason I need to report this is that it is an incompatibility between product versions as the code that is shown above does compile and run cleanly as is in NX/SX even though according to the product docs it probably shouldn't have.

Thanks.

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.