I'm relatively new to SAS. What I want to do is simple enough, however, every time I try to run the code with minor tweaks, I get an error. I have twelve months worth of information, P1-P12. For P1-P3, the variable DOC_DATE is in the correct format, MMDDYY10. For P4-P12, DOC_DATE is a char variable. This is keeping me from creating one large data set for the entire year. Therefore, I need to make DOC_DATE in the P4-P12 data sets the same format, MMDDYY10. I do that by creating a temporary variable (_date) to house the correct date, called Document_Date, and then renaming it to DOC_DATE and dropping the extraneous variables. Code: Data DataRequest; SET ERPOCT.p1_readin ERPNOV.p2_readin ERPDEC.p3_readin /*these 3 are correctly formatted */ ERPJAN.p4_readin(rename=(Document_Date=DOC_DATE)) ERPFEB.p5_readin(rename=(Document_Date=DOC_DATE)) ERPMAR.p6_readin(rename=(Document_Date=DOC_DATE)) ERPAPR.p7_readin(rename=(Document_Date=DOC_DATE)) ERPMAY.p8_readin(rename=(Document_Date=DOC_DATE)) ERPJUN.p9_readin(rename=(Document_Date=DOC_DATE)) ERPJUL.p10_readin(rename=(Document_Date=DOC_DATE)) ERPAUG.p11_readin(rename=(Document_Date=DOC_DATE)) ERPSEP.p12_readin(rename=(Document_Date=DOC_DATE)); format _date DOC_DATE mmddyy10.; /*_data is temp variable */ _date=input(compress(Document_Date),MMDDYY10.); /* remove blank of Document _Date */ DOC_DATE = _date; /* retake the DOC_DATE */ DROP _Date Document_date; where SUBSTR(Account,1,4) IN ('2110','2112','4221','4222','4801'); RUN; I get the following Error Message for P4-P12: ERROR: Variable Document_Date is not on file ERPJAN.P4_READIN ERROR: Invalid DROP, KEEP, or RENAME OPTION on file ERPJAN.P4_READIN Any help is appreciated. Thank you. M.
... View more