Help using Base SAS procedures

Strange symbol attached to the end of a column

Accepted Solution Solved
Reply
Regular Contributor
Posts: 173
Accepted Solution

Strange symbol attached to the end of a column

Hello Everyone,

I have a simple data step that reads in a dataline.  However, the output has a weird symbol at the end of every row.  It looks like a very narrow and tall rectangle.  This causes problems when I try to merge this dataset with another one.  Does anyone know how to get rid of this weird symbol?   My code and the output dataset are listed below.  Not sure if this makes a difference - I run this code directly from Unix.

Thank you for any input anyone may have Smiley Happy

data inv_group;

input inv_group $13.;

datalines;

ASC

FHA

FHLMC

FNMA

HCS

PRIVATE

VA

WO

;

run;

sas1.bmp


Accepted Solutions
Solution
‎04-10-2013 04:25 PM
Regular Contributor
Posts: 173

Re: Strange symbol attached to the end of a column

To everyone who cares to know,

I tried this code and it worked:

data inv_list1;

set inv_list;

inv_g = compress(inv_group,compress(lowcase(inv_group),'qwertyuiopasdfghjklzxcvbnm1234567890')));

drop inv_group;

rename inv_g = inv_group;

run;

View solution in original post


All Replies
Esteemed Advisor
Posts: 7,052

Re: Strange symbol attached to the end of a column

Kevin,

Was to code possibly written on a PC?  One can't tell from the picture you attached, but it is likely a CR or LF character.  See if adding an 'infile cards termstr=CRLF;' statement gets rid of the extra character.

Regular Contributor
Posts: 173

Re: Strange symbol attached to the end of a column

Thank you, Arthur.  The code was entered from PC (PC SAS).

Where should I fit your suggestions into my code?

This is the code i have and its syntax is not correct.  Thank you again!

data inv_list;

infile cards termstr=CRLF;

datalines;

ASC

FHA

FHLMC

FNMA

HCS

PRIVATE

VA

WO

;

run;

Solution
‎04-10-2013 04:25 PM
Regular Contributor
Posts: 173

Re: Strange symbol attached to the end of a column

To everyone who cares to know,

I tried this code and it worked:

data inv_list1;

set inv_list;

inv_g = compress(inv_group,compress(lowcase(inv_group),'qwertyuiopasdfghjklzxcvbnm1234567890')));

drop inv_group;

rename inv_g = inv_group;

run;

Contributor
Posts: 71

Re: Strange symbol attached to the end of a column

I'm curious how "the code that worked" has been set as the Correct Answer to your original question?


Esteemed Advisor
Posts: 7,052

Re: Strange symbol attached to the end of a column

termstr was added to the infile statement as of SAS 9.2  Which version are you using?

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 189 views
  • 0 likes
  • 3 in conversation