BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Haydo
Obsidian | Level 7

Below is a sample of the data I get. Basically I want 1 row per Weekending so CLLS and TFS are on 1 row per date.

Weekending CLLS TFS
9-Jul-23   25629
9-Jul-23 187061  
16-Jul-23   5227
16-Jul-23 906430  
23-Jul-23   48448
23-Jul-23 515269  
30-Jul-23   23582
30-Jul-23 593329  

 

 

Desired result.

 

Weekending CLLS TFS
9-Jul-23 187061 25629
16-Jul-23 906430 5227
23-Jul-23 515269 48448
30-Jul-23 593329 23582
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Are there more variables involved in the data set?

Are the variables CLLS and TFS numeric?

If the answer to the first is NO and Yes to the second this may be the easiest:

 

Proc summary data=yourdataset nway;
   class weekending;
   var clls tfs;
   output out=want (drop=_: ) max=;
run;

If there are other variables you will need to provide a more complete example and what is done with the other variables.

View solution in original post

1 REPLY 1
ballardw
Super User

Are there more variables involved in the data set?

Are the variables CLLS and TFS numeric?

If the answer to the first is NO and Yes to the second this may be the easiest:

 

Proc summary data=yourdataset nway;
   class weekending;
   var clls tfs;
   output out=want (drop=_: ) max=;
run;

If there are other variables you will need to provide a more complete example and what is done with the other variables.

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
  • 1 reply
  • 283 views
  • 1 like
  • 2 in conversation