BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
saikiran_nemani
Obsidian | Level 7
PROC TRANSPOSE DATA=FINAL2
   OUT = FINAL3 ;
     BY LOAN_NO;
     ID new_date1;
     VAR INSTL_AMOUNT;
RUN;
 
ERROR: The ID value "NOV2023" occurs twice in the same BY group.
 
Can anyone help on above issue ?
1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

What it says. You have at least one LOAN_NO group where the NEW_DATE1 value "NOV2023" appears more than once.

For TRANSPOSE to work, you have to de-duplicate the dataset first, so you have to make a decision what you do with the INSTL_AMOUNT values: take only one, sum, maximum, minimum, mean.

Since a wide dataset will not be suited for further analysis, I suspect you need this for reporting purposes, so you should look at PROC REPORT first, as it can handle all this at once (use NEW_DATE1 as an ACROSS variable).

proc report data=final2;
column loan_no instl_amount,new_date1;
define loan_no / group;
define instl_amount / "" analysis sum;
define new_date1 / "" across;
run;

View solution in original post

2 REPLIES 2
Kurt_Bremser
Super User

What it says. You have at least one LOAN_NO group where the NEW_DATE1 value "NOV2023" appears more than once.

For TRANSPOSE to work, you have to de-duplicate the dataset first, so you have to make a decision what you do with the INSTL_AMOUNT values: take only one, sum, maximum, minimum, mean.

Since a wide dataset will not be suited for further analysis, I suspect you need this for reporting purposes, so you should look at PROC REPORT first, as it can handle all this at once (use NEW_DATE1 as an ACROSS variable).

proc report data=final2;
column loan_no instl_amount,new_date1;
define loan_no / group;
define instl_amount / "" analysis sum;
define new_date1 / "" across;
run;
Cayden
Calcite | Level 5

I've encountered the "Proc ID Transpose Issue" before, and it can be quite frustrating. Make sure to double-check your data formatting and variables. If you need help, there are some useful resources online like essay app https://essaypro.app/ to troubleshoot this problem.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 749 views
  • 0 likes
  • 3 in conversation