[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference clt::cobol

Title:VAX/DEC COBOL
Notice:Kit,doc,performance talk info-->DIR/KEY=KIT or DOC or PERF_TALK
Moderator:PACKED::BRAFFITT
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3250
Total number of notes:13077

3207.0. "how to do the align with padding?" by TPOVC::MOBBYLIN (Network Navigator) Thu Feb 27 1997 14:07

    Hi,
    
    from 3101.1, it needs to use the compilier with -align padding to
    improve the performance. When the index file comes from VAX, how
    can it do the convertion? Assume that use the fdl utility and convert
    command to do it. How to do edit/fdl to modify the padding function?
    Does this mean it is suitable for any length of file, with mixed many
    length of field, say pic 9(6), x(2), 9(11)...
    
    regards,
    Mobby.
    
T.RTitleUserPersonal
Name
DateLines
3207.1in DEC COBOL V2.3 User Manual Chapter 16PACKED::MASLANKAThu Feb 27 1997 21:192
In the DEC COBOL User Manual for V2.3, See Chapter 16, Managing Memory
and Data Access. Specific sections to see are 16.3 and 16.4.
3207.2email correspondence about this inquiryPACKED::MASLANKAWed Mar 05 1997 12:00102
From:	PACKED::MASLANKA     "JOHN MASLANKA DTN 381-6040 Office Cube ZKO2-3/M01"  5-MAR-1997 08:57:58.99
To:	TPOVC::MOBBYLIN
CC:	MASLANKA
Subj:	RE: How to do the alignment with padding

Hi,

Initially, I must tell you - please enter all requests for DEC/VAX 
COBOL product support consultations into the COBOL notes file. That 
is where we keep track of what is happening with the various problems 
that Field Specialists report to us. I shall place a copy of this email
into that notes file as a reply to your original note.

About using /alignment=padding and /alignment...

As you know, the COBOL language is byte-oriented, as is suggested in
the various ANSI standards for the COBOL language. However, it does
have some minimal syntax, i.e. SYNCHRONIZED, which produces alignment
of COMPUTATIONAL fields. This is not what /padding=alignment is about,
although the two capabilities can be used in conjunction.

DEC COBOL originally implemented /alignment by itself to allow alignment
of fields according to the natural boundaries required on Alpha systems.
That format did/does not conform to the Alpha Calling Standards, which
were issued subsequently. The primary purpose of /alignment=padding is
to allow DEC COBOL programs to interface properly with other Digital
software under OpenVMS Alpha. However, some products such as DECforms 
used /alignment for their COBOL applications because /alignment=padding 
was not available when they put their products into production.

With regard to your point 1), copied below, you will not see an extra
filler pic x(7) interpolated on you source listing file when you use
/alignment=padding. The 7 bytes of padding will only be visible on your
compiled program's output listing in its map section when you compile
using also the qualifiers /list/map=declared.

About converting an index file from VAX to Alpha - the /alignment=padding
and /alignment are not data dictionaries. They are passive formatting
tools. They will not convert your index file from VAX to Alpha natural
alignment. You have to do the appropriate COBOL programming to get this
done. First, you copy your index file over to your Alpha, which you seem
to have already done. Then, you need two COBOL formats for the file's 
record layout in your conversion program. One will be the original VAX 
file layout (which is still viable on the Alpha). The second will be the 
Alpha Natural format. Its COBOL coding will be the same as the first one. 
However, you must bracket its file record layout coding with the DEC 
COBOL compiler directives *DC SET PADALIGN and *DC END-SET PADALIGN. Then 
you write your program to open both files and then to copy elementary 
field by elementary field from old to new. This will insure that the 
fields are properly placed in the new records when you write them out. 
Please note that DEC COBOL does _not_ support the use of REDEFINES and 
RENAMES with /alignment and /alignment=padding because the byte-orientation 
of the COBOL language makes that impossible. When you compile your program 
with the *DC directives in it you do _not_ use the /alignment=padding 
qualifier on your command line. /Alignment=padding will force all fields 
and records in your program to Alpha natural alignment and padding, and 
you don't want that for a file-reformatting program, as you can see. 
There is a way around this last point, but I don't want to get into the 
complexities of it for this purpose because I don't think it will help 
you to get your work done.

I hope this helps.

John Maslanka
DEC/VAX COBOL Development



From:	TPOVC::MOBBYLIN     "Network Navigator"  5-MAR-1997 04:58:22.74
To:	PACKED::MASLANKA
CC:	MOBBYLIN
Subj:	How to do the alignment with padding

    Hi,

    I had copied the cobol user's manual on hand. My customer tried to
    convert the index file from vax cobol generated into padding index 
    file from alpha OpenVMS. I can't quite understand the manual.

    I try this one.
      1) a cobol to read vax-index write to alpha index file.
         It seems that it doesn't modify the source file and file layout.
         It doesn't put extra filler to meet this padding. For examples,
         for pic x(1), don't put extra filler pic x(7) to meet this
         quadword requirement.
      2) cobol/align=padding padding_program
      3) run padding_program
     

     Does it work right?
     Mobby.

           <<< CLT::DISK$CLT_LIBRARY3:[NOTES$LIBRARY]COBOL.NOTE;1 >>>
                               -< VAX/DEC COBOL >-
================================================================================
Note 3207.1             how to do the align with padding?                 1 of 1
PACKED::MASLANKA                                      2 lines  27-FEB-1997 18:19
                 -< in DEC COBOL V2.3 User Manual Chapter 16 >-
--------------------------------------------------------------------------------
In the DEC COBOL User Manual for V2.3, See Chapter 16, Managing Memory
and Data Access. Specific sections to see are 16.3 and 16.4.