Hi, Row 1 of my dataset is variable name, row 2 of my dataset is my dataset header, starting from row 3 and onwards are the rest of my dataset records. Like this: var1 var2 var3 var4 var5 var6 var7 header cell 1 header cell 2 header cell 3 header cell 4 1.01 2.01 3.01 4.01 5.01 6.01 7.01 2.01 3.01 4.01 5.01 6.01 7.01 8.01 3.01 4.01 5.01 6.01 7.01 8.01 9.01 4.01 5.01 6.01 7.01 8.01 9.01 10.01 When export dataset, I would like to only obtain dataset header and the main dataset records. I tried two method to export: Method 1 proc export data=work.datasetout dbms=csv outfile="fileout.csv" replace; putnames=no; run; Method 2 ods csv file= "fileout.csv" options(sheet_interval='NONE'); proc report data=work.table_02_Header nowd noheader; run; proc report data=work.rawtable02_03 nowd noheader; run; ods csv close; However my dataset header occupied less columns than the dataset records and result in extra commas in the header if open output csv with notepad using Method 1 : header cell 1,header cell 2,header cell 3,header cell 4,,, 1.01,1.02,1.03,1.04,1.05,1.06,1.07 2.01,2.02,2.03,2.04,2.05,2.06,2.07 3.01,3.02,3.03,3.04,3.05,3.06,3.07 4.01,4.02,4.03,4.04,4.05,4.06,4.07 And create extra line between header and dataset if Method 2 is used: header cell 1,header cell 2,header cell 3,header cell 4 -> 1.01,1.02,1.03,1.04,1.05,1.06,1.07 2.01,2.02,2.03,2.04,2.05,2.06,2.07 3.01,3.02,3.03,3.04,3.05,3.06,3.07 4.01,4.02,4.03,4.04,4.05,4.06,4.07 Notice in the header row we have 4 records only, but the main dataset has 7 columns. My question is how to exclude the extra commas in when exporting to csv file in Method 1 or exclude the blank line in Method 2 in sas? Any suggestions would help! Thank you!!
... View more