BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Dennis_K
Obsidian | Level 7

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 ?

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

@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.

View solution in original post

8 REPLIES 8
s_manoj
Quartz | Level 8
Kindly out the code that you have used to read external data

Regards
manoj
Dennis_K
Obsidian | Level 7

DATA TEST;
INFILE 'test.txt' ;
INPUT Pname $10.;
run;

Dennis_K
Obsidian | Level 7

I was testing the behavior of the default option FLOWOVER.

it seems like there is a difference in reading from DATALINES and external file

Kurt_Bremser
Super User

@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.

Kurt_Bremser
Super User

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.

s_manoj
Quartz | Level 8
DATA TEST;
INFILE 'test.txt' ;
INPUT Pname & $10.;
run;

may be this could work

 

 

Regards

Manoj

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 929 views
  • 0 likes
  • 3 in conversation