BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Gil_
Quartz | Level 8
I have a proc transpose
Proc sort = combine;
By number;
Run;
Proc transpose data =combine out =combine2 ;
By date number cost ;
Var balance;
Id service type;
Run

I get error message the id value occurs twice in the by group

My table looks
Number. Date. Balance. Cost. Service type
123. 01/04/19. 120. 23A. VENDOR
123. 01/05/19. 133. 23A. VENDOR
234. 02/02/19. 150. 24B. CUSTOMERS
245. 02/06/19. 210. 25B. CUSTOMERS
I
1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Your BY variables should be the same in the sort and transpose step.

PG

View solution in original post

4 REPLIES 4
novinosrin
Tourmaline | Level 20

what do you want as output?

Gil_
Quartz | Level 8

Number date Balance. Vendor. CUSTOMERS
123. 01/04/19 120:: vendor
123. 01/05/19 133. Vendor
234. 02/02/19. 150. Customer
245. 02/06/19. 210. Customer
PGStats
Opal | Level 21

Your BY variables should be the same in the sort and transpose step.

PG
Gil_
Quartz | Level 8
Thanks pgstats. I did and i get same.
Proc sort = combine;
By number;
Run;
I even removed col not needed just kept
Number balance. Service type
Still get error message

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 861 views
  • 1 like
  • 3 in conversation