Help using Base SAS procedures

Creating Indexes on New Variables

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 90
Accepted Solution

Creating Indexes on New Variables

Hello Everyone,

I am trying to create an index on a new data set where I have a new variable.

Here is the code that I have so far:

data work.all_staff (index=Age_Hired);

  set orion.sales orion.nonsales;

  Age_Hired =(year(Hire_Date)-year(Birth_Date));

run;

So I am trying to create an index on the new variable Age_Hired, and I get the following message in my log:

ERROR 23-7: Invalid value for the INDEX option.

I am not sure where I am going wrong with this or if I cannot create a new index against a new variable (which would seem silly since that is a problem on my homework assignment Smiley Happy)

Could someone please let me know where I am going wrong with my code?

Thanks,

Alisa


Accepted Solutions
Solution
‎04-06-2012 05:51 PM
Valued Guide
Posts: 2,177

Re: Creating Indexes on New Variables

Posted in reply to InfoAlisaA

even when we want only a single simple index, the data set option value should appear in  (parentheses), like

    index=(  age_hired )

View solution in original post


All Replies
Solution
‎04-06-2012 05:51 PM
Valued Guide
Posts: 2,177

Re: Creating Indexes on New Variables

Posted in reply to InfoAlisaA

even when we want only a single simple index, the data set option value should appear in  (parentheses), like

    index=(  age_hired )

Frequent Contributor
Posts: 90

Re: Creating Indexes on New Variables

Hi Peter!

Thanks for letting me know what was wrong with my code.

Thanks!

Alisa

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 454 views
  • 0 likes
  • 2 in conversation