Hello, I am using SAS to output a file where the first line is a header that requires a set of 32 trailing spaces (weird client requirement). Unfortunately everything I try has SAS dropping the extra spaces when I am writing to the Excel file. I know the method I'm doing to create the header line is not the most elegant, but if I could get the trailing spaces to remain I'd be grateful. For the purposes of the below example, the v_RCount is 144. /*Turning previous dataset into single column concat*/ Proc SQL noprint; Create Table Output as Select Record_ID || Medicaid_ID || Fill_date || NDC || Rx_No || Billing_Provider_ID || Phys_Provider_ID || CLAIM_INDICATOR as Results from SQL_Table; Quit; /*Getting count of obs for header and creating header*/ Data Header; call symputx('v_RCount',v_RCount); format head $char75.; set output end=eof nobs=v_RCount; output; if eof then do; head=cat("HNCPDP340BMB000734ORDHS",put(date(),yymmddn8.),put(v_RCount,z12.)," "); output; end; drop results; rename head=Results; run; /*Exporting file as excel file*/ data _null_; set Header Output; if Results = "" then delete; file "&v_Path&v_Fname"; put Results; Run;
... View more