For Programmers: Free Programming Magazines  


Home > Archive > Cobol > October 2005 > Re: COPY statement









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: COPY statement
Mike

2005-09-29, 6:55 pm


John Culleton wrote:
> Richard wrote:
>
>
> As a side note, you don't really need to change the field names. You can
> either have just a single instance of the record layout in WORKING-STORAGE
> shared by all files or you can limit your copybook to the 02 etc. lines.
> So you can then have:
>
> 01 FIRST-RECORD-LAYOUT.
> COPY MYLAYOUT.
> 01 SECOND-RECORD-LAYOUT.
> COPY MYLAYOUT.
>
> When you need to process these record layouts you can use qualified field
> names such as
> NUMBER-FIELD OF FIRST-RECORD-LAYOUT
> or
> NUMBER-FIELD OF SECOND-RECORD-LAYOUT etc.
>
> MOVE CORRESPONDING makes use of identical field names in interesting ways as
> well.


I can't tell you how intensely I dislike the use of qualified field
names. It gets to be rather boring very soon and totally offsets the
small benefit of MOVE CORRESPONDING. But that is just me and I'm by no
means the most able COBOL coder in the world.

2005-09-30, 3:55 am

In article <1128008019.578495.151410@z14g2000cwz.googlegroups.com>,
Mike <MPBrede@gmail.com> wrote:
>
>John Culleton wrote:


[snip]

>
>I can't tell you how intensely I dislike the use of qualified field
>names. It gets to be rather boring very soon and totally offsets the
>small benefit of MOVE CORRESPONDING.


I find that I have similar tastes. I would much rather code/read

MOVE REC01-LAYOUT-NUMFLD TO REC02-LAYOUT-NUMFLD

.... than ...

MOVE NUMFLD OF REC01-LAYOUT TO NUMFLD OF REC02-LAYOUT

.... as well. MOVE CORR is something that I use with caution and only when
there is ample precedent in the environment for it; I've rarely introduced
it to a site where it isn't already common.

DD

Clark Morris

2005-09-30, 6:55 pm

On Fri, 30 Sep 2005 06:45:11 +0000 (UTC), docdwarf@panix.com () wrote:

>In article <1128008019.578495.151410@z14g2000cwz.googlegroups.com>,
>Mike <MPBrede@gmail.com> wrote:
>
>[snip]
>
>
>I find that I have similar tastes. I would much rather code/read
>
>MOVE REC01-LAYOUT-NUMFLD TO REC02-LAYOUT-NUMFLD
>
>... than ...
>
>MOVE NUMFLD OF REC01-LAYOUT TO NUMFLD OF REC02-LAYOUT
>
>... as well. MOVE CORR is something that I use with caution and only when
>there is ample precedent in the environment for it; I've rarely introduced
>it to a site where it isn't already common.
>
>DD


I too detest the OF construction but consider the existence of
multiple record descriptions for the same record a worse evil. COPY
REPLACING LEADING in the 2002 standard is a partial solution. My
preference for C style qualification syntax has received mixed
reviews.

2005-09-30, 9:55 pm

In article <m2jqj1tu50nf61dif3cmki1vgqmfo464it@4ax.com>,
Clark Morris <cfmtech@istar.ca> wrote:
>On Fri, 30 Sep 2005 06:45:11 +0000 (UTC), docdwarf@panix.com () wrote:
>
>
>I too detest the OF construction but consider the existence of
>multiple record descriptions for the same record a worse evil.


I'm not sure what there is written here which requires 'multiple record
descriptions for the same record'; what I had in mind when I gave the
examples above was along the lines of

MOVE MSTRFIL-EMP-BDATE TO OPUTFIL-EMP-BDATE

.... where the MSTRFIL layout is... well, an employee master file record
layout and the OPUTFIL layout is something, entire... say, a record in a
file that gets sent out for a credit-check.

DD
Clark Morris

2005-10-01, 6:55 pm

On Sat, 1 Oct 2005 01:36:43 +0000 (UTC), docdwarf@panix.com () wrote:

>In article <m2jqj1tu50nf61dif3cmki1vgqmfo464it@4ax.com>,
>Clark Morris <cfmtech@istar.ca> wrote:
>
>I'm not sure what there is written here which requires 'multiple record
>descriptions for the same record'; what I had in mind when I gave the
>examples above was along the lines of
>
>MOVE MSTRFIL-EMP-BDATE TO OPUTFIL-EMP-BDATE
>
>... where the MSTRFIL layout is... well, an employee master file record
>layout and the OPUTFIL layout is something, entire... say, a record in a
>file that gets sent out for a credit-check.


I was referring to using the different iterations of the same
description to describe the master file and internal work area(s) or
the input and output versions of the same record for the few instances
left where a sequential file is updated in batch.
>
>DD

2005-10-02, 3:55 am

In article <4rtsj19h3e1j2pijak74kq67k3kn3ht0uu@4ax.com>,
Clark Morris <cfmtech@istar.ca> wrote:
>On Sat, 1 Oct 2005 01:36:43 +0000 (UTC), docdwarf@panix.com () wrote:
>
>
>I was referring to using the different iterations of the same
>description to describe the master file and internal work area(s) or
>the input and output versions of the same record for the few instances
>left where a sequential file is updated in batch.


Ahhhhh, I see... thanks much for the clarification.

DD

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com