BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BrahmanandaRao
Lapis Lazuli | Level 10

Hi Experts Good Morning

Here my dataset in this dataset input numbers using dollar sign data read like below without dollar sign missing  

 

 

The SAS System


1,22, 6
, 55,66
8 ,77
 
 
 
 
 
 
 
 
47 , 3,
55 98,
66
 
 
 
 
 
 
 
 

 

 

i want output 

ID
1,22, 6, 55,668 ,77
47 , 3, 55 98,66

 

data dsn;
input numbers $ 7. @@ ;
datalines;
1,22, 6, 55,668 ,77
47 , 3, 55 98,66 
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20
data dsn;
input numbers $20.;
datalines;
1,22, 6, 55,668 ,77
47 , 3, 55 98,66 
run;

View solution in original post

3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20
data dsn;
input numbers $20.;
datalines;
1,22, 6, 55,668 ,77
47 , 3, 55 98,66 
run;
BrahmanandaRao
Lapis Lazuli | Level 10

HI Draycut

 

i got solution thank you 

i have doubt why should we use dollar sign  even though it is numeric data 

could you please clarify 

ballardw
Super User

You should show examples of the actual file that was read and ideally the code used to read the data.

 

Also you should show what you expect the results to look like.

 

If you want to display numeric values as currency then the display format DOLLAR should be used.

Example;

data example;
  input x;
  put x Dollar16.2;

datalines;
123.45
0.57
123456789.89
;

The example code provided by @PeterClemmensen reads values as character.

 

 

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 562 views
  • 0 likes
  • 3 in conversation