Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Qualification is matter of COBOL Theology was Re: Dumb Question Time:
Peter E. C. Dashwood wrote:
> Paul,
>
> if you have a large number of these qualified moves it might be worth
> setting a PFK  or keystroke combination with SPF to produce " OF
> A-RECORD" etc. At least that way it's one key depression...

I have wanted to be able to code A-FILE.FIELD-1 instead of FIELD-1 OF
A-FILE for at least 20 - 30 years.  This would extend to include
A-FILE.B-RECORD.C-GROUP.FIELD-1 instead of
FIELD-1 OF C-GROUP OF B-RECORD OF A-FILE.  The notation is consistent
with other languages and unambiguous.  The only case for it not working
is if a site uses pure numeric section and paragraph names, something
still allowed even if it makes no sense.  Since I have never used
qualified paragraph names, I am willing to live with using the "." means
of qualification only for data division items.  COPY REPLACING LEADING
is an improvement that allows us to easily reuse the descriptions where
the field names have a common prefix but at the expense of not being
able to use MOVE CORRESPONDING and ADD CORRESPONDING.

> Of course it is a pain to have to re-program the key for each new
> record...
>
> What about some global edits to change the names to something unique,
> like A-REC-ITEM1, A-REC-ITEM2 etc.? If these are record layouts from
> COPY books you could set this up at the time you COPY them in; REPLACE
> the level number so: COPY A-RECORD REPLACING ' 03 ' BY ' 03 A-REC-'
> etc.
>
> If it isn't a copy book, a quick cut and paste might do the
> trick...(this can be modified to work for a COPY book as well, but it
> is a bit more effort..)
>
>
> 01  A-RECORD.
>     12 ITEM1      PIC ...
>        ...
>     12 ITEM53     PIC ...
>
> Copy the above and paste it as a redefinition...
>
> 01  A-RECORD.
>     12 ITEM1      PIC ...
>        ...
>     12 ITEM53     PIC ...
> 01  FILLER REDEFINES A-RECORD.
>     12 ITEM1      PIC ...
>        ...
>     12 ITEM53     PIC ...
>
> Edit the redefinition...
>
> 01  A-RECORD.
>     12 ITEM1      PIC ...
>        ...
>     12 ITEM53     PIC ...
> 01  FILLER REDEFINES A-RECORD.
>     12 $A-ITEM1      PIC ...
>        ...
>     12 $A-ITEM53     PIC ...
>
> Do the same for the other records...
>
> 01  B-RECORD.
>     12 ITEM1      PIC ...
>        ...
>     12 ITEM53     PIC ...
> 01  FILLER REDEFINES B-RECORD.
>     12 $B-ITEM1      PIC ...
>        ...
>     12 $B-ITEM53     PIC ...
>
> Now make your amendments using the redefined fields without
> qualification...
>
>
> MOVE 'A' to $A-ITEM1
> MOVE 123 TO $C-ITEM23
> MOVE $A-ITEM2 TO $B-ITEM2
> ...
>
> When you are through, run global edits to replace $A with 'A-REC', $B
> with 'B-REC' and so on.
>
> The main advantage of doing this is that any existing qualified
> references will still work OK, and you are gradually 'migrating' the
> programs to the point where they don't require qualification.
>
> The obvious downside is that if the ORIGINAL is modified, the
> REDEFINITION must be also (that's why it isn't such a good idea for
> COPY books, unless you can modify the COPY book original.)
>
> I'm not claiming that any of the above are "elegant" solutions, but
> looking at them may stimulate you to something appropriate for the
> environment you are working in.
>
> Visual Basic has the USING facility almost exactly as you posted.
>
> I agree it would be a useful facility to see in COBOL. These days I
> make sure record layouts are unique, but you are dealing with other
> people's code...
>
> Pete.
>
> "PAUL RAULERSON" <pkraulerson@verizon.net> wrote in message news:<XS5Cc.23
889$a61.17636@nwrddc01.gnilink.net>...
> 








Report this thread to moderator Post Follow-up to this message
Old Post
Clark F. Morris, Jr.
08-27-04 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:56 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.