BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

Could you help with a dlm problem?

When I run the following program to get the variable names of a txt file in row,
I do not get the proper truncation?

data noms_var;
length x1-x&nbr_var. $60;
infile "U:\RFS\RFS_Gestion\Opcvm quantitatifs\Modele action\DATA\données hebdo historiques test\For_BV_Per_Share_2.txt" dlm=' ' obs=1 missover;
input (x1-x&nbr_var.) ($) ;
run;

I do get have in the txt file:
EC Name For_BV_Per_Share_11_12_04

I get in SAS
EC#Name#For_BV_Per_Share _11_12_04
(instead of the #, there are squares).


Could you help telling me what do I do wrong?

Many thanks and sorry for my level in english,

anais
3 REPLIES 3
Doc_Duke
Rhodochrosite | Level 12
There is a good chance that the delimiter in the file is NOT a space, but a character that doesn't display, so the text editor you are using shows it as a blank. To know for sure, you will need to display it in a hex editor.

Doc
deleted_user
Not applicable
Hi ,

First of all, thank you.

I know that it's a tab.
THe txt file is a converted xls file.
But I don't know how to flag it in SAS (I used dlm=tab but it didn't work).

Do you have another idea?

Anais
deleted_user
Not applicable
Hi,

I tried the ASCII code '0x09' but it has to be: DLM=’09’x


See the TS-673 document.
http://support.sas.com/techsup/technote/ts673.html

Cheers,

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1315 views
  • 0 likes
  • 2 in conversation