Highlighted
Knowledge Partner
Knowledge Partner
2194 views

Difference displaying a String vs PIC X

Jump to solution

Hi,

I have some texts defined as System.String or String inside Visual COBOL for Visual Studio 2012 and some defined as pic x.

I can not find how to display a variable defined as string using line and column without receiving a compilation error COBCH030. And the display of the pic x is shown in a different color (green) than the display of the string (white)

01 text1 type System.String.
01 thetext pic x(50).
       procedure division.
           set text1 thetext to "Hello World".
           display text1::Trim.
                     
           display thetext line 20 position 20.

Regards,

Juan Manuel Urraburu
Director of Technology @ ProRM & Axtrio
Micro Focus Knowledge Partner
LinkedIn

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Hi Juan,

Currently only format 1 of the display statement is supported if you are using managed data types such as string. If you wish to use the full capabilities of enhanced accept/display statements such as line positioning then you must use COBOL data items defined with the PIC clause.

When I run your example here, both statements are displayed in white. What other compiler directives are you using?

View solution in original post

0 Likes
5 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Hi Juan,

Currently only format 1 of the display statement is supported if you are using managed data types such as string. If you wish to use the full capabilities of enhanced accept/display statements such as line positioning then you must use COBOL data items defined with the PIC clause.

When I run your example here, both statements are displayed in white. What other compiler directives are you using?

View solution in original post

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Thank you Chris!

I have the default installation with no directive and the default Build settings as:

anim cobidy".\bin\Debug\" sourceformat"Variable" warnings"2" max-error"100" ilgen noint iltarget"x86" constant"DEBUG(1)"

Juan Manuel Urraburu
Director of Technology @ ProRM & Axtrio
Micro Focus Knowledge Partner
LinkedIn

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Which product version are you using?

I am testing with 2.2 update 2 and my displays are all in white.

0 Likes
Highlighted
Absent Member.
Absent Member.
I am trying to accomplish the same thing. When I launch a cobol console app, the text is green.
0 Likes
Highlighted
Absent Member.
Absent Member.
running cobol server 2.3
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.