Hello Everyone,
I have a simple data step that reads in a dataline. However, the output has a weird symbol at the end of every row. It looks like a very narrow and tall rectangle. This causes problems when I try to merge this dataset with another one. Does anyone know how to get rid of this weird symbol? My code and the output dataset are listed below. Not sure if this makes a difference - I run this code directly from Unix.
Thank you for any input anyone may have
data inv_group;
input inv_group $13.;
datalines;
ASC
FHA
FHLMC
FNMA
HCS
PRIVATE
VA
WO
;
run;
To everyone who cares to know,
I tried this code and it worked:
data inv_list1;
set inv_list;
inv_g = compress(inv_group,compress(lowcase(inv_group),'qwertyuiopasdfghjklzxcvbnm1234567890')));
drop inv_group;
rename inv_g = inv_group;
run;
Kevin,
Was to code possibly written on a PC? One can't tell from the picture you attached, but it is likely a CR or LF character. See if adding an 'infile cards termstr=CRLF;' statement gets rid of the extra character.
Thank you, Arthur. The code was entered from PC (PC SAS).
Where should I fit your suggestions into my code?
This is the code i have and its syntax is not correct. Thank you again!
data inv_list;
infile cards termstr=CRLF;
datalines;
ASC
FHA
FHLMC
FNMA
HCS
PRIVATE
VA
WO
;
run;
To everyone who cares to know,
I tried this code and it worked:
data inv_list1;
set inv_list;
inv_g = compress(inv_group,compress(lowcase(inv_group),'qwertyuiopasdfghjklzxcvbnm1234567890')));
drop inv_group;
rename inv_g = inv_group;
run;
I'm curious how "the code that worked" has been set as the Correct Answer to your original question?
termstr was added to the infile statement as of SAS 9.2 Which version are you using?
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.