BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
EinarRoed
Pyrite | Level 9

Hello,

I have a CSV-file which consists of 1521 lines such as this:

  • Fylke;Kjoenn;Aldersgruppe;Utdanningsnivaa;1980;1981;1982;1983;1984;1985;1986;1987;1988;1989;1990;1991;1992;1993;1994;1995;1996;1997;1998;1999;2000;2001;2002;2003;2004;2005;2006;2007;2008;2009;2010;2011;2012
  • Ostfold;Menn;16-19aar;Grunnskolenivaa;6149;6275;6399;6429;6345;6350;6192;6126;6070;5846;5699;5468;5150;4867;4681;4450;4984;5159;5199;5126;5121;5190;5234;5434;5580;5836;6175;6351;6450;6524;6669;6774;6839
  • Ostfold;Menn;16-19aar;Videregaaende skole-nivaa;935;983;1014;1104;1222;1230;1271;1322;1345;1442;1540;1594;1636;1653;1572;1702;1054;763;639;604;578;578;569;506;632;569;565;556;582;641;598;659;643
  • Ostfold;Menn;16-19aar;Universitets- og hoegskolenivaa kort;6;0;5;3;0;0;0;3;0;0;3;8;4;4;3;5;3;4;3;0;0;0;0;0;0;0;0;0;0;0;0;0;0
  • Ostfold;Menn;16-19aar;Universitets- og hoegskolenivaa lang;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
  • Ostfold;Menn;16-19aar;Uoppgitt eller ingen fullfoert utdanning;223;217;218;199;195;186;184;183;205;169;152;146;156;127;110;120;76;84;90;89;77;80;89;100;124;177;155;190;249;287;233;228;186
  • Ostfold;Menn;20-24aar;Grunnskolenivaa;3550;3715;3930;4030;3939;3950;3934;4049;4045;3838;3636;3363;3132;2860;2575;2287;2082;1917;2006;2116;2236;2344;2528;2628;2657;2725;2865;2947;3101;3203;3315;3486;3597
  • Ostfold;Menn;20-24aar;Videregaaende skole-nivaa;4202;4014;3856;3869;4064;4357;4527;4641;4803;4702;4718;4756;4854;4999;5050;5163;5126;5022;4768;4667;4566;4355;4207;4028;3763;3710;3566;3569;3639;3817;3954;4001;4071
  • Ostfold;Menn;20-24aar;Universitets- og hoegskolenivaa kort;607;574;587;570;559;547;565;642;694;827;908;1059;1143;1203;1336;1321;1327;1263;1175;943;799;650;572;560;692;709;682;674;707;733;745;792;866
  • Ostfold;Menn;20-24aar;Universitets- og hoegskolenivaa lang;19;8;7;16;6;8;12;19;22;21;16;20;20;16;19;18;24;23;13;15;18;14;12;10;11;9;14;12;9;13;23;21;28

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. Smiley Happy

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19

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?

View solution in original post

2 REPLIES 2
data_null__
Jade | Level 19

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?

EinarRoed
Pyrite | Level 9

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! Smiley Happy

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

How to connect to databases in SAS Viya

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.

Discussion stats
  • 2 replies
  • 1184 views
  • 0 likes
  • 2 in conversation