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.
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.
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.
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.
@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.
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;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.