|
Sorry everyone,
Forgot to send to the list...again. See below.
Best regards,
Tim
Tim Kynerd
Computer Programmer/Analyst
ECD/HOPE
4 Old River Place, Suite A
Jackson, MS 39202
P: (601) 944-9308
F: (601) 944-0808
tkynerd@ecd.org
-----Original Message-----
From: Tim Kynerd
Sent: Tuesday, June 10, 2008 3:05 PM
To: 'rmat'
Subject: RE: reading variables enclosed in quotes
I recently solved this exact problem for a project. Here's what I did:
data _null_;
infile '\path\to\my\input\file';
file '\path\to\my\output\file';
input;
if _N_=1 then _infile_ = compress(_infile_,'"');
put _infile_;
run;
You could also use another character variable in the last two statements in the DATA step rather than processing _INFILE_ directly, if you prefer.
Best regards,
Tim
Tim Kynerd
Computer Programmer/Analyst
ECD/HOPE
4 Old River Place, Suite A
Jackson, MS 39202
P: (601) 944-9308
F: (601) 944-0808
tkynerd@ecd.org
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of rmat
Sent: Tuesday, June 10, 2008 2:56 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: reading variables enclosed in quotes
Hi
I am trying to read a text file containing variables enclosed in
quotes like given below. There are space between variables. Can you
please help me to read this data into SAS?
"Name" "Age" "State"
"Smith" "22" "NJ"
"Tom" "44" "CT"
"Shake" "34" "CA"
---
---
---
---
---
Thanks very much, Regi
This transmission is intended only for the use of the addressee and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If you are not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately via e-mail at support@ecd.org.
|