If an external text file is not structured in a way that lets you detect missing values, return to sender. As soon as you have two numerics in succession, there is no way for you to detect which one shall be set to missing. I know of no software that would export data in such a stupid way, even MS Excel manages to get that right.
Are you sure you made no mistake when copy/pasting to the data step?
Hi, thanks for reply,
I am trying this way
proc import datafile="C:\file path.txt"
dbms=dlm
out=new data
replace;
delimiter='|';
getnames=yes;
guessinrows=100;
run;
Its working.
@librasantosh wrote:
Hi, thanks for reply,
I am trying this way
proc import datafile="C:\file path.txt"
dbms=dlm
out=new data
replace;
delimiter='|';
getnames=yes;
guessinrows=100;
run;
Its working.
Nice.
What you have now (probably without knowing it) is a working data step. proc import creates it, runs it, and writes it to the log. You can copy it from there and adapt it to your needs for fine-tuning.
@librasantosh wrote:
Yes my data is in txt file and its not arranged in order. Is there any solution to create dataset without putting '.' for missing values in raw data. Data values are not arranged in neatly defined columns, but are separated by at least one space and contain some nonstandard characters, such as the dollar sign ($)
You need to be aware that this forum when pasting into the main message windows will often reformat text with removing blanks one of the most common elements. So post code and data into a code box using the {i} menu icon at the top of the message box to prevent that.
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.