DATA Step, Macro, Functions and more

Doubt in List Input

Reply
Occasional Contributor
Posts: 16

Doubt in List Input

Hi,
In chapter 18 of SAS certi book(List Input ) says that ampersand (&) is used to read character values that contains embedded blanks.

For Below program , In value of city(2nd row) there is space between New and Delhi and I'm reading this value without giving '&' and it is being read correctly.
How is this possible ?

DATA INPUT;
INFILE DATALINES MISSOVER DLM=',*' DSD;
LENGTH CITY $9.
JOB $10.;
INPUT FNAME $
LNAME $
AGE
CITY
JOB $;
PUT _ALL_;
DATALINES;
MANISH,AWASTHI*24*PUNE,SFTWR
VIVEK,CHOPRA,*NEW DELHI,CONSULTANT
:


PROC PRINT DATA=INPUT NOOBS;

Output
CITY JOB FNAME LNAME AGE

PUNE SFTWR MANISH AWASTHI 24
NEW DELHI CONSULTANT VIVEK CHOPRA .

.
Thanx

Manish
Super Contributor
Posts: 474

Re: Doubt in List Input

Hello.

That's because you are using the DLM=',*' option.

Everything gets separated by the delimiters (, or *) rather than by blanks.

See more on this here:
http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001066690.htm

Cheers from Portugal.

Daniel Santos @ www.cgd.pt
Super Contributor
Super Contributor
Posts: 3,174

Re: Doubt in List Input

You have altered the SAS-default DLM= which would be a blank character.

Scott Barry
SBBWorks, Inc.
Super Contributor
Super Contributor
Posts: 3,174

Re: Doubt in List Input

Sorry - missed Daniel's fine reply.

Scott
Ask a Question
Discussion stats
  • 3 replies
  • 119 views
  • 0 likes
  • 3 in conversation