the output from the following program
DATA TEST;
INFILE datalines ;
INPUT Pname $10.;
datalines;
FABINHO
NABY KEITA
ALISSON
SHAQIRI
;
run;
produces
Obs Pname
1 FABINHO
2 NABY KEITA
3 ALISSON
4 SHAQIRI
However , if i were to read these data from the external files it produces the following
Obs Pname
1 NABY KEITA
2 SHAQIRI
Any ideas how SAS read the data ?
@Dennis_K wrote:
I was testing the behavior of the default option FLOWOVER.
it seems like there is a difference in reading from DATALINES and external file
As I already said in a previous post, datalines are automatically padded to 80 characters, so you don't get an overflow event. That's all.
DATA TEST;
INFILE 'test.txt' ;
INPUT Pname $10.;
run;
DATA TEST;
INFILE 'test.txt' truncover;
INPUT Pname $10.;
run;
and you're done.
I was testing the behavior of the default option FLOWOVER.
it seems like there is a difference in reading from DATALINES and external file
@Dennis_K wrote:
I was testing the behavior of the default option FLOWOVER.
it seems like there is a difference in reading from DATALINES and external file
As I already said in a previous post, datalines are automatically padded to 80 characters, so you don't get an overflow event. That's all.
Cheers
datalines are automatically padded to 80 characters.
Use the truncover option in the infile statement when reading from external files that can have shorter records than the code expects.
DATA TEST;
INFILE 'test.txt' ;
INPUT Pname & $10.;
run;
may be this could work
Regards
Manoj
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 how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.