Date: Tue, 4 Aug 1998 17:23:19 -0700
Reply-To: "Berryhill, Timothy" <TWB2@PGE.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: "Berryhill, Timothy" <TWB2@PGE.COM>
Subject: Re: COBOL Record Layout; ZD vs. Character
Content-Type: text/plain
Mary, The X spec in COBOL means character. It sounds like your second field
just happens to be numeric.
For the general solution, there are several ways to go. 1) There is a macro
available from the SAS web site called COB2SAS. This reads a COBOL data
definition secton and writes a SAS format. I tried to pull out the
translation table from COBOL to SAS from that macro and failed, but the
macro works. 2) The formats and informats sections of the language
reference often list equivalent formats in languages other than SAS for each
SAS format. This can help you form a crude translation table. 3) If you
have a COBOL file layout, the raw data, and a report of the data generated
in COBOL, you can dump the file in hex...
Tim Berryhill - Contract Programmer and General Wizard
TWB2@PGE.COM or http://www.aartwolf.com/twb.html
Frequently at Pacific Gas & Electric Co., San Francisco
The correlation coefficient between their views and
my postings is slightly less than 0
> ----------
> From: Mary Esther Colwell[SMTP:Mary_Esther_Colwell@FFIC.COM]
> Reply To: Mary Esther Colwell
> Sent: Tuesday, August 04, 1998 4:24 PM
> To: SAS-L@UGA.CC.UGA.EDU
> Subject: COBOL Record Layout; ZD vs. Character
>
> (Sorry for the non-SAS question.)
>
> I am trying to decipher a COBOL record
> layout by comparing the layout to a SAS
> input statement. As I have no experience with
> COBOL, please excuse any erroneous statements.
>
> PD data types I can decipher. However, I do
> not know when a element (field) should be read in
> with a character vs. a zoned decimal informat.
>
> For example,
>
> PRIMARY-RU PIC X(03).
>
> is read in with $CHAR3.
>
> while,
>
> NLR-IBNR-CUR-YTD PIC X(04).
>
> is read in with ZD4.
>
>
> The description of these fields does not differ in any
> significant manner (i.e. no data type indicator such as 'COMP-3'
> is present in the field description). Based on the name of the
> field, I can make a reasonable guess concerning the data type
> but I would rather have a more definitive method.
>
> Can anyone help?
>
> Thank you, thank you, thank you!
> E.
>
|