BookmarkSubscribeRSS Feed
Babloo
Rhodochrosite | Level 12

I want to create a dataset per the below data. I tried to wrote a program to read the data but it is not reading the data as I except. Could someone of you guide me with the program create a dataset per the following data?

 

Name Average Talk Time Answered Calls Average ACW Time Answered Calls
Van der Haeghe, Wendy (A000028) 116,3953488 290,4883721
Verhaegh, John (F002902) 86,66666667 2,333333333

 

data DVV_Automatic_Schedule;
input @1 name $ @40 'Average Talk Time Answered Calls'n commax18. @60 'Average ACW Time Answered Calls'n commax18.;
datalines;
Van der Haeghe,Wendy(A000028) 116,395348837209 290,4883721
Verhaegh,John(F002902)   86,66666667	2,333333333
;
run;
2 REPLIES 2
Kurt_Bremser
Super User

Before messing around with this, I would request the source to deliver data in a usable form. Either items that contain a delimiter are enclosed in quotes (allowing to use the dsd option), or a delimiter that does not appear in items is used (eg the tab, or a pipe character | ).

 

Otherwise you are forced to wrap up the input line from right to left, so that what's left after removing the last two items is your name. Not nice and will cause additional work anytime a column is added. And if you get another column with blanks, you're completely hosed.

 

An DO NOT use the idiotic "some garbage in here"n for variable names. That causes unnecessary work in programming and is plain rotten stupid. Put such text in variable labels, where it belongs.

ballardw
Super User

Also the COMMAw.d and COMMAXw.d informat is intended to read values such as

1,000,000.27 where the comma is not a decimal (though your LOCALE setting might change this behavior, I'm not sure).

 

I think that you might be looking for the NUMXw.d format to read comma in place of decimal.

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!

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