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

Hi everyone,

 

When trying to import CSV file to SAS, I got some error as below

My code

proc import datafile = 'E:\Harv 27th_Feb_2021\Report final\exchange_rate_Datastream_adjusted_csv.csv'
 out = work.cars
 dbms = CSV
 ;
run;

The log

28         proc import datafile = 'E:\Harv 27th_Feb_2021\Report final\exchange_rate_Datastream_adjusted_csv.csv'
29          out = work.cars
30          dbms = CSV
31          ;
32         run;

NOTE: A byte-order mark in the file "E:\Harv 27th_Feb_2021\Report final\exchange_rate_Datastream_adjusted_csv.csv" (for fileref 
      "#LN00574") indicates that the data is encoded in "utf-8".  This encoding will be used to process the file.
NOTE: A byte-order mark in the file "E:\Harv 27th_Feb_2021\Report final\exchange_rate_Datastream_adjusted_csv.csv" (for fileref 
      "#LN00575") indicates that the data is encoded in "utf-8".  This encoding will be used to process the file.
Number of names found is less than number of variables found. 
Name  is not a valid SAS name.
Name  is not a valid SAS name.
Name  is not a valid SAS name.
Name  is not a valid SAS name.
Name  is not a valid SAS name.
Name  is not a valid SAS name.
Name  is not a valid SAS name.
/*And thousands of the lines "Name is not a valid SAS name." afterwards */

Could you please tell me how to sort it out? Please let me know if I need to provide further information.

 

Warm regards.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Why does a column header of "NAME" appear over values that are pretty obviously dates with not column header that looks like a "date" type name?

 

Your occasional Character variables are explained by this data:

,161.2243,36.956,NA,564.55,NA,

Solution when reading with a data step is a custom informat that sets NA to missing.

 

 

This bit

Number of names found is less than number of variables found. 
Name  is not a valid SAS name.
Name  is not a valid SAS name.
Name  is not a valid SAS name.

Is because the end of your header row has a bunch of ,,,,,,,,,,,,,,, as to the following data rows. Which Proc Import is not smart enough to recognize as not actual separators between column names.

 

This is common occurrence with spreadsheets. Once a column or row is ever used in the file, or the template source, the Excel will export those "touched but often not populated" cells as ,

You have a very simple file structure apparently.

 

proc format;
invalue myna
'NA' = .
other = [best12.]
;
run;

data want;
  infile 'E:\Harv 27th_Feb_2021\Report final\exchange_rate_Datastream_adjusted_csv.csv'
       dlm=',' dsd lrecl=32000 firstobs=2 missover; 
  informat Name ddmmyy10.
          AUD EUR CAD DKK HKD ILS JPY NZD NOK SGD KRW 
          SEK CHF TWD GBP ARS BRL CLP CNY COP HRK CZK 
          EGP HUF INR IDR KES MYR MXN MAD PKR PEN PHP 
          PLN RON ZAR LKR THB TRY VES ATS DEM EEK ESP 
          GRD LTL LVL NLG ROL SIT SKK TRL VEB ZWD  myna.;
  format name ddmmyy10.;
  input Name 
          AUD EUR CAD DKK HKD ILS JPY NZD NOK SGD KRW 
          SEK CHF TWD GBP ARS BRL CLP CNY COP HRK CZK 
          EGP HUF INR IDR KES MYR MXN MAD PKR PEN PHP 
          PLN RON ZAR LKR THB TRY VES ATS DEM EEK ESP 
          GRD LTL LVL NLG ROL SIT SKK TRL VEB ZWD  ;
run;

And if you use a FILENAME statement to create a fileref you could add the UTF-8 using the encoding='UTF-8' option.

View solution in original post

32 REPLIES 32
Shmuel
Garnet | Level 18

Post first few lines from your csv file. Does the first line contain the variable names?

Are those names sas valid names?

 

What happens if you assign option firstobs=2 ?

Phil_NZ
Barite | Level 11

Hi @Shmuel 

It is the first few lines from my CSV file opened by Notepad

Name,AUD,EUR,CAD,DKK,HKD,ILS,JPY,NZD,NOK,SGD,KRW,SEK,CHF,TWD,GBP,ARS,BRL,CLP,CNY,COP,HRK,CZK,EGP,HUF,INR,IDR,KES,MYR,MXN,MAD,PKR,PEN,PHP,PLN,RON,ZAR,LKR,THB,TRY,VES,ATS,DEM,EEK,ESP,GRD,LTL,LVL,NLG,ROL,SIT,SKK,TRL,VEB,ZWD,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
30/12/1998,1.63132,0.8548,1.5511,6.3655,7.7477,4.1654,114.715,1.90223,7.5875,1.6568,1200.5,8.1123,1.3703,32.2305,1.66375,0.9991,1.2081,473.25,8.2787,1545.5,6.2603,29.99199,3.41,215.495,42.53,8100,61.9,5.43,9.935,9.2705,49.795,3.1565,39.15,3.497,NA,5.87,68.4,36.64999,0.31535,NA,11.763,1.672,13.3388,142.25,282.365,4.0013,0.5675,1.8842,1.115,161.2243,36.956,NA,564.55,NA,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

And yes, as you see, the first row is variable names.

And it is the first few lines open by excel

Name	    AUD	    EUR	    CAD	    DKK	    HKD	    ILS	    JPY	    NZD	    NOK	    SGD	    KRW	    SEK	CHF	TWD	GBP	ARS	BRL	CLP	CNY	COP	HRK	CZK	EGP	HUF	INR	IDR	KES	MYR	MXN	MAD	PKR	PEN	PHP	PLN	RON	ZAR	LKR	THB	TRY	VES	ATS	DEM	EEK	ESP	GRD	LTL	LVL	NLG	ROL	SIT	SKK	TRL	VEB	ZWD
30/12/1998	1.63132	0.8548	1.5511	6.3655	7.7477	4.1654	114.715	1.90223	7.5875	1.6568	1200.5	8.1123	1.3703	32.2305	1.66375	0.9991	1.2081	473.25	8.2787	1545.5	6.2603	29.99199	3.41	215.495	42.53	8100	61.9	5.43	9.935	9.2705	49.795	3.1565	39.15	3.497	NA	5.87	68.4	36.64999	0.31535	NA	11.763	1.672	13.3388	142.25	282.365	4.0013	0.5675	1.8842	1.115	161.2243	36.956	NA	564.55	NA
31/12/1998	1.63026	0.85157	1.536	6.3645	7.7473	4.1601	112.8	1.89286	7.619	1.65	1202.5	8.1058	1.3735	32.2175	1.66375	0.9991	1.2083	473.25	8.2789	1547.5	6.2405	30.03099	3.41	215.295	42.4963	7950	61.775	5.43	9.89	9.2591	49.023	3.156	38.9	3.51	NA	5.8828	68.43	36.33499	0.3154	NA	11.7184	1.6656	13.3388	141.6956	280.05	4.0005	0.5671	1.8767	1.1	161.8249	36.825	NA	564.5	NA
1/01/1999	1.63026	0.85157	1.536	6.3645	7.7473	4.1601	112.8	1.89286	7.619	1.65	1202.5	8.1058	1.3735	32.2175	1.6638	0.9991	1.2083	473.25	8.2789	1547.5	6.2405	30.03099	3.41	215.295	42.4963	7950	61.775	5.43	9.89	9.2591	49.023	3.156	38.9	3.51	NA	5.8828	68.43	36.33499	0.3154	NA	11.7184	1.6656	13.3388	141.6956	280.05	4.0005	0.5671	1.8767	1.1	161.8249	36.825	NA	564.5	NA
4/01/1999	1.61577	0.84753	1.5251	6.3148	7.7465	4.1321	112.645	1.88359	7.5025	1.6599	1186.25	8.0305	1.3683	32.15	1.6599	0.9999	1.2072	470.45	8.2793	1539.5	6.1993	29.709	3.4088	212.93	42.5588	8000	61.8	5.43	9.84	9.2292	50.143	3.1635	38.55	3.4485	NA	5.8788	68.405	36.2	0.31583	NA	11.6623	1.6576	13.2526	141.017	276.92	4.0009	0.565	1.8677	1.111	161.8442	36.456	NA	565.15	NA

Warm regards.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
Reeza
Super User
Excel interprets your data so it's essentially applying it's own PROC IMPORT logic internally when opening a CSV file. That can cause really unexpected behaviours sometimes so you MUST use a text editor to examine your files. not Excel.

I'm guessing you're using the wrong encoding option here, is the file created and being used on the same OS or are you crossing OS and languages here? For example, is it created out of a Unix System and read on a Windows System? or in English in one country and French in another?
Phil_NZ
Barite | Level 11

Hi @Reeza 

 

Thank you for your explanation regarding PROC IMPORT

Regarding this part:

 

I'm guessing you're using the wrong encoding option here, is the file created and being used on the same OS or are you crossing OS and languages here? For example, is it created out of a Unix System and read on a Windows System? or in English in one country and French in another?

I download the data from Datastream (a datasource in Finance) under xlsm type, then I convert it to xlsx and csv. Regarding your example, it seems not to be the case. Because the data collecting process, converting process have been done on a Windows System, in English.

 

Warm regards.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
SASKiwi
PROC Star

@Phil_NZ  - The problem is all of those commas without column names on your first data row. Isn't Excel wonderful that while there is no visible data in those columns Excel thinks there is and keeps them in the CSV file! The solution is to open the CSV in Excel, highlight at least 50 blank columns to the right of ZWD and then right-click and delete. Once you have saved the CSV, check again in Notepad to ensure all the commas after ZWD have gone.

Phil_NZ
Barite | Level 11

Hi @SASKiwi 

 

I see what you mean, similar to last time you suggest me to delete the last empty few rows of sheets (to overcome the mixture between char and numeric in a column). However, next time, it does not work.

After deleting a couple of lines, my CSV file being opened by notepad is as below (I just copy the first two lines here)

 

Name,AUD,EUR,CAD,DKK,HKD,ILS,JPY,NZD,NOK,SGD,KRW,SEK,CHF,TWD,GBP,ARS,BRL,CLP,CNY,COP,HRK,CZK,EGP,HUF,INR,IDR,KES,MYR,MXN,MAD,PKR,PEN,PHP,PLN,RON,ZAR,LKR,THB,TRY,VES,ATS,DEM,EEK,ESP,GRD,LTL,LVL,NLG,ROL,SIT,SKK,TRL,VEB,ZWD,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
30/12/1998,1.63132,0.8548,1.5511,6.3655,7.7477,4.1654,114.715,1.90223,7.5875,1.6568,1200.5,8.1123,1.3703,32.2305,1.66375,0.9991,1.2081,473.25,8.2787,1545.5,6.2603,29.99199,3.41,215.495,42.53,8100,61.9,5.43,9.935,9.2705,49.795,3.1565,39.15,3.497,NA,5.87,68.4,36.64999,0.31535,NA,11.763,1.672,13.3388,142.25,282.365,4.0013,0.5675,1.8842,1.115,161.2243,36.956,NA,564.55,NA,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
31/12/1998,1.63026,0.85157,1.536,6.3645,7.7473,4.1601,112.8,1.89286,7.619,1.65,1202.5,8.1058,1.3735,32.2175,1.66375,0.9991,1.2083,473.25,8.2789,1547.5,6.2405,30.03099,3.41,215.295,42.4963,7950,61.775,5.43,9.89,9.2591,49.023,3.156,38.9,3.51,NA,5.8828,68.43,36.33499,0.3154,NA,11.7184,1.6656,13.3388,141.6956,280.05,4.0005,0.5671,1.8767,1.1,161.8249,36.825,NA,564.5,NA,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
1/01/1999,1.63026,0.85157,1.536,6.3645,7.7473,4.1601,112.8,1.89286,7.619,1.65,1202.5,8.1058,1.3735,32.2175,1.6638,0.9991,1.2083,473.25,8.2789,1547.5,6.2405,30.03099,3.41,215.295,42.4963,7950,61.775,5.43,9.89,9.2591,49.023,3.156,38.9,3.51,NA,5.8828,68.43,36.33499,0.3154,NA,11.7184,1.6656,13.3388,141.6956,280.05,4.0005,0.5671,1.8767,1.1,161.8249,36.825,NA,564.5,NA,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
SASKiwi
PROC Star

@Phil_NZ  - You delete columns not rows.

ballardw
Super User

Why does a column header of "NAME" appear over values that are pretty obviously dates with not column header that looks like a "date" type name?

 

Your occasional Character variables are explained by this data:

,161.2243,36.956,NA,564.55,NA,

Solution when reading with a data step is a custom informat that sets NA to missing.

 

 

This bit

Number of names found is less than number of variables found. 
Name  is not a valid SAS name.
Name  is not a valid SAS name.
Name  is not a valid SAS name.

Is because the end of your header row has a bunch of ,,,,,,,,,,,,,,, as to the following data rows. Which Proc Import is not smart enough to recognize as not actual separators between column names.

 

This is common occurrence with spreadsheets. Once a column or row is ever used in the file, or the template source, the Excel will export those "touched but often not populated" cells as ,

You have a very simple file structure apparently.

 

proc format;
invalue myna
'NA' = .
other = [best12.]
;
run;

data want;
  infile 'E:\Harv 27th_Feb_2021\Report final\exchange_rate_Datastream_adjusted_csv.csv'
       dlm=',' dsd lrecl=32000 firstobs=2 missover; 
  informat Name ddmmyy10.
          AUD EUR CAD DKK HKD ILS JPY NZD NOK SGD KRW 
          SEK CHF TWD GBP ARS BRL CLP CNY COP HRK CZK 
          EGP HUF INR IDR KES MYR MXN MAD PKR PEN PHP 
          PLN RON ZAR LKR THB TRY VES ATS DEM EEK ESP 
          GRD LTL LVL NLG ROL SIT SKK TRL VEB ZWD  myna.;
  format name ddmmyy10.;
  input Name 
          AUD EUR CAD DKK HKD ILS JPY NZD NOK SGD KRW 
          SEK CHF TWD GBP ARS BRL CLP CNY COP HRK CZK 
          EGP HUF INR IDR KES MYR MXN MAD PKR PEN PHP 
          PLN RON ZAR LKR THB TRY VES ATS DEM EEK ESP 
          GRD LTL LVL NLG ROL SIT SKK TRL VEB ZWD  ;
run;

And if you use a FILENAME statement to create a fileref you could add the UTF-8 using the encoding='UTF-8' option.

Phil_NZ
Barite | Level 11

Hi @ballardw 

First off, I apply your code successfully! Many thanks. A very clear and dedicated explanation. I have some questions as below:

1. Regarding this part

Why does a column header of "NAME" appear over values that are pretty obviously dates with not column header that looks like a "date" type name?

It is my fault that I forget to change it from "Name" to "datecur".

 

So, when I change the "Name" to "DATADATE" in the CSV file, when I import again by using exactly the code given by you, it still shows "NAME" rather than "DATADATE"

proc format;
invalue myna
'NA' = .
other = [best12.]
;
run;

data want;
  infile 'E:\Harv 27th_Feb_2021\Report final\exchange_rate_Datastream_adjusted1.csv'
       dlm=',' dsd lrecl=32000 firstobs=2 missover; 
  informat Name ddmmyy10.
          AUD EUR CAD DKK HKD ILS JPY NZD NOK SGD KRW 
          SEK CHF TWD GBP ARS BRL CLP CNY COP HRK CZK 
          EGP HUF INR IDR KES MYR MXN MAD PKR PEN PHP 
          PLN RON ZAR LKR THB TRY VES ATS DEM EEK ESP 
          GRD LTL LVL NLG ROL SIT SKK TRL VEB ZWD  myna.;
  format name ddmmyy10.;
  input Name 
          AUD EUR CAD DKK HKD ILS JPY NZD NOK SGD KRW 
          SEK CHF TWD GBP ARS BRL CLP CNY COP HRK CZK 
          EGP HUF INR IDR KES MYR MXN MAD PKR PEN PHP 
          PLN RON ZAR LKR THB TRY VES ATS DEM EEK ESP 
          GRD LTL LVL NLG ROL SIT SKK TRL VEB ZWD  ;
run;

The data

DATADATE,AUD,EUR,CAD,DKK,HKD,ILS,JPY,NZD,NOK,SGD,KRW,SEK,CHF,TWD,GBP,ARS,BRL,CLP,CNY,COP,HRK,CZK,EGP,HUF,INR,IDR,KES,MYR,MXN,MAD,PKR,PEN,PHP,PLN,RON,ZAR,LKR,THB,TRY,VES,ATS,DEM,EEK,ESP,GRD,LTL,LVL,NLG,ROL,SIT,SKK,TRL,VEB,ZWD
30/12/1998,1.63132,0.8548,1.5511,6.3655,7.7477,4.1654,114.715,1.90223,7.5875,1.6568,1200.5,8.1123,1.3703,32.2305,1.66375,0.9991,1.2081,473.25,8.2787,1545.5,6.2603,29.99199,3.41,215.495,42.53,8100,61.9,5.43,9.935,9.2705,49.795,3.1565,39.15,3.497,NA,5.87,68.4,36.64999,0.31535,NA,11.763,1.672,13.3388,142.25,282.365,4.0013,0.5675,1.8842,1.115,161.2243,36.956,NA,564.55,NA
31/12/1998,1.63026,0.85157,1.536,6.3645,7.7473,4.1601,112.8,1.89286,7.619,1.65,1202.5,8.1058,1.3735,32.2175,1.66375,0.9991,1.2083,473.25,8.2789,1547.5,6.2405,30.03099,3.41,215.295,42.4963,7950,61.775,5.43,9.89,9.2591,49.023,3.156,38.9,3.51,NA,5.8828,68.43,36.33499,0.3154,NA,11.7184,1.6656,13.3388,141.6956,280.05,4.0005,0.5671,1.8767,1.1,161.8249,36.825,NA,564.5,NA
1/01/1999,1.63026,0.85157,1.536,6.3645,7.7473,4.1601,112.8,1.89286,7.619,1.65,1202.5,8.1058,1.3735,32.2175,1.6638,0.9991,1.2083,473.25,8.2789,1547.5,6.2405,30.03099,3.41,215.295,42.4963,7950,61.775,5.43,9.89,9.2591,49.023,3.156,38.9,3.51,NA,5.8828,68.43,36.33499,0.3154,NA,11.7184,1.6656,13.3388,141.6956,280.05,4.0005,0.5671,1.8767,1.1,161.8249,36.825,NA,564.5,NA

 

The output (I just copy some columns, not all, because my main focus is the "NAME" and "DATACUR"

Name	AUD	EUR	CAD	DKK	HKD	ILS	JPY	NZD	NOK	SEK	CHF	TWD	GBP	ARS	BRL	CLP	CNY	COP	HRK	CZK	EGP	HUF	INR	IDR
30/12/1998	1.63132	0.8548	1.5511	6.3655	7.7477	4.1654	114.715	1.90223	7.5875	8.1123	1.3703	32.2305	1.66375	0.9991	1.2081	473.25	8.2787	1545.5	6.2603	29.99199	3.41	215.495	42.53	8100
31/12/1998	1.63026	0.85157	1.536	6.3645	7.7473	4.1601	112.8	1.89286	7.619	8.1058	1.3735	32.2175	1.66375	0.9991	1.2083	473.25	8.2789	1547.5	6.2405	30.03099	3.41	215.295	42.4963	7950
01/01/1999	1.63026	0.85157	1.536	6.3645	7.7473	4.1601	112.8	1.89286	7.619	8.1058	1.3735	32.2175	1.6638	0.9991	1.2083	473.25	8.2789	1547.5	6.2405	30.03099	3.41	215.295	42.4963	7950
04/01/1999	1.61577	0.84753	1.5251	6.3148	7.7465	4.1321	112.645	1.88359	7.5025	8.0305	1.3683	32.15	1.6599	0.9999	1.2072	470.45	8.2793	1539.5	6.1993	29.709	3.4088	212.93	42.5588	8000

The log

 

35         data want;
36           infile 'E:\Harv 27th_Feb_2021\Report final\exchange_rate_Datastream_adjusted1.csv'
37                dlm=',' dsd lrecl=32000 firstobs=2 missover;
38           informat Name ddmmyy10.
39                   AUD EUR CAD DKK HKD ILS JPY NZD NOK SGD KRW
40                   SEK CHF TWD GBP ARS BRL CLP CNY COP HRK CZK
41                   EGP HUF INR IDR KES MYR MXN MAD PKR PEN PHP
42                   PLN RON ZAR LKR THB TRY VES ATS DEM EEK ESP
43                   GRD LTL LVL NLG ROL SIT SKK TRL VEB ZWD  myna.;
44           format name ddmmyy10.;
45           input Name
46                   AUD EUR CAD DKK HKD ILS JPY NZD NOK SGD KRW
47                   SEK CHF TWD GBP ARS BRL CLP CNY COP HRK CZK
48                   EGP HUF INR IDR KES MYR MXN MAD PKR PEN PHP
2                                                          The SAS System                               14:03 Tuesday, March 2, 2021

49                   PLN RON ZAR LKR THB TRY VES ATS DEM EEK ESP
50                   GRD LTL LVL NLG ROL SIT SKK TRL VEB ZWD  ;
51         run;

NOTE: A byte-order mark in the file "E:\Harv 27th_Feb_2021\Report final\exchange_rate_Datastream_adjusted1.csv" (for fileref 
      "#LN00697") indicates that the data is encoded in "utf-8".  This encoding will be used to process the file.
NOTE: The infile 'E:\Harv 27th_Feb_2021\Report final\exchange_rate_Datastream_adjusted1.csv' is:
      Filename=E:\Harv 27th_Feb_2021\Report final\exchange_rate_Datastream_adjusted1.csv,
      RECFM=V,LRECL=128000,File Size (bytes)=2298494,
      Last Modified=04 March 2021 18:49:03,
      Create Time=04 March 2021 18:49:03

NOTE: 5784 records were read from the infile 'E:\Harv 27th_Feb_2021\Report final\exchange_rate_Datastream_adjusted1.csv'.
      The minimum record length was 352.
      The maximum record length was 426.

 

2. Apart from that

 

And if you use a FILENAME statement to create a fileref you could add the UTF-8 using the encoding='UTF-8' option.

And it seems that I do not need to touch the UTF-8 option in my current code because I do not use a FILENAME to create a fileref even the LOG above mention the UTF-8 thingy?

 

Many thanks and warm regards.

 

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
Kurt_Bremser
Super User

You change the first line of the CSV file.

Now, you use the FIRSTOBS=2 in your INFILE statement. What do you think it does?

Spoiler
It skips the first line on reading, so whatever you do there CANNOT have the least effect on the result.

The name of the variable is solely determined by the following code, most importantly the INPUT statement.
Phil_NZ
Barite | Level 11

Hi @Kurt_Bremser and @ballardw 

 

Thank you very much for your explanation!

My code now is:

proc format;
invalue myna
'NA' = .
other = [best12.]
;
run;
data want; infile 'E:\Harv 27th_Feb_2021\Report final\exchange_rate_Datastream_adjusted1.csv' dlm=',' dsd lrecl=32000 firstobs=2 missover; informat DATADATE ddmmyy10. AUD EUR CAD DKK HKD ILS JPY NZD NOK SGD KRW SEK CHF TWD GBP ARS BRL CLP CNY COP HRK CZK EGP HUF INR IDR KES MYR MXN MAD PKR PEN PHP PLN RON ZAR LKR THB TRY VES ATS DEM EEK ESP GRD LTL LVL NLG ROL SIT SKK TRL VEB ZWD myna.; format DATADATE ddmmyy10.; input DATADATE AUD EUR CAD DKK HKD ILS JPY NZD NOK SGD KRW SEK CHF TWD GBP ARS BRL CLP CNY COP HRK CZK EGP HUF INR IDR KES MYR MXN MAD PKR PEN PHP PLN RON ZAR LKR THB TRY VES ATS DEM EEK ESP GRD LTL LVL NLG ROL SIT SKK TRL VEB ZWD ; run;

Is it okay with you, do you have any comments about the LRECL value?

Apart from that, I am curious about the informal and format. 

Follow this link, from my understanding, informat tell SAS how to read the variables. So in the code above, it is quite clear about the ddmmyy10. and myna.

And "assigning a format to a variable in a data step will permanently store the variable’s format assignment as part of the dataset". So, it makes sense that you format DATADATE (or NAME in the previous version), but why you do not format the other variables (AUD, EUR, CAD.....)

 

Warm regards.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
Kurt_Bremser
Super User

You assign a format where it is needed. A simple number needs no format to be legible by us humans, but a SAS date value does need it.

Now, if you want to "pretty up" your currency values, you have to also assign a suitable format to them.

 

In most cases, you won't need an informat to read a number, but with your possible "NA" in the file, it is needed.

 

BTW, after reading your CSV file, I would immediately transpose it to a long format:

proc transpose
  data=want
  out=currency (
    rename=(col1=rate _name_=currency)
  )
;
by datadate;
var AUD--ZWD;
run;
Phil_NZ
Barite | Level 11

Thank @Kurt_Bremser 

First, thank you for your detailed explanation.

 

Second, yeah, you are right, because I need to match with another dataset so it must be transposed to a long version.

 

Many thanks!

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
Kurt_Bremser
Super User

You can do the transpose right in the step that reads the data:

data want;
infile 
  datalines
  dlm=','
  dsd
  firstobs=2
  truncover
;
input
  datadate :ddmmyy10.
  AUD
  EUR
  CAD
;
format datadate ddmmyy10.;
array cur {*} AUD--CAD;
do i = 1 to dim(cur);
  currency = vname(cur{i});
  rate = cur{i};
  output;
end;
keep datadate currency rate;
datalines;
datadate,AUD,EUR,CAD
01.01.2021,1,2,3
;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 32 replies
  • 3914 views
  • 20 likes
  • 7 in conversation