× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Rick,

Yes there is a *LIKE like working storage definition, it is LIKE.  When 
defining working storage variables instead of a normal PIC X(2) or 
whatever, substitute LIKE FIELD or LIKE FIELD OF QUALIFIER:

        01  ws-variable1      LIKE FIELD1.
        01  ws-variable2      LIKE FIELD2 OF MASTERREC.

I think 
        FIELD1 RENAMES FIELD2  will replace all instances of field2 with 
field1.  

REDEFINES is a way to look at a variable in alternate ways or with 
alternate formats.  We use REDEFINES to extract portions of fields, 
inspect numeric data stored in alphanumeric fields, or deal with variable 
record formats.

        01  ws-var            pic 9(8).
        01  ws-var-red   redefines ws-var.
            05  ws-ccyy       pic 9(4).
            05  ws-mm         pic 9(2).
            05  ws-dd         pic 9(2).

is a common usage, or

        01  ws-var               pic x(80).
        01  ws-rec1      redefines ws-var.
            05  ws-rec1-part1    pic x(10).
            05  ws-rec1-part2    pic 9(5).
            05  ws-rec1-part3    pic 9(5).
            05  ws-rec1-part4    pic x(60).
        01  ws-rec2      redefines ws-var.
            05  ws-rec2-part1    pic 9(5).
            05  ws-rec2-part2    pic 9(5).
            05  ws-rec2-part3    pic x(70).

Hope this helps (and is correct),

Scott

  +-------------------------------------------------------------------------+
  |  Scott Monnig                         Boone County Information Services |
  |  smonnig@mail.coin.missouri.edu       801 East Walnut St. #221          |
  |  573.886.4315                         Columbia MO  65201-4890           |
  +-------------------------------------------------------------------------+


On Thu, 17 Apr 1997, Rick Baird wrote:

> Or, subject could be:  Stupid Cobol,... question.
> 
> Hey all,
> 
> I'm doing some contract work in cobol, and before last month, it had
> been VERY long since I'd even seen a cobol program, let alone changed or
> written one.
> 
> As an RPG pgmr, I've always used the rule of thumb that you should avoid
> hard coding variable definitions in your programs.  Is there a cobol
> working storage keyword equivelent to the *like defn?  
> 
> also, what EXACTLY is the difference between RENAMES and REDEFINES
> keywords?  Maybe I'm just dense, but the manuals aren't much help.
> 
> Thanks much,
> 
> Rick Baird
> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
> * This is the Midrange System Mailing List!  To submit a new message,   *
> * send your mail to "MIDRANGE-L@midrange.com".  To unsubscribe from     *
> * this list send email to MAJORDOMO@midrange.com and specify            *
> * 'unsubscribe MIDRANGE-L' in the body of your message.  Questions      *
> * should be directed to the list owner / operator: david@midrange.com   *
> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
> 
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the Midrange System Mailing List!  To submit a new message,   *
* send your mail to "MIDRANGE-L@midrange.com".  To unsubscribe from     *
* this list send email to MAJORDOMO@midrange.com and specify            *
* 'unsubscribe MIDRANGE-L' in the body of your message.  Questions      *
* should be directed to the list owner / operator: david@midrange.com   *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.