Re: SOURCEFORMAT AND COPY LIBRARY




"Chuck Stevens" <charles.stevens@xxxxxxxxxx> wrote in message
news:d0n6it$1u3d$1@xxxxxxxxxxxxxxxxxxxxxxx
>
> "Russell" <rws0203nospam@xxxxxxxxxxx> wrote in message
> news:Xns9614859EB4A3rws0203comcastnet@xxxxxxxxxxxxxxxxx
>> "William M. Klein" <wmklein@xxxxxxxxxxxxxxxxx> wrote in
>> news:mfqXd.4498720$f47.804910@xxxxxxxxxxxxxxxxx:
>>
>> > Russell,
>> > The rules that you describe are useful for source code that needs to
>> > be
>> > "valid" for BOTH an '85 (fixed form reference format only) and an '02
>> > Compiler (either fixed form or free form reference format).
>> >
>> > If, on the other hand, one is creating source code that will be valid
>> > for fixed or free form reference format BUT only for compilers that
>> > support the '02 Standard's source code (not extensions to the '85
>> > Standard), then the follow rules work:
>> >
>> > 1) leave columns 1-7 blank (spaces)
>> > 2) do not have source code past the R-margin (defined by this
>> > implementer) for fixed form reference format
>> > 3) Use *> to indicate comment lines (starting in column 7 or later)
>> > 4) Use >>D to indicate debugging lines
>> > 5) Use >>PAGE directive (instead of "/" in column 7)
>> >
>> > Source code following the above rules WILL compile successfully in
>> > either fixed or free form reference format - for any compiler
>> > supporting the '02 Standards rules (whether they do or don't support
>> > the rest of that Standard)
>> >
>>
>> It always helps to ask someone that knows what they are talking
>> about. I wonder if anyone actually needs to have this level of
>> compatibility between radically different compilers.
>>
>> The reason that I thought of this would be someone that wants to
>> start using free form cobol in a large system. It would be quite some
>> time before you get around to converting ALL of the programs to freeform,
>> and until you do, the copys are going to need to useable in both fixed
>> and free form.
>>
>> The solution that puts a compiler directive at the top of each copy
>> setting fixed format, and another directive at the end setting free form
>> is obviously not going to work for the programs that have not been
>> converted to freeform yet.
>>
>> And who wants TWO sets of copys.
>>
>> I suppose that you could use conditional compiles ($IF) and a
>> constant to handle this problem, assuming that your compiler has this
>> capability. I have done that sort of thing to try and add an additional
>> working storage copy to multiple programs without editing them, when a
>> change to a commonly used procedure copy requires the new copy file.
>
> Russel, I think the standard covers this.
>
> The default reference format for library text is the format that was in
> effect for the COPY statement. A SOURCE FORMAT directive that is the first
> line of library text can be in either fixed form or free form. And if a
> SOURCE FORMAT directive is in library text, it is in effect until either
> another SOURCE FORMAT directive is encountered *in the library text*, or the
> end of the library text is reached. (ISO/IEC 1989:2002 page 57, 7.2.18.2,
> SOURCE FORMAT directive, general rules.) .
>
> -Chuck Stevens


Has anybody actually DONE a large-system conversion from fixed to free-format?
I'd imagine the benefits of freeformat would be tremendous over the tedious
editing always required in fixed, but I'm just guessing. Any real experience
with this issue out there? Thanks -Fred




.



Relevant Pages

  • Re: SOURCEFORMAT AND COPY LIBRARY
    ... (either fixed form or free form reference format). ... If, on the other hand, one is creating source code that will be valid for fixed ... I am not sure that I want to bet what just ANY compiler would do ...
    (comp.lang.cobol)
  • Re: Absoft Fortran Problem
    ... I use absoft fortran compiler to compile this code which was written ... There is no advantage in trying to make part of the source code partly compatible with f90 free form, if you don't change all comments to free form. ... Most compilers will accept combinations of f77 fixed form and f90 free form comments, such as you have here, but there is no guarantee. ...
    (comp.lang.fortran)
  • Re: SOURCEFORMAT AND COPY LIBRARY
    ... > Compiler (either fixed form or free form reference format). ... > If, on the other hand, one is creating source code that will be valid ...
    (comp.lang.cobol)
  • Re: SOURCEFORMAT AND COPY LIBRARY
    ... The '02 Standard also makes portable conditional ... >> Compiler (either fixed form or free form reference format). ...
    (comp.lang.cobol)
  • Re: too long function
    ... then copy and paste the answer in fortran. ... compiler thinks you are using fixed form instead of free. ... to tell the compiler that you are using free form. ... you usually can't use an & for continuation in the middle of a name ...
    (comp.lang.fortran)