Date: Mon, 6 May 2002 13:51:24 -0700
Reply-To: prasad.s.ravi@HOUSEHOLD.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Prasad Ravi <prasad.s.ravi@HOUSEHOLD.COM>
Subject: Re: DDE from Excel and embedded blanks
Content-type: text/plain; charset=us-ascii
Also $CHARw. informat reads the character data with blanks
"William W. To: SAS-L@LISTSERV.UGA.EDU
Viergever" cc:
<wwvierg@ATTGLOBA Subject: Re: DDE from Excel and embedded blanks
L.NET>
Sent by: "SAS(r)
Discussion"
<SAS-L@LISTSERV.U
GA.EDU>
05/06/2002 01:39
PM
Please respond to
"William W.
Viergever"
At 04:25 PM 5/6/2002 -0400, kviel wrote:
>Greetings,
>
> I have an Excel spreadsheet with 4 columns of character
variables.
>I would like to use DDE to INFILE this spreadsheet into SAS. The problem
is
>that some columns have embedded blanks (i.e. Registry #). I have tried
two
>methods (formatted input and the & modifier) that do not work (see line
2328
>and 2343, respectively). I could use the SCAN function (line 2329) but I
>was wondering if I have not overlooked something.
Just what are you trying to do? ... extract something from the first var?
....
You given an implied LENGTH for question, but not for the other vars. Fix
that and then use the colon modifier:
e.g.,
input
question : $15.
fieldname : $xx.
value_saved : $yy.
etc. ...
>2326 data _null_;
>2327 infile ssd notab dlm="09"x dsd missover;
>2328 input question $15. fieldname $ value_saved $ edit $;
>2329 q=scan(question,1,"09"x);
>2330 put question= fieldname= / q=;
>2331 stop;
>2332 run;
>
>question=REGISTRY # SYST fieldname=EMID
>q=REGISTRY #
>
>2333
>2334 data _null_;
>2335 infile ssd notab dlm="09"x dsd missover;
>2336 input question $ fieldname $ value_saved $ edit $;
>2337 put question= fieldname=;
>2338 stop;
>2339 run;
>
>question=REGISTRY fieldname=SYSTEMID
>
>2340
>2341 data _null_;
>2342 infile ssd notab dlm="09"x dsd missover;
>2343 input question & $ fieldname $ value_saved $ edit $;
>2344 put question= fieldname=;
>2345 stop;
>2346 run;
>
>question=REGISTRY fieldname=
>
>
>Thanks in advance,
>
>Kevin
>
>
>Kevin Viel
>Georgia Medical Care Foundation
>57 Executive Park South, NE
>suite 200
>Atlanta, GA 30329-2224
------------------------------------------------------------
William W. Viergever Voice : (916) 483-8398
Viergever & Associates Fax : (916) 486-1488
Sacramento, CA 95825 E-mail : wwvierg@attglobal.net
------------------------------------------------------------