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

TYPEDEF and RENAMES (was Re: Productivity)
"Frank Swarbrick" <Frank.Swarbrick@efirstbank.com> wrote in message
news:50fnlaF1esfutU1@mid.individual.net...
[snip]
> And how about with TYPEDEFs?  I was looking forward to having TYPEDEFs
until
> I realized it would require me to use the 'OF' clause way too often.

It may be possible to avoid using OF (or IN) by using
the 66 RENAMES.

> How about :
> 01  TRANSACTION TYPEDEF.
>     05  ACCT-NBR                   PIC 9(10).
>     05  TYPE                       PIC X.
Change to TYP since TYPE is a reserved word.
>     05  AMOUNT                     PIC S9(9)V99 COMP-3.
>
> 01  PREV-TRAN                      TYPE TRANSACTION.
66 PREV-TRAN-ACCT-NBR RENAMES ACCT-NBR.
66 PREV-TRAN-TYP RENAMES TYP.
66 PREV-TRAN-AMOUNT RENAMES AMOUNT.
> 01  TRAN                           TYPE TRANSACTION.
66 TRAN-ACCT-NBR RENAMES ACCT-NBR.
66 TRAN-TYP RENAMES TYP.
66 TRAN-AMOUNT RENAMES AMOUNT.

Replace the "." separator with "-" in the following.

> IF TRAN.ACCT-NBR = PREV-TRAN.ACCT-NBR
>     CONTINUE
> ELSE
>     PERFORM ACCT-BREAK
>     MOVE TRAN TO PREV.TRAN
>     MOVE ZERO TO TOTAL-TRAN-AMOUNT
> END-IF
> ADD TRAN.AMOUNT TO TOTAL-TRAN-AMOUNT
>
> Just thoughts on what I might do if I were in charge of such things.  :-)

However 66 RENAMES can not be used with entries
subordinate to an OCCURS clause or an 88 condition-name.

TYPEDEFs may be used to maintain consistent USAGE
and PICTURE, yet, with 66 RENAMES, allow most
procedure division statements to avoid the use of OF or IN.

[I checked the above statements using Micro Focus 3.2.24
(where TYPEDEF is an extension) and by reading the FDIS
for COBOL 2002.]




Report this thread to moderator Post Follow-up to this message
Old Post
Rick Smith
01-10-07 12:55 PM


Re: TYPEDEF and RENAMES (was Re: Productivity)
In article <12q9hunqm74td8d@corp.supernews.com>,
Rick Smith <ricksmith@mfi.net> wrote:
>
>"Frank Swarbrick" <Frank.Swarbrick@efirstbank.com> wrote in message
>news:50fnlaF1esfutU1@mid.individual.net...
>[snip] 
>until 
>
>It may be possible to avoid using OF (or IN) by using
>the 66 RENAMES.

Ow OW Ow ow ow ow... one of mine own 'stylistic buttons' has been pushed;
if a 66 RENAMES is required I'd just as soon find another way to do
things.

(Instead of 'another way to do things' I originally wrote 'another
method'... but I'm coming to learn that 'method' may generate certain
technical associations which I do not wish to invoke... errrrr, bring
along.)

DD


Report this thread to moderator Post Follow-up to this message
Old Post

01-10-07 12:55 PM


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 05:32 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.