Hello,
I have a CSV-file which consists of 1521 lines such as this:
Most of the column names (1980-2012) indicate years.
I've registered it as an external file in DI Studio, set the delimeter to semicolon, and used the wizard to fill out the column attributes.However, once I run the File Reader, it generates these kind of errors for all the year columns:
980 | attrib 1980 length = 8; | |
____ | _ | |
22 | 79 | |
200 | 76 |
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, _ALL_, _CHARACTER_,
_CHAR_, _NUMERIC_. |
ERROR 79-322: Expecting a LENGTH.
ERROR 200-322: The symbol is not recognized and will be ignored.
ERROR 76-322: Syntax error, statement will be ignored.
981 | attrib 1981 length = 8; |
____ | |
22 | |
200 |
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, _ALL_, _CHARACTER_,
_CHAR_, _NUMERIC_. |
ERROR 200-322: The symbol is not recognized and will be ignored.
981 | ! | attrib 1981 length = 8; |
______ | ||
22 |
ERROR 22-322: Syntax error, expecting one of the following: a name, _ALL_, _CHARACTER_,
_CHAR_, _NUMERIC_. |
982 | attrib 1982 length = 8; | |
____ | _ | |
22 | 79 | |
200 | 76 |
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, _ALL_, _CHARACTER_,
_CHAR_, _NUMERIC_. |
ERROR 79-322: Expecting a LENGTH.
ERROR 200-322: The symbol is not recognized and will be ignored.
ERROR 76-322: Syntax error, statement will be ignored.
I'm not quite sure what's incorrect. Any advice on how to fix this?
Thanks.
I think the short answer is
OPTIONS VALIDVARNAME=ANY;
But since I don't know anything about the DI Studio I don't know how you get that turned. Does DI studio have a menu where you can set/change system options?
I think the short answer is
OPTIONS VALIDVARNAME=ANY;
But since I don't know anything about the DI Studio I don't know how you get that turned. Does DI studio have a menu where you can set/change system options?
Aha, there was an option for it in the properties of the External File object (File Parameters --> Advanced -- > Special Column Names). Thanks for the advice!
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.