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,

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 779 views
  • 0 likes
  • 2 in conversation