Hi, I'm importing a .xlsx file into SAS Studio using PROC Import. Unfortunately, the names in Excel are strange, and I'm unable to reference them in SAS. I've run the following code: proc sql;
describe table lender_history_2018_02_28;
quit; while yields the following results: create table LENDER_HISTORY_2018_02_28( bufsize=65536 )
(
'CheckDate'n num format=MMDDYY10. label='CheckDate',
'CheckNumber'n char(5) format=$5. informat=$5. label='CheckNumber',
C num format=BEST. label='C',
D num format=BEST. label='D',
'Check Amount'n num format=NLMNY15.2 label='Check Amount',
'ServiceFees'n num format=NLMNY15.2 label='ServiceFees',
'Applied ToInterest'n num format=NLMNY15.2 label='Applied ToInterest',
'Applied ToPrincipal'n num format=NLMNY15.2 label='Applied ToPrincipal',
'Applied ToLate Charges'n num format=NLMNY15.2 label='Applied ToLate Charges',
'ChargesPrincipal'n num format=NLMNY15.2 label='ChargesPrincipal',
'ChargesInterest'n num format=NLMNY15.2 label='ChargesInterest',
'Applied ToPrepay Fee'n num format=NLMNY15.2 label='Applied ToPrepay Fee',
'OtherTaxable'n num format=NLMNY15.2 label='OtherTaxable',
'Applied ToNon-Taxable'n num format=NLMNY15.2 label='Applied ToNon-Taxable',
'OtherPayments'n num format=NLMNY15.2 label='OtherPayments',
'Applied ToTrust'n num format=NLMNY15.2 label='Applied ToTrust',
'LoanAccount'n char(10) format=$10. informat=$10. label='LoanAccount',
'Borrower Name'n char(45) format=$45. informat=$45. label='Borrower Name',
Notes char(78) format=$78. informat=$78. label='Notes',
'Check Memo'n char(20) format=$20. informat=$20. label='Check Memo',
'Created By'n char(9) format=$9. informat=$9. label='Created By',
'Date Created'n num format=DATETIME16. label='Date Created',
'Date Last Updated'n num format=DATETIME16. label='Date Last Updated',
'PaymentCode'n char(6) format=$6. informat=$6. label='PaymentCode',
'PaymentDate Due'n num format=MMDDYY10. label='PaymentDate Due',
'PaymentRcvd Date'n num format=MMDDYY10. label='PaymentRcvd Date'
);
75 quit; As you can see, the variable names (e.g. the first one "'CheckDate'n") don't make sense, and I'm unable to reference them in later code. Unfortunately we receive these files from a vendor, so I can't change them. Any ideas on how I could fix this? I think I could do one of two things: 1) Rename the variables based on their column number (the ordering is always the same) 2) Rename the variables to their label, as these seem reasonable Any ideas how I could do the above? Many thanks, Mike
... View more