BookmarkSubscribeRSS Feed
rajat_sas
Calcite | Level 5

The attached file contains one column and 25 rows. The length of the string in the column is 16, but the format is given as $30.

When I try to export the dataset into .csv or any other format, the strings get broken into two parts and make 50 rows.

Can some please help me exporting the string intact ?

My Contact number is +91 - 9711913925

Skype id is rajat.musigma

email - rajatagarwalismd@gmail.com

3 REPLIES 3
Doc_Duke
Rhodochrosite | Level 12

You appear to have an embedded linefeed ( ''0A'x ) in each string.  That is why it is displaying as two line on the export ('0A'x is the end-of-line character in Unix and many PC programs also interpret it that way.

303038363538313332300A3130323930


If the hex output for your first line of data (note the '0A').


Doc Muhlbaier

Duke

rajat_sas
Calcite | Level 5

Dear Sir,

Thanks a lot for the insight. I was expecting something like an "Enter key" embedded within the string. It very much explains the issue.

Could you please suggest me a way to remove this ( ''0A'x ) from the string, as I need to extract data in the intact form ?

Also, could you please help me how to get the hexadecimal of the string/number in SAS.

Thanks a lot,

Rajat

Doc_Duke
Rhodochrosite | Level 12

Rajat,

To display the hex representation of a character string, I simply applied the $hex format to it.  You can read about that in the documentaiton.

To remove the control characters from a string, use the COMPRESS function.  See

http://www2.sas.com/proceedings/sugi31/028-31.pdf

or the documentation for exact syntax.

Doc

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 3 replies
  • 791 views
  • 4 likes
  • 2 in conversation