data samp ;
input id date :ddmmyy10. age$ 2.;
cards;
102 12/11/198312
103 12/11/198914
;
run;
whenever i place colon modifier before a informat, it is reading a column larger than specified width in character variables and more than that in numeric... .please clarify how sas intrepets colon modifier..
This is the same only different. SAS is ignoring the width specification on the numeric informat. If you want to read the data properly use formatted input for both date and age. Remove the colon.
This is the same only different. SAS is ignoring the width specification on the numeric informat. If you want to read the data properly use formatted input for both date and age. Remove the colon.
Thanks for clarifying me....i have just one more doubt.....u said that first it reads the data till the delimiter then truncates it...will it read the data into PDV and truncate afterwards? how the processing happens?
In the other example there is truncation because $10 defines the length of the otherwise undeclared character variable. The input statement with :$10. reads until the delimiter is found with is demonstrated by the COLUMN position. Truncation occurs when the character string is stored or written to the PDV (I suppose is a good enough way to describe it).
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.