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
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.