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

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

1 ACCEPTED SOLUTION

Accepted Solutions
Peter_C
Rhodochrosite | Level 12

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

2 REPLIES 2
Peter_C
Rhodochrosite | Level 12

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

    index=(  age_hired )

InfoAlisaA
Calcite | Level 5

Hi Peter!

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

Thanks!

Alisa

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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