Robert,
You can use the COPY statement to get the names you want. For example when
you code the following;

COPY DDR-format-name

You will get the alias names for the fields, with some characters replaced
(see the manual quoted below). The underscore ( _ ) will be translated to a
dash ( - ) is the one I used the most. Sometimes I use the PREFIX BY phrase
if the file specs were used more than one place in the program. For
example, if I were to use the COPY statement to hold values in working
storage I might do the following;

COPY DDR-format-name prefix by "WS-"

This will put a WS- on the front of each field from that format. I use this
to hold an entire record in working storage to compare prior to update in
some cases. The field definitions would be prefixed by "FD-" or by nothing,
depending on your needs.

HTH

Jim

From the V5R4 COBOL Reference manual

"The DDR Option: The DDR option or the SUBSTITUTE option does everything
that the DD option does. It also replaces the invalid COBOL characters @, #,
$, and _ in a field name (or alias name, if applicable) with the
corresponding valid COBOL characters A, N, D, and -. As well, it removes
underscores from the end of a field name."


On Tue, Jun 24, 2008 at 9:35 AM, Robert Munday <rwmunday@xxxxxxxxxxxxx>
wrote:

Greetings from South Carolina.

I am adding a file to a program and thought it would be great if I could
define my file with the external fields defined with ALIAS data names. I
was trying to avoid creating needless duplicate input specs and thought I
could rely on the external definitions. That appears not to be working out
for me.

Are the fields in an externally-described file good for anything inside my
COBOL program? Will I end up having to create input specs and copy my
format into those specs? Surely there must be an easier way.

I'd like to solve this one and turn in a completed program before my gig
ends on Friday.



Thanks,


Robert Munday
Munday Software Consultants
Montgomery, AL
on assignment in Columbia, SC
soon to be somewhere else...


This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2026 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.