Value clause in File section and Linkage section 
Author Message
 Value clause in File section and Linkage section

The definitive answer is that both OS/VS COBOL and DOS/VS COBOL allowed
VALUE clauses in an FD and in LINKAGE SECTION - as an IBM extension.
HOWEVER, as with the newer COBOLs they were treated as "documentation only".

--
+ +
+   Bill Klein -
         "C" is a nice letter to START the name of your programming language
with
      but I wouldn't want to end up there.

Quote:

>I would like to settle a debate in our shop over the VALUE clause in FD
>and in the Linkage section. We are converting a ton of OSVS COBOL to
>COBOL for MVS. When we compile using the new compiler we get the message
>stating that value clauses (non 88) in FD and LINKAGE are treated as
>comments. There is a school of thought that believes that we should be
>initializing these fields as they may have been set by VALUE in OSVS. I
>don't believe it and think its a waste of time and a distraction for all
>involved. Unfortunately I am a COBOL II type and know that the VALUE
>clause behaves the same as for MVS. However I have never coded for OSVS
>so I am on thin ice as it were and I don't want to get caught with
>rework if we do indeed find that VALUE in FD and LINKAGE actually does
>something in OSVS (although short of esp I can't see how this could be
>done).
>I am having a hard time tracking down documentation to support my
>position. Can anyone suggest where I might get this to display to the
>masses??

>Thanks Al



Sun, 08 Oct 2000 03:00:00 GMT  
 Value clause in File section and Linkage section

I would like to settle a debate in our shop over the VALUE clause in FD
and in the Linkage section. We are converting a ton of OSVS COBOL to
COBOL for MVS. When we compile using the new compiler we get the message
stating that value clauses (non 88) in FD and LINKAGE are treated as
comments. There is a school of thought that believes that we should be
initializing these fields as they may have been set by VALUE in OSVS. I
don't believe it and think its a waste of time and a distraction for all
involved. Unfortunately I am a COBOL II type and know that the VALUE
clause behaves the same as for MVS. However I have never coded for OSVS
so I am on thin ice as it were and I don't want to get caught with
rework if we do indeed find that VALUE in FD and LINKAGE actually does
something in OSVS (although short of esp I can't see how this could be
done).
I am having a hard time tracking down documentation to support my
position. Can anyone suggest where I might get this to display to the
masses??

Thanks Al



Mon, 09 Oct 2000 03:00:00 GMT  
 Value clause in File section and Linkage section

Although I have never coded in OSVS, I would agree
with you.
I have never seen VALUE clauses that worked in
FD's or LINKAGE's
in the dozen or so COBOL's that I have used.  I
have seen COBOL's
that did not make them syntax errors, but even
those are rare.

About the only way that I could see them actually
having an effect
would be if someone did a move from a value
intialized file record
before opening the file.  Once the file is
actually used, then all bets
are off.  As for the LINKGAGE section, how COULD
it have an effect?
Would the first call statement be altered to match
the value or what? Or
perhaps it makes the subroutine work if it is
never used?

It is more likely they were intended as
documentary.



Mon, 09 Oct 2000 03:00:00 GMT  
 Value clause in File section and Linkage section

Quote:

> The definitive answer is that both OS/VS COBOL and DOS/VS COBOL allowed
> VALUE clauses in an FD and in LINKAGE SECTION - as an IBM extension.
> HOWEVER, as with the newer COBOLs they were treated as "documentation only".

I think the question is, however, under OS/VS and DOS/VS did they DO
anything.

In the FD I can't see you getting in trouble on conversion, but in the
Linkage section, I can see some potential problems.  Not likely though.
My opinion is that worrying about it is a waste of time.



Mon, 09 Oct 2000 03:00:00 GMT  
 Value clause in File section and Linkage section

Sorry if my "documentation only" comment wasn't clear.  In the older IBM
COBOLs they did NOTHING.

FYI - the ability to code them in an FD or LINKAGE SECTION is being added
into the next Standard. Again, they will be documentation only - with ONE
exception -  When you use the (new) INITIALIZE to VALUE statement

--
+ +
+   Bill Klein -
         "C" is a nice letter to START the name of your programming language
with
      but I wouldn't want to end up there.

Quote:


>> The definitive answer is that both OS/VS COBOL and DOS/VS COBOL allowed
>> VALUE clauses in an FD and in LINKAGE SECTION - as an IBM extension.
>> HOWEVER, as with the newer COBOLs they were treated as "documentation
only".

>I think the question is, however, under OS/VS and DOS/VS did they DO
>anything.

>In the FD I can't see you getting in trouble on conversion, but in the
>Linkage section, I can see some potential problems.  Not likely though.
>My opinion is that worrying about it is a waste of time.



Mon, 09 Oct 2000 03:00:00 GMT  
 Value clause in File section and Linkage section

Alan,

In OS/VS, the VALUE clause was syntactically in FILE and LINKAGE SECTION
allowed but had NO effect there. So the people thinking to initialize are
wrong. It would be doing work for nothing. If the old code worked, it will
do so under Cobol II, without a VALUE.

The Frog

Quote:

> I would like to settle a debate in our shop over the VALUE clause in FD
> and in the Linkage section. We are converting a ton of OSVS COBOL to
> COBOL for MVS. When we compile using the new compiler we get the message
> stating that value clauses (non 88) in FD and LINKAGE are treated as
> comments. There is a school of thought that believes that we should be
> initializing these fields as they may have been set by VALUE in OSVS.

They are wrong

Quote:
> I don't believe it and think its a waste of time and a distraction for all

> involved.

Indeed

Quote:
> Unfortunately I am a COBOL II type

Don't be ashamed.

Quote:
> and know that the VALUE
> clause behaves the same as for MVS. However I have never coded for OSVS
> so I am on thin ice as it were and I don't want to get caught with
> rework if we do indeed find that VALUE in FD and LINKAGE actually does
> something in OSVS

You won't find that
Quote:
> (although short of esp I can't see how this could be done).
> I am having a hard time tracking down documentation to support my
> position. Can anyone suggest where I might get this to display to the
> masses??

> Thanks Al



Tue, 10 Oct 2000 03:00:00 GMT  
 Value clause in File section and Linkage section

Quote:

> I would like to settle a debate in our shop over the VALUE clause in FD
> and in the Linkage section. We are converting a ton of OSVS COBOL to
> COBOL for MVS. When we compile using the new compiler we get the message
> stating that value clauses (non 88) in FD and LINKAGE are treated as
> comments. There is a school of thought that believes that we should be
> initializing these fields as they may have been set by VALUE in OSVS. I
> don't believe it and think its a waste of time and a distraction for all
> involved. Unfortunately I am a COBOL II type and know that the VALUE
> clause behaves the same as for MVS. However I have never coded for OSVS
> so I am on thin ice as it were and I don't want to get caught with
> rework if we do indeed find that VALUE in FD and LINKAGE actually does
> something in OSVS (although short of esp I can't see how this could be
> done).
> I am having a hard time tracking down documentation to support my
> position. Can anyone suggest where I might get this to display to the
> masses??

OSVS, OSVS-II, MVS all allow 'Value' in the linkage and FD, however, you
cannot initialize them.

You must first establish addressability, they you can freely
'Initialize', 'Move', whatever to them, however, the concept of an
initial value for something that has no storage and no existance is
somewhat meaningless.

Ditto for the FDs (unless you are killing your CPU with move mode I/O),
you can init all you want after the first read (which will set you up
with a system buffer), but you will wipe out ALL of your initialized
values on your first read (which will be a different system buffer for
blocksz!=recordsz), so again, there is no point.

If you are doing move mode I/O (e.g. 'Read Into...' and 'Write From...')
then you may be able to get some effect (of questionable value) on
var-ll records only.  You will be able to set initial values for
everything past the end of the record you just got...but why?  Not only
is this mode of I/O extremly slow, it makes little sense to initialize
values that will not be used in processing, and not be put back in the
file.



Tue, 10 Oct 2000 03:00:00 GMT  
 Value clause in File section and Linkage section

I've worked on some systems that would give you a
level 8 error for trying to initialize an FD area.

Best practice (IMHO) is to consider an FD area,
linkage section, or any un-initialized WS field
as containing trash that was laying about on the
floor of the processor.

However, I also once worked on a system that
moved a dummy (initialized) record from working storage
to the record area of the FD in order to give the
maintenance programmer some idea of what the
records were supposed to look like (this was a
routine that was writing new records to the file).
I liked that.

James.



Wed, 11 Oct 2000 03:00:00 GMT  
 Value clause in File section and Linkage section

As a number of other posters have already noted, the value clause in OS/VS
COBOL does not actually do anything for a File or Linkage section item.

The clause is allowed for non-condition-name items in Linkage and File by a
compatibility extension (page 448 "In the File Section, Linkage Section,
and the Communication Section, the VALUE clause may be specified for
level-88 items, and also for other items.").  As far as anyone has ever
been able to tell it does nothing.  However, the appendix in the manual
does not actually state what will happen, so your OS/VS guys probably think
it is actually doing something, and won't believe whatever you tell them.
Have them run a compile with both a PMAP and a DMAP on a dummy program with
some carefully placed value clauses in File, Working-storage, and Linkage,
and some references to them in Procedure.  When they look at the listed
machine code they will believe you.


"Twenty years of schoolin' and they put you on the day shift."  Bob Dylan



Quote:
> I would like to settle a debate in our shop over the VALUE clause in FD
> and in the Linkage section. We are converting a ton of OSVS COBOL to
> COBOL for MVS. When we compile using the new compiler we get the message
> stating that value clauses (non 88) in FD and LINKAGE are treated as
> comments. There is a school of thought that believes that we should be
> initializing these fields as they may have been set by VALUE in OSVS. I
> don't believe it and think its a waste of time and a distraction for all
> involved. Unfortunately I am a COBOL II type and know that the VALUE
> clause behaves the same as for MVS. However I have never coded for OSVS
> so I am on thin ice as it were and I don't want to get caught with
> rework if we do indeed find that VALUE in FD and LINKAGE actually does
> something in OSVS (although short of esp I can't see how this could be
> done).
> I am having a hard time tracking down documentation to support my
> position. Can anyone suggest where I might get this to display to the
> masses??

> Thanks Al



Fri, 13 Oct 2000 03:00:00 GMT  
 Value clause in File section and Linkage section

Quote:

> I've worked on some systems that would give you a
> level 8 error for trying to initialize an FD area.

> Best practice (IMHO) is to consider an FD area,
> linkage section, or any un-initialized WS field
> as containing trash that was laying about on the
> floor of the processor.

> However, I also once worked on a system that
> moved a dummy (initialized) record from working storage
> to the record area of the FD in order to give the
> maintenance programmer some idea of what the
> records were supposed to look like (this was a
> routine that was writing new records to the file).
> I liked that.

I can see doing that once at the start of the run, but to do it every
time would chew up an unusual number of cycles.  Makes me thing of
something a coworker just found in our production code:

        Program ID. Really-slow-module.
        ...
        1234-do-something.

   ****  Set up the area        

           Initialize real-big-area
           perform do-stuff-with-it

   ****  Clean out the area
           Initialize real-big-area.

        1234-do-something-exit.

and in the calling module:

        perform <for each time through 32 million account iterations>
          perform <for each transaction on those accounts>
                Call really-slow-module
          end-perform
        end-perform

When she ran this thing accross Strobe, it turns out that the two
initialize statements were responsible for 2/3 of the total runtime.
The also caused some severe thrashing (real-big-area is 138,000 bytes).  

It is things like this that make me tend to fall into the "don't
initialize gratuitously" school of thought, though that can byte one as
well, it usually shows up in testing better...



Fri, 13 Oct 2000 03:00:00 GMT  
 Value clause in File section and Linkage section

Quote:
>>I also once worked on a system that
>> moved a dummy (initialized) record from working storage
>> to the record area of the FD in order to give the
>> maintenance programmer some idea of what the
>> records were supposed to look like (this was a
>> routine that was writing new records to the file).
>> I liked that.
>I can see doing that once at the start of the run, but to do it every
>time would chew up an unusual number of cycles.

Yes, I should have been more clear on what I posted.  This was just
done once under the INITIALIZE paragraph.  But you could look at
the 01  DUMMY-RECORD and see where the very complex MRP
program was going as it was creating build-or-buy records.  Although
a paragraph in the PROCEDURE DIVISION called BUILD-STATIC-FIELDS
would have worked just as well, I suppose.

Regards,
James Jones.



Fri, 13 Oct 2000 03:00:00 GMT  
 Value clause in File section and Linkage section

I just thought that I would start a new thread and explain why the draft
Standard is being expanded to allow what has always been allowed by the IBM
mainframe compilers, i.e. VALUE clauses  (that do not impact the initial
value of data items) in the LINKAGE and FILE sections.

What this allows is a COPY statement of all the elementary items under a
RECORD.   For example

    FD ...
    01  FD-My-file.
          Copy  Common-File-Description.
    Working-Storage.
    01  WS-My-file.
          Copy  Common-File-Description.
     Linkage Section.
     01  LS-My-File.
          Copy  Common-File-Description.

Then by using qualification, you can refer to each of the fields in the
common record description easily in the Procedure Division *and* the
Working-Storage version *will* do field initialization of the individual
fields based on their VALUE clause.

This "feature" does also support the use of CORRESPONDING (Move, Add, etc)
*if* you think that is a good thing.  I won't get into the argument of
whether it is good or bad - but by using the same COPY member it is (at
least) less error prone than coding the records in separate places.



Fri, 13 Oct 2000 03:00:00 GMT  
 Value clause in File section and Linkage section

Thanks All for the imput.

Al

On Thu, 23 Apr 1998 02:15:31 GMT, Alan Howatt

Quote:

>I would like to settle a debate in our shop over the VALUE clause in FD
>and in the Linkage section. We are converting a ton of OSVS COBOL to
>COBOL for MVS. When we compile using the new compiler we get the message
>stating that value clauses (non 88) in FD and LINKAGE are treated as
>comments. There is a school of thought that believes that we should be
>initializing these fields as they may have been set by VALUE in OSVS. I
>don't believe it and think its a waste of time and a distraction for all
>involved. Unfortunately I am a COBOL II type and know that the VALUE
>clause behaves the same as for MVS. However I have never coded for OSVS
>so I am on thin ice as it were and I don't want to get caught with
>rework if we do indeed find that VALUE in FD and LINKAGE actually does
>something in OSVS (although short of esp I can't see how this could be
>done).
>I am having a hard time tracking down documentation to support my
>position. Can anyone suggest where I might get this to display to the
>masses??

>Thanks Al



Sat, 14 Oct 2000 03:00:00 GMT  
 
 [ 18 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Initializing a Linkage Section variable (On OS/390)

2. Linkage Section

3. Max Length of Linkage Section.

4. Linkage Section.....

5. Variable length Params in Linkage section

6. Passing tables in Linkage Section

7. Linkage section

8. F2K: Allowed Character Values, BIND Outside of Interoperabilty Sections

9. ConfigParser -> Section name through Option value

10. File-Control and File Section for MS-COBOL under CP/M

11. Extract section from a file

12. Delete INI File Section

 

 
Powered by phpBB® Forum Software