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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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