Help using Base SAS procedures

PROC COPY error when input dataset name has special character

Reply
Contributor
Posts: 20

PROC COPY error when input dataset name has special character

Hi,

I wanted to use PROC COPY for copying a dataset but received an error after submitting the following:

proc copy out=work in=ntsqlpro;
select LÅN_GARANTI;
quit;

ERROR: The value 'LÅN_GARANTI'n is not a valid SAS name.

I am running 9.1.3. I assume that it is because of the special character in the original dataset name. Is there a way to circumvent this or is it not possible to use PROC COPY with special characters? I googled the web for explanations but didn't come across any.

Thanks,

Helle
PROC Star
Posts: 7,474

Re: PROC COPY error when input dataset name has special character

Works fine for me. My guess is that you have the wrong value set for your validvarname option.

Try options validvarname=v7 and see if that corrects the problem.

HTH,
Art
Valued Guide
Posts: 634

Re: PROC COPY error when input dataset name has special character

It is hard to tell, but it looks like the A in LAN is not the standard English A. This would require VALIDVARNAME to be set to ANY. You may also need to write the SELECT statement as:
[pre]
select 'LAN_GARANTI'n;
[/pre]
where you use the A that is not on my keyboard.
Valued Guide
Posts: 2,177

Re: PROC COPY error when input dataset name has special character

Helle

you need to change the name of the table if you want to copy it into the WORK library. Although SAS/Access to a dbms supports complex names like your table, that flexibility is not present in the support of table names in the (base SAS) WORK library.
You might have more success with a simple data step, like[pre]DATA work.loan_garanti ;
set ntsqlpro."LÅN_GARANTI"n ;
run ;[/pre]
good luck
peterC
Contributor
Posts: 20

Re: PROC COPY error when input dataset name has special character

Hi,

In the end, I opted for the simple data step solution because I still received the same error message even after changing the options and modifying the code. Thanks for all your input.

Helle
Ask a Question
Discussion stats
  • 4 replies
  • 159 views
  • 0 likes
  • 4 in conversation