Date: Mon, 4 Mar 2002 10:19:17 -0500
Reply-To: "Elmaache, Hamani" <Hamani.Elmaache@CCRA-ADRC.GC.CA>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Elmaache, Hamani" <Hamani.Elmaache@CCRA-ADRC.GC.CA>
Subject: Re: reading a matrix with character values with SAS/IML
Content-Type: text/plain; charset="iso-8859-1"
Hi Philippe .
run this code to see wnate you wante.
/********************************/
data data;
input Name $2. Color $6. Amount;
cards;
a black 10
a black 15
a red 20
a red 23
a red 27
b black 10
b black 15
b red 23
b red 27
;
run;
proc iml;
use data;
read all var { Amount} into num;
read all var {Name Color} into char;
read all var {Name Color Amount} into char_num;
print num;
print char;
print char_num;
run;
quit;
/********************************/
/********************************/
Barrere
/**********/
-----Original Message-----
From: Philippe Guiblin [mailto:Philippe.Guiblin@ONS.GOV.UK]
Sent: March 4, 2002 9:19 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: reading a matrix with character values with SAS/IML
dear sas users,
Does anyone know how to read a sas-dataset containing both numeric and
character values within sas iml?
I have used the lines below but sas/iml only reads the numeric variables of
the sas-dataset mat1and put it
into mat1.
/*************/
proc iml;
use a.mat1;
read all into mat2;
/*************/
Thanks.
Philippe Guiblin
Office for National Statistics.
For the latest data on the economy and society
consult National Statistics at http://www.statistics.gov.uk
**********************************************************************
Please Note: Incoming and outgoing email messages
are routinely monitored for compliance with our policy
on the use of electronic communications
**********************************************************************
Legal Disclaimer : Any views expressed by
the sender of this message are not necessarily
those of the Office for National Statistics
**********************************************************************