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

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

1 ACCEPTED SOLUTION

Accepted Solutions
KevinC_
Fluorite | Level 6

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

5 REPLIES 5
art297
Opal | Level 21

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.

KevinC_
Fluorite | Level 6

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;

KevinC_
Fluorite | Level 6

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;

jaredp
Quartz | Level 8

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


art297
Opal | Level 21

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

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 5 replies
  • 851 views
  • 0 likes
  • 3 in conversation