10-19-2016 02:25 PM
I'm running a report and exporting the data to a CSV file but wondered if there was a way to remove the repeating values in the first column.
The way the data file is set up is that the IDs are duplicated based on whether are multiple values in any of the columns so each observation is unique and I dont want to remove them. I guess this would be for mainly an asthetic value.
ID Col1 Col2 Col3 …
Loan A X A B …
Loan A X C D … Loan A X E F …
Loan B A Y C …
Loan B B Y D …
Loan C … … … …
Loan D … … … …
10-19-2016 03:13 PM
It can be done using PROC REPORT :
proc report data=have;
columns ID COL1 COL2 COL3 ...;
define ID / order ;
10-19-2016 03:33 PM
Exporting data will do that.
CSV is intended for data interchange in which case you would not really want the values to dispear from some records.
If you use a report procedure such as Proc Report or Tabulate that will allow things to group then you could write the results fo the procedure. Since it sounds like you may actually want a report and not a data interchange then use ODS RTF or PDF with an appropriate report procedure.
10-20-2016 04:38 AM
CSV = Comma Separated Variable text file. Is designed for data transfer. It is not an Excel file!
Now decide what you want that output for, if it is to send data somewhere, then go ahead and export to CSV, and all the data will appear, ID on each line per the definition of a CSV. If however you just want some review output in Excel, then use proc report and create a report in an Excel file - ods tagsets.excelxp or excel will do the trick and you have all the functionality therein.
Again, CSV is not the same as Excel.