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

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

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.

 

 

View solution in original post

6 REPLIES 6
Astounding
PROC Star

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.

 

 

SSG
Fluorite | Level 6 SSG
Fluorite | Level 6

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.

data_null__
Jade | Level 19

@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.

Tom
Super User Tom
Super User

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;
Peter_C
Rhodochrosite | Level 12
as nothing is broken
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
SSG
Fluorite | Level 6 SSG
Fluorite | Level 6
I don't create tables in Oracle, I just pull stuff down. And that's what I got.

SAS Innovate 2025: Register Now

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!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 3014 views
  • 3 likes
  • 5 in conversation