Highlighted
Honored Contributor.
Honored Contributor.
544 views

What is value of uninitialized item in working storage?

Jump to solution

Micro Focus Visual COBOL.

An item in working storage is described as PIC X type but no VALUE clause, as follows:

       WORKING-STORAGE.

           01  WORK-ITEM       PIC X(10).

In this example, when program loads, does this item have an initial value of spaces?  ... or is it "undefined"?

(Assume default environment,  should environment variables affect the answer).

Also, if there is a documentation reference, please provide a link.

Thanks!

 

 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

RE: What is value of uninitialized item in working storage?

Jump to solution
There are two compiler directives you can use:

DEFAULTBYTE and INIT-BY-TYPE

Here are links to the documentation:

www.microfocus.com/.../HRCDRHCDIR2L.html

www.microfocus.com/.../GUID-FC6FFD2F-F9BA-49A5-9CF6-EDE1353A36D9.html

The default initialisation for WORKING-STORAGE items is spaces.

View solution in original post

2 Replies
Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

RE: What is value of uninitialized item in working storage?

Jump to solution
There are two compiler directives you can use:

DEFAULTBYTE and INIT-BY-TYPE

Here are links to the documentation:

www.microfocus.com/.../HRCDRHCDIR2L.html

www.microfocus.com/.../GUID-FC6FFD2F-F9BA-49A5-9CF6-EDE1353A36D9.html

The default initialisation for WORKING-STORAGE items is spaces.

View solution in original post

Highlighted
Honored Contributor.
Honored Contributor.

RE: What is value of uninitialized item in working storage?

Jump to solution
Thank You !!!
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.