- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Currently running SAS 9.4. I've found absolutely nothing about the above error message anywhere, so I'm hoping the community can help. I'm trying to execute the CALL MISSING routine as part of a data step below:
data HLS_Advisor;set HLS_data;
if COHORT_YEAR =2016 then call missing
(of CUM_GPA_CENSUS_1_YR-CUM_GPA_CENSUS_6_YRS, of RETAIN_1_YR_ORG_CAMPUS-RETAIN_6_YR_ORG_CAMPUS, of GRAD_1_YR_ORG_CAMPUS-GRAD_6_YR_ORG_CAMPUS);
What is the error above and how do I fix it?
P.S.
I'm also getting "ERROR: Missing numeric suffix on a numbered variable list" for all three arrays. Can't find anything about how toi fix that either.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
In SAS, this is not a proper way of specifying a list of variables:
CUM_GPA_CENSUS_1_YR-CUM_GPA_CENSUS_6_YRS
If your variables were named differently, you could use:
CUM_GPA_CENSUS_YR_1-CUM_GPA_CENSUS_YR_6
To use this type of list, the variable names must all begin with the same prefix, and must end with a numeric suffix.
There is another way, that might be appropriate, depending on the full set of variable names in your data:
if COHORT_YEAR =2016 then call missing
(of CUM_GPA_CENSUS_:, of RETAIN_:, of GRAD_: );
Using the colon represents all variable names that begin with the character listed in the prefix. So if you have NO other variables that begin with the name RETAIN_, GRAD_, etc. you could use this style. Otherwise, you just have to spell out the list of all 18 variable names.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
In SAS, this is not a proper way of specifying a list of variables:
CUM_GPA_CENSUS_1_YR-CUM_GPA_CENSUS_6_YRS
If your variables were named differently, you could use:
CUM_GPA_CENSUS_YR_1-CUM_GPA_CENSUS_YR_6
To use this type of list, the variable names must all begin with the same prefix, and must end with a numeric suffix.
There is another way, that might be appropriate, depending on the full set of variable names in your data:
if COHORT_YEAR =2016 then call missing
(of CUM_GPA_CENSUS_:, of RETAIN_:, of GRAD_: );
Using the colon represents all variable names that begin with the character listed in the prefix. So if you have NO other variables that begin with the name RETAIN_, GRAD_, etc. you could use this style. Otherwise, you just have to spell out the list of all 18 variable names.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
That seems rather arbitrary but it worked. Thanks!
BTW, these fields are being pulled in from an Oracle SQL Server database, so the naming conventions are based on what works there rather than what works best for SAS. Hopefully this will be fixed in a future SAS release.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@SSG wrote:
That seems rather arbitrary but it worked. Thanks!
BTW, these fields are being pulled in from an Oracle SQL Server database, so the naming conventions are based on what works there rather than what works best for SAS. Hopefully this will be fixed in a future SAS release.
Nothing is broken. Nothing to fix.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Enumerated lists of variables need have the counter at the END of the variable name, not in the middle.
If you want to select a range of variables based on POSITION then you can use a double hyphen.
call missing
(of CUM_GPA_CENSUS_1_YR -- CUM_GPA_CENSUS_6_YRS
RETAIN_1_YR_ORG_CAMPUS -- RETAIN_6_YR_ORG_CAMPUS
GRAD_1_YR_ORG_CAMPUS -- GRAD_6_YR_ORG_CAMPUS
);
But this will include any other variables that just happen to appear between the two listed.
To see the variable names in order use the VARNUM option on PROC CONTENTS. Or just do a quick data step to spit out the variable names ot the log.
data _null_;
set HLS_data (obs=1);
put (_all_) (=/);
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
we have only to cope with what appears to be a feature of oracle name ranges that I would call unreliable:
Does oracle really allow variable name ranges where the number is anywhere in the middle of a name?
What should its parser assume where two separated numbers appear within the name?-CUM_GPA_4_CENSUS_6_YR - -CUM_GPA_6_CENSUS_11_YRS
A SAS approach can almost cope -we just need to define where the number is expected to appear. A regular expression definition would be ideal....
From a download of the column names in the oracle table we could extract the range of column names that match the required pattern INTO : REQUIRED_COLUMNS_LIST
I remain surprised that anyone can suggest oracle has a superior column name parser than SAS
~~~~~
just my $0.01
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content