- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,
As in sas, names begin with letter(lowe or upercase) or (_) but I want to use 2$adc2_ as my data set name and using (validvarname=any) .Where validvarname=any should be placed in a data step to make this name(2$adc2_) valid?below is my sas code. any help is appreciated.
data 2$adc2_ ; validvarname=any;
infile datalines;
input score1 score2 score3;
datalines;
90 80 98
78 88
65 66 69
92 94 96
;
run;
proc print data=2$adc2_;run;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@fatemeh wrote:
do you mean i should replace validvarname with validMEMname? below is my sas code still giving me error
options validMEMname=any;
data '2$adc2_'n;
infile datalines;
input score1 score2 score3;
datalines;
90 80 9878 8865 66 6992 94 96
;
proc print data='2$adc2_'n;
run;
And did you read the error?
39 options validmemname=any ; ------------ 14 ERROR 14-12: Invalid option value any for SAS option VALIDMEMNAME.
Did you look at the documentation for that option?
Or read the previous replies to your topic?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
VALIDVARNAME is an option, not on the data set but globally.
options validvarname = any;
data ....
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The VALIDVARNAME=ANY only applies to variable names, not member names.
Try VALIDMEMNAME=EXTEND.
Also make sure to use a name literal if you name does not follow normal naming conventions.
options validmemname=extend ;
data 'really$bad name'n ;
x=1;
run;
proc contents; run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This is the correct placement of the option. It will not handle member names like yours.
options validvarname=any;data '2$adc2_'n;infile datalines;input score1 score2 score3;datalines;90 80 9878 8865 66 6992 94 96;proc print data='2$adc2_'n;run;
proc print data=2$adc2_;run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
thanks for your reply .still sas is giving me error for both validvarname=any and validvarname=extend
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Copy the lines from the SAS log and paste them into the forum.
Make sure to use the {i} icon to pop-up a code window to paste the text to avoid having the forum editor reformat the text.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
options validvarname=any;
56 data '2$adc2_'n;infile datalines;input score1 score2 score3;datalines;
ERROR: The value '2$ADC2_'n is not a valid SAS name.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
56 ! 90 80 9878 8865 66 6992
--
180
56 ! 94 96;proc print data='2$adc2_'n;run;
ERROR 180-322: Statement is not valid or it is used out of proper order.
ERROR: The value '2$ADC2_'n is not a valid SAS name.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
58 proc print data=2$adc2_;run;
-
22
200
ERROR: File WORK.ADC2_.DATA does not exist.
ERROR 22-322: Expecting a name.
ERROR 200-322: The symbol is not recognized and will be ignored.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You are still trying to change the wrong option. validVARname is for VARiable names. You are trying to use dataset (member) name that contains gibberish characters. To do that you need to change the validMEMname option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
do you mean i should replace validvarname with validMEMname? below is my sas code still giving me error
options validMEMname=any;
data '2$adc2_'n;
infile datalines;
input score1 score2 score3;
datalines;
90 80 9878 8865 66 6992 94 96
;
proc print data='2$adc2_'n;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@fatemeh wrote:
do you mean i should replace validvarname with validMEMname? below is my sas code still giving me error
options validMEMname=any;
data '2$adc2_'n;
infile datalines;
input score1 score2 score3;
datalines;
90 80 9878 8865 66 6992 94 96
;
proc print data='2$adc2_'n;
run;
And did you read the error?
39 options validmemname=any ; ------------ 14 ERROR 14-12: Invalid option value any for SAS option VALIDMEMNAME.
Did you look at the documentation for that option?
Or read the previous replies to your topic?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Did you n-literalize my names (as I did in my example), which for some reason stripped out the line feeds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
thanks for your reply. I just copied the codes you corrected and pasted it in sas and executed that!