Hi I have discovered a problem where if I have a field name that is 30 to 32 characters long and in the format 'xx'n rather than a standard SAS field name then it gives me an error when trying to export to CSV. It seems that Proc export code that is generated is taking the quotes and n as part of the field length and therefore the full field is not being output in the generated code. I am using SAS 9.2 and below is the code I have used data work.test; This_Field_HasThirtyCharacters=30; ThisFieldHasThirtyOneCharacters=31; 'Another has twenty nine chars'n=29; 'Another has thirty characterss'n=30; 'Another has thirty1 characterss'n=31; run; proc export data=work.test dbms=csv replace outfile="\\sas\test.csv"; run; with a snippet of the log showing the error below: 53 set WORK.TEST end=EFIEOD; 54 format This_Field_HasThirtyCharacters best12. ; 55 format ThisFieldHasThirtyOneCharacters best12. ; 56 format "Another has twenty nine chars"N best12. ; NOTE: SCL source line. 57 format "Another has thirty characterss" best12. ; ________________________________ 22 200 ERROR 22-322: Syntax error, expecting one of the following: a name, ;, DEFAULT, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_. ERROR 200-322: The symbol is not recognized and will be ignored. 58 format "Another has thirty1 characterss best12. ; NOTE: SCL source line. 58 format "Another has thirty1 characterss best12. ; __________________________________________ 49 NOTE 49-169: The meaning of an identifier after a quoted string may change in a future SAS release. Inserting white space between a quoted string and the succeeding identifier is recommended. NOTE 141-205: SCL source line. 58 format "Another has thirty1 characterss best12. ; __________________________________________ 22 ERROR 22-322: Syntax error, expecting one of the following: a name, ;, DEFAULT, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_. NOTE: SCL source line. 58 format "Another has thirty1 characterss best12. ; __________________________________________ 200 ERROR 200-322: The symbol is not recognized and will be ignored. Has anyone else encountered this problem? thanks Tammy
... View more