Subject: | |
From: | |
Reply To: | |
Date: | Sat, 25 Sep 1999 22:37:43 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
At 12:01 AM -0400 09/25/1999, Arthur Frank <[log in to unmask]> wrote:
> FD INPUT-FILE
> LABEL RECORDS ARE STANDARD.
> 01 INPUT-RECORD.
> 05 KEY-VALUE-IN PIC X(10).
> 05 INPUT-DATA PIC X(128). <-----
>
> FD OUTPUT-FILE
> LABEL RECORDS ARE STANDARD.
> 01 OUTPUT-RECORD.
> 05 KEY-VALUE-OUT PIC X(10).
> 05 KEY-COUNT PIC 9(4).
> 05 OUTPUT-DATA PIC X(128). <-----
>
>I would like the INPUT-DATA and OUTPUT-DATA to be variable size, depending =
>on the size of the input file. I'm sure that this is possible, but I'm =
>pretty new to the language...
>
I don't think there's really any way you can accomplish what you want using the current version of the COBOL standard unless you're willing to utilize an HP extension (the compiler directive $DEFINE):
$DEFINE %DATALENGTH=128#
...
05 INPUT-DATA PIC X(%DATALENGTH).
...
05 OUTPUT-DATA PIC X(%DATALENGTH).
Not that it'll do you any good now, but the next standard includes a data division construct, SAME AS, that should be just the ticket:
...
05 INPUT-DATA PIC X(128).
...
05 OUTPUT-DATA SAME AS INPUT-DATA.
=======================================================================
Bruce Hobbs, CCP, CDP 856 N Monterey St Phone: (626) 570-8028
Partner Alhambra, CA 91801-1574 FAX: (626) 570-9850
Engineered Software E-mail: [log in to unmask]
|
|
|