+ Reply to Thread
Results 1 to 2 of 2

Thread: INITIALIZE (Externally described DDS)

  1. #1
    Guest.Visitor Guest

    Default INITIALIZE (Externally described DDS)

    On Thursday, April 08, 1999, 06:06 AM, Kevin G. Bohenek wrote: Can anyone please explain how the function INITIALIZE works? In our CBL & CBLLE programs, we have the following: Initialize EXHMAS-Rec, Move some values in the key, and then writing the record. The COMP and SIGNED numeric fields have a value of HEX '40' not zeros like we expected. There are no redefines and no occurs within the externally described DDS. P.S – The Initialize works when using a copybook or described record within the pgm. The first time I coded a COBOL program on the AS/400, I did the same thing you are doing. The problem is not the INITIALIZE command, but what you are trying to initalize. When a COBOL program uses an external file definition, the FD is defined like this, FD EXHMAS-FILE.

    01 EXHMAS-REC.

    copy DDS-ALL-FORMATS OF EXHMAS ALIAS.

    When this expands out it becomes

    FD EXHMAS-FILE.

    01 EXHMAS-REC.

    05 EXHMAS-RECORD PIC X(length of record).

    05 (first record format defined in external file) REDEFINES EXHMAS-RECORD.

    10 alpha-filed pic x(3).

    10 numeric field pic 9(3).

    05 (second record format defined in external file) REDEFINES EXHMA-RECORD.

    . 10 ....

    A file can have more than one record format. The COBOL compiler creates a 05 level redefine for each record format in the external file. If you INITALIZE the 01 EXHMAS-REC the record will be all hex(40) as the format is one long character record. The redefine contains the format of the fields for the record format. Initalize the 05 redefine not the 01 level. JHicks@SUZ.com

  2. #2
    Guest.Visitor Guest

    Default INITIALIZE (Externally described DDS)

    I have been writing COBOL since 1966, and in my opinion, the example that you have quoted (GO TO paragraph-exit.) is one of the very few valid uses of the GO TO statement. I have seen many examples of terribly complicated code (structured and otherwise) which has been written JUST TO AVOID the GO TO, when it could have been very simply used in this way. As various people have commented, arguments about style will go on forever.

+ Reply to Thread

Similar Threads

  1. pcsws.exe failure to initialize
    By Guest.Visitor in forum General
    Replies: 1
    Last Post: 09-04-2002, 06:56 AM
  2. Tape got initialize by mistake
    By Guest.Visitor in forum General
    Replies: 3
    Last Post: 07-26-2002, 02:29 AM
  3. org.com.CORBA.INITIALIZE
    By Guest.Visitor in forum Programming
    Replies: 0
    Last Post: 07-18-2000, 01:01 PM
  4. initialize *ISO date
    By wjminc in forum Programming
    Replies: 7
    Last Post: 05-10-1999, 11:14 AM
  5. INITIALIZE (on externally described DDS)
    By Guest.Visitor in forum Programming
    Replies: 1
    Last Post: 04-07-1999, 02:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts