Hi. I'm trying to transpose the data in my 'have' to my 'want' datasets (tables can be built from the code below). Is it possible to group by the CLAIM_JOB_ID and have all the INC_MTR_NO's and QTY's on one line? I've looked at many of these types of posts and haven't found one that's quite the same. data have; infile datalines delimiter=',' dsd; length claim_job_id $20. inc_mtr_no $10. Qty $3.; input claim_job_id inc_mtr_no Qty ; datalines; 7698-2720K-282-1,990950,100 7698-2720K-282-1,GRO836029,100 7698-2826K-316292-2,FV HC19350,10 7698-2826K-316292-2,FV HC19375,10 7698-2826K-317055-3,GRO833100,100 7698-2826K-317055-3,GRO833101,100 7698-2826K-317108-2,GRO833100,100 7698-2826K-317108-2,GRO833101,100 7698-2826K-319505-1,FV HC19350,10 7698-2826K-319505-1,FV HC19375,10 7698-2826K-325714-8,GRO833100,100 7698-2826K-325714-8,GRO833101,100 7698-2826K-331417-1,GRO833100,100 7698-2826K-331417-1,GRO833101,100 7698-2826K-331425-1,GRO833100,100 7698-2826K-331425-1,GRO833101,100 7698-2826K-331425-1,GRO833133,50 ; run; data want; infile datalines delimiter=',' dsd; retain CLAIM_JOB_ID INC_MTR_NO1 Qty1 INC_MTR_NO2 Qty2 INC_MTR_NO3 Qty3; length CLAIM_JOB_ID $20. INC_MTR_NO1 INC_MTR_NO2 INC_MTR_NO3 $10. Qty1 Qty2 Qty3 $3.; input CLAIM_JOB_ID INC_MTR_NO1 Qty1 INC_MTR_NO2 Qty2 INC_MTR_NO3 Qty3; datalines; 7698-2720K-282-1,990950,100,GRO836029,100,, 7698-2826K-316292-2,FV HC19350,10,FV HC19375,10,, 7698-2826K-317055-3,GRO833100,100,GRO833101,100,, 7698-2826K-317108-2,GRO833100,100,GRO833101,100,, 7698-2826K-319505-1,FV HC19350,10,FV HC19375,10,, 7698-2826K-325714-8,GRO833100,100,GRO833101,100,, 7698-2826K-331417-1,GRO833100,100,GRO833101,100,, 7698-2826K-331425-1,GRO833100,100,GRO833101,100,GRO833133,50 ; run;
... View more