Date: Tue, 18 Apr 2000 06:09:12 GMT
Reply-To: sashole@mediaone.net
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Paul Dorfman <paul_dorfman@HOTMAIL.COM>
Subject: Re: How to declare an array??
Content-Type: text/plain; format=flowed
Baskaran,
Unfortunately, SAS Institute has not responded favorably to the numerous
requests of introducing structures in SAS similar to those available in
Cobol, PL/I, or C. Emulating them in SAS usually entails storing the entire
element as a character item and using SUBSTR function and whatever informat
is appropriate to make the information stored as a sequence of bytes
intelligible to SAS. In your case, the INPUT statement may look like
input @2 (ta1-ta10) ($char17.);
array ta ta1-ta10;
Now, to extract the numeric information from the array elements, one would
have to manipulate the array further:
array ele1(1:10) _temporary_;
array ele2(1:10) $1 _temporary_;
do over ta;
ele1(_i_) = input(ta(_i_),s370fzdu16.2);
ele2(_i_) = substr(ta(_i_), 17);
end;
If you want _all_ variables thus created to be written out as SAS variables,
then delete the word _temporary_ from the array declaration.
Kind regards,
==================
Paul M. Dorfman
jacksonville, Fl
==================
>From: Baskaran Subramaniam <subramaniam.baskaran@DB.COM>
>Reply-To: subramaniam.baskaran@DB.COM
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: How to declare an array??
>Date: Tue, 18 Apr 2000 11:04:25 +0530
>
>Hi List users
>
>We are working on SAS Release 6.09 TS460 on an OS/390 mainframe.
>We have to use an array inside an input structure.
>I have given the equivalent i/p structure declaration in COBOL.
>
>In COBOL
>
>01 DCL-SATZ.
> 05 FILLER PIC X(01).
> 05 TEST-ARRAY OCCURS 10.
> 10 ELE1 PIC 9(14)v99.
> 10 ELE2 PIC X(01).
>
>
>Could somebody suggest the equivalent declaration in SAS and the usage
>inside a
>program..
>
>
>TIA
>Baskar
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com