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