Re: initializing working storage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Michael

I can't answer all of your questions, but the simplest way to set group items to low values is with the MOVE statement.

If you want to initialize those elementary items with VALUE clauses and the rest to default values according to their USAGE

then use INITIALIZE group-item TO VALUE THEN TO DEFAULT

 "IS INITIAL PROGRAM" is used to to ensure the program is reset to its initial state each time it is called.

Robert

On 29/09/2021 22:00, Michael Potter wrote:
Hi All,

I am porting COBOL/CICS code on iSeries to GnuCOBOL/OpenKicks on Linux.

What I am finding is that COBOL on iSeries is initializing working storage differently than GnuCOBOL on Linux.

I have not pinned down exactly what is happening but before I try to write some test programs I would like to come up with the list of compile options that control how memory is initialized in GnuCOBOL.

One of the members tipped me off to -fdefault-byte=0; that looks promising.

here are my questions/requests.

1.
What exactly is defaultbyte setting and when does it set it?

here is my guess...

Default byte will set each variable in working storage that does not have a VALUE clause.  VALUE clauses will continue to be set to the stated value.  The default byte will be set each time the program is called even if it is called multiple times.

When there is a conflict caused by redefines the first definition will take precedence.

2.
What other options can help me initialize the memory?

3.
What does "IS INITIAL PROGRAM" do in GnuCOBOL?  When I turned it on to see what it did the program core dumped and I just turned it off.

4.
Because OpenKicks has a preprocessor I could add in INITIALIZE statement to the code before GnuCOBOL compiles it.

would this work:
INITIALIZE SOME-01-LEVEL ALL to LOW-VALUES THEN TO DEFAULT.







[Index of Archives]     [Gcc Help]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Info]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux