<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Strange behavior of proc import in Viya in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/Strange-behavior-of-proc-import-in-Viya/m-p/844714#M1566</link>
    <description>Thanks, SASKiwi. The issue is resolved by adding a line &lt;BR /&gt;options validvarname=ANY;&lt;BR /&gt;on top.</description>
    <pubDate>Wed, 16 Nov 2022 21:15:01 GMT</pubDate>
    <dc:creator>cokeyng</dc:creator>
    <dc:date>2022-11-16T21:15:01Z</dc:date>
    <item>
      <title>Strange behavior of proc import in Viya</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Strange-behavior-of-proc-import-in-Viya/m-p/844677#M1563</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have written a sas script to download and import the CPI data from Statistics Canada. One of the same is to import the csv file into the memory as a table.&lt;/P&gt;
&lt;P&gt;filename ext "%sysfunc(getoption(work))/&amp;amp;tableNum..csv";&lt;/P&gt;
&lt;P&gt;proc import out=&amp;amp;olibname..&amp;amp;dset. datafile=ext dbms=csv replace;&lt;BR /&gt;guessingrows=max;&lt;BR /&gt;getnames=yes;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ext is a filename and&amp;nbsp;&amp;amp;olibname..&amp;amp;dset. will be resolved to Public.CPI&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The script is running correctly as a scheduled job or executed manually in SAS studio until I need to make use of the data source right after the import. When I checked the log, I found that the import statement handled a column wiht space in the column name differently.&lt;/P&gt;
&lt;P&gt;When I ran the script in SAS Studio, the import will leave the name it is. The log is below&lt;/P&gt;
&lt;P&gt;355 /**********************************************************************&lt;BR /&gt;356 * PRODUCT: SAS&lt;BR /&gt;357 * VERSION: V.03.05&lt;BR /&gt;358 * CREATOR: External File Interface&lt;BR /&gt;359 * DATE: 16NOV22&lt;BR /&gt;360 * DESC: Generated SAS Datastep Code&lt;BR /&gt;361 * TEMPLATE SOURCE: (None Specified.)&lt;BR /&gt;362 ***********************************************************************/&lt;BR /&gt;363 data PUBLIC.CPI ;&lt;BR /&gt;364 %let _EFIERR_ = 0; /* set the ERROR detection macro variable */&lt;BR /&gt;365 infile EXT delimiter = ',' MISSOVER DSD firstobs=2 ;&lt;BR /&gt;366 informat REF_DATE ANYDTDTE9. ;&lt;BR /&gt;367 informat GEO $52. ;&lt;BR /&gt;368 informat DGUID $18. ;&lt;BR /&gt;369 informat "Products and product groups"N $107. ;&lt;BR /&gt;370 informat UOM $12. ;&lt;BR /&gt;371 informat UOM_ID $5. ;&lt;BR /&gt;372 informat SCALAR_FACTOR $7. ;&lt;BR /&gt;373 informat SCALAR_ID $3. ;&lt;BR /&gt;374 informat VECTOR $13. ;&lt;BR /&gt;375 informat COORDINATE $8. ;&lt;BR /&gt;376 informat VALUE $7. ;&lt;BR /&gt;377 informat STATUS $3. ;&lt;BR /&gt;378 informat SYMBOL $2. ;&lt;BR /&gt;379 informat TERMINATED $3. ;&lt;BR /&gt;380 informat DECIMALS $3. ;&lt;BR /&gt;381 format REF_DATE date9. ;&lt;BR /&gt;382 format GEO $52. ;&lt;BR /&gt;383 format DGUID $18. ;&lt;BR /&gt;&lt;STRONG&gt;384 format "Products and product groups"N $107. ;&lt;/STRONG&gt;&lt;BR /&gt;385 format UOM $12. ;&lt;BR /&gt;386 format UOM_ID $5. ;&lt;BR /&gt;387 format SCALAR_FACTOR $7. ;&lt;BR /&gt;388 format SCALAR_ID $3. ;&lt;BR /&gt;389 format VECTOR $13. ;&lt;BR /&gt;390 format COORDINATE $8. ;&lt;BR /&gt;391 format VALUE $7. ;&lt;BR /&gt;392 format STATUS $3. ;&lt;BR /&gt;393 format SYMBOL $2. ;&lt;BR /&gt;394 format TERMINATED $3. ;&lt;BR /&gt;395 format DECIMALS $3. ;&lt;BR /&gt;396 input&lt;BR /&gt;397 REF_DATE&lt;BR /&gt;398 GEO $&lt;BR /&gt;399 DGUID $&lt;BR /&gt;&lt;STRONG&gt;400 "Products and product groups"N $&lt;/STRONG&gt;&lt;BR /&gt;401 UOM $&lt;BR /&gt;402 UOM_ID $&lt;BR /&gt;403 SCALAR_FACTOR $&lt;BR /&gt;404 SCALAR_ID $&lt;BR /&gt;405 VECTOR $&lt;BR /&gt;406 COORDINATE $&lt;BR /&gt;407 VALUE $&lt;BR /&gt;408 STATUS $&lt;BR /&gt;409 SYMBOL $&lt;BR /&gt;410 TERMINATED $&lt;BR /&gt;411 DECIMALS $&lt;BR /&gt;412 ;&lt;BR /&gt;413 if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */&lt;BR /&gt;414 run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But when executed in a job, the column names will be imported with "_" replace the space characters:&lt;/P&gt;
&lt;P&gt;source: 268 /**********************************************************************&lt;BR /&gt;source: 269 * PRODUCT: SAS&lt;BR /&gt;source: 270 * VERSION: V.03.05&lt;BR /&gt;source: 271 * CREATOR: External File Interface&lt;BR /&gt;source: 272 * DATE: 16NOV22&lt;BR /&gt;source: 273 * DESC: Generated SAS Datastep Code&lt;BR /&gt;source: 274 * TEMPLATE SOURCE: (None Specified.)&lt;BR /&gt;source: 275 ***********************************************************************/&lt;BR /&gt;source: 276 data PUBLIC.CPI ;&lt;BR /&gt;source: 277 %let _EFIERR_ = 0; /* set the ERROR detection macro variable */&lt;BR /&gt;source: 278 infile EXT delimiter = ',' MISSOVER DSD firstobs=2 ;&lt;BR /&gt;source: 279 informat REF_DATE ANYDTDTE9. ;&lt;BR /&gt;source: 280 informat GEO $52. ;&lt;BR /&gt;source: 281 informat DGUID $18. ;&lt;BR /&gt;source: 282 informat Products_and_product_groups $107. ;&lt;BR /&gt;source: 283 informat UOM $12. ;&lt;BR /&gt;source: 284 informat UOM_ID $5. ;&lt;BR /&gt;source: 285 informat SCALAR_FACTOR $7. ;&lt;BR /&gt;source: 286 informat SCALAR_ID $3. ;&lt;BR /&gt;source: 287 informat VECTOR $13. ;&lt;BR /&gt;source: 288 informat COORDINATE $8. ;&lt;BR /&gt;source: 289 informat VALUE $7. ;&lt;BR /&gt;source: 290 informat STATUS $3. ;&lt;BR /&gt;source: 291 informat SYMBOL $2. ;&lt;BR /&gt;source: 292 informat TERMINATED $3. ;&lt;BR /&gt;source: 293 informat DECIMALS $3. ;&lt;BR /&gt;source: 294 format REF_DATE date9. ;&lt;BR /&gt;source: 295 format GEO $52. ;&lt;BR /&gt;source: 296 format DGUID $18. ;&lt;BR /&gt;&lt;STRONG&gt;source: 297 format Products_and_product_groups $107. ;&lt;/STRONG&gt;&lt;BR /&gt;source: 298 format UOM $12. ;&lt;BR /&gt;source: 299 format UOM_ID $5. ;&lt;BR /&gt;source: 300 format SCALAR_FACTOR $7. ;&lt;BR /&gt;source: 301 format SCALAR_ID $3. ;&lt;BR /&gt;source: 302 format VECTOR $13. ;&lt;BR /&gt;source: 303 format COORDINATE $8. ;&lt;BR /&gt;source: 304 format VALUE $7. ;&lt;BR /&gt;source: 305 format STATUS $3. ;&lt;BR /&gt;source: 306 format SYMBOL $2. ;&lt;BR /&gt;source: 307 format TERMINATED $3. ;&lt;BR /&gt;source: 308 format DECIMALS $3. ;&lt;BR /&gt;title: The SAS System&lt;BR /&gt;title: &lt;BR /&gt;source: 309 input&lt;BR /&gt;source: 310 REF_DATE&lt;BR /&gt;source: 311 GEO $&lt;BR /&gt;source: 312 DGUID $&lt;BR /&gt;&lt;STRONG&gt;source: 313 Products_and_product_groups $&lt;/STRONG&gt;&lt;BR /&gt;source: 314 UOM $&lt;BR /&gt;source: 315 UOM_ID $&lt;BR /&gt;source: 316 SCALAR_FACTOR $&lt;BR /&gt;source: 317 SCALAR_ID $&lt;BR /&gt;source: 318 VECTOR $&lt;BR /&gt;source: 319 COORDINATE $&lt;BR /&gt;source: 320 VALUE $&lt;BR /&gt;source: 321 STATUS $&lt;BR /&gt;source: 322 SYMBOL $&lt;BR /&gt;source: 323 TERMINATED $&lt;BR /&gt;source: 324 DECIMALS $&lt;BR /&gt;source: 325 ;&lt;BR /&gt;source: 326 if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */&lt;BR /&gt;source: 327 run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Has anyone seen this before? is there a configuration change will make it more consistent?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, If I need to refer to a column with space in the column name in a FedSQL, how do I do it? I tried A.'Products and product groups'n and A.[Products and product groups]. Both ended up with syntax error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Cokey&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 18:10:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Strange-behavior-of-proc-import-in-Viya/m-p/844677#M1563</guid>
      <dc:creator>cokeyng</dc:creator>
      <dc:date>2022-11-16T18:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior of proc import in Viya</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Strange-behavior-of-proc-import-in-Viya/m-p/844692#M1564</link>
      <description>&lt;P&gt;The change in variable behaviour you are seeing is controlled by the SAS option&amp;nbsp;VALIDVARNAME. Run this code to confirm the setting of this option.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc options option = validvarname;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It appears you have a SAS Studio setting of&amp;nbsp;VALIDVARNAME = ANY but as a batch job&amp;nbsp;VALIDVARNAME = V7.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 19:44:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Strange-behavior-of-proc-import-in-Viya/m-p/844692#M1564</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-11-16T19:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior of proc import in Viya</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Strange-behavior-of-proc-import-in-Viya/m-p/844714#M1566</link>
      <description>Thanks, SASKiwi. The issue is resolved by adding a line &lt;BR /&gt;options validvarname=ANY;&lt;BR /&gt;on top.</description>
      <pubDate>Wed, 16 Nov 2022 21:15:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Strange-behavior-of-proc-import-in-Viya/m-p/844714#M1566</guid>
      <dc:creator>cokeyng</dc:creator>
      <dc:date>2022-11-16T21:15:01Z</dc:date>
    </item>
  </channel>
</rss>

