DATA Step, Macro, Functions and more

how to read a dot (or fullstop) in text file

Reply
Contributor
Posts: 40

how to read a dot (or fullstop) in text file

Hi,

 

I need help in reading a text file.

My sas program is not reading dot (or fullstop) in character variable. It is coming out as missing value which is blank.

 

sample program.

 

data sample;

input name $  Quantity;

datalines;

ipad 40

.  50

iphone 100

;run;

 

is there any way I can  read dot (.) as it is  and see it in sas dataset.

Thank you

 

 

Super User
Super User
Posts: 7,039

Re: how to read a dot (or fullstop) in text file

[ Edited ]

If you want SAS to not convert the '.' to ' ' then you need to use $CHAR information instead of the $ informat.

 

data sample;
  length name $20 Quantity 8 ;
  informat name $CHAR20. ;
  input name Quantity;
cards4;
ipad 40
.  50
iphone 100
;;;;
Contributor
Posts: 40

Re: how to read a dot (or fullstop) in text file

Thank you. Smiley Happy

Spoiler
 

 

Ask a Question
Discussion stats
  • 2 replies
  • 291 views
  • 1 like
  • 2 in conversation