BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
alberto93
Fluorite | Level 6
Hello everyone! 
I am really confused about why this context keeps resulting in errors.
Can anybody tell me what is wrong with this code?
I'm trying to do cox-regression with competing risk factors.
 
proc phreg data=a.new_status;
class case(ref='0') sex(ref='1')/param=ref;
model duration*status(0, 2) = case age sex cvd diabe hyp dysli pd hl tbi avg_income/ EVENTCODE(cox)= 1 ;
run;
 
Keep showing errors
73-322 Expecting an '='
200-322 Symbol is not recognized.
 
Plz, anybody help me!!
1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Sorry to hear that the problem persists. I've just checked the "What's new" documentation of various SAS/STAT versions and, yes, it's plausible that your too old SAS release is the reason:

In SAS/STAT 13.1 the EVENTCODE= option was introduced, but only since SAS/STAT 14.3 the syntax EVENTCODE(COX)= has been valid. This would explain the error messages if the mark in the log (see my earlier post) is under the open parenthesis after the keyword "EVENTCODE" because SAS releases using SAS/STAT 13.1 - 14.2 would expect the "=" sign there.

 

To confirm this, I'd run

proc product_status;
run;

to display the SAS/STAT version information in the log (as well as the Base SAS maintenance release), e.g.

For Base SAS Software ...
   Custom version information: 9.4_M5
   Image version information: 9.04.01M5P090617
For SAS/STAT ...
   Custom version information: 14.3

Your release is probably <"M5" and the SAS/STAT version <14.3. I upgraded to release 9.4M5, which includes SAS/STAT 14.3, in 2018 (was easy for my single-user system). The upgrade made various newer features available and was worth the effort. See last week's post Best Practices for Upgrading to the Latest Version of SAS®9 for most recent recommendations.

View solution in original post

6 REPLIES 6
FreelanceReinh
Jade | Level 19

Hello @alberto93 and welcome to the SAS Support Communities!

 

Your code looks good and it works on my computer with suitable input data. The error messages indicate that the code in your SAS session contained some invalid character(s) which were not recognized. But these characters didn't survive the copy/paste process into the message box. So, chances are that by copying the code back from your post into SAS it will be ready to run.

 

If that doesn't help: The original log message should contain a mark (e.g. a dash with the error numbers 73 and 200) where an invalid character was found. I would retype the marked characters (most likely equals signs or blanks) to overwrite them with valid characters. They were probably copied from a PDF, Word or other file format using "fancy" characters the SAS compiler doesn't like.

alberto93
Fluorite | Level 6

First, Thank you so much for your kind answer.

Tried everything you told but it doesn't work...

Is there any chance that the cause is my SAS program being an older version?

I performed the code with SAS Enterprise guide 7.1 and SAS 9.4.

FreelanceReinh
Jade | Level 19

Sorry to hear that the problem persists. I've just checked the "What's new" documentation of various SAS/STAT versions and, yes, it's plausible that your too old SAS release is the reason:

In SAS/STAT 13.1 the EVENTCODE= option was introduced, but only since SAS/STAT 14.3 the syntax EVENTCODE(COX)= has been valid. This would explain the error messages if the mark in the log (see my earlier post) is under the open parenthesis after the keyword "EVENTCODE" because SAS releases using SAS/STAT 13.1 - 14.2 would expect the "=" sign there.

 

To confirm this, I'd run

proc product_status;
run;

to display the SAS/STAT version information in the log (as well as the Base SAS maintenance release), e.g.

For Base SAS Software ...
   Custom version information: 9.4_M5
   Image version information: 9.04.01M5P090617
For SAS/STAT ...
   Custom version information: 14.3

Your release is probably <"M5" and the SAS/STAT version <14.3. I upgraded to release 9.4M5, which includes SAS/STAT 14.3, in 2018 (was easy for my single-user system). The upgrade made various newer features available and was worth the effort. See last week's post Best Practices for Upgrading to the Latest Version of SAS®9 for most recent recommendations.

alberto93
Fluorite | Level 6
Thankyou for your kind answer! I upgraded my sas and it worked! Thank you so much!
Ksharp
Super User
status(0, 2)

should be
status(0)
??
alberto93
Fluorite | Level 6
Upgraded my sas version and changed to what you told! It worked! Thanks a lot!!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 6 replies
  • 781 views
  • 2 likes
  • 3 in conversation