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

Hi

 

I get an error

ERROR 22-322: Syntax error, expecting one of the following: a name, -, :, ;, _ALL_, _CHARACTER_,

_CHAR_, _NUMERIC_.

ERROR 76-322: Syntax error, statement will be ignored.

 

The code that gets the error is this one, basicall V7400...V74505 are numerical values and I want to test if the sum is not egal to V7440 (also numerical). What I am missing?

Big Thanks in advance

 

IF SUM(V7400,V7401,V7402,V7403,(-1)*V7500,(-1)*V7501,(-1)*V7502,(-1)*V7503,(-1)*V7504,(-1)*V7505) ^= SUM(V7440) then do ;

1 ACCEPTED SOLUTION

Accepted Solutions
sylvainbg
Obsidian | Level 7

I guess I found the problem

 

It was a DROP that was creating problems before....

View solution in original post

2 REPLIES 2
sylvainbg
Obsidian | Level 7

I guess I found the problem

 

It was a DROP that was creating problems before....

arodriguez
Lapis Lazuli | Level 10

Hi,

 

Are you sure that the error is in that line? I have written the code and works fine for me

data test;
format V7400-V7403 V7500-V7505 V7440  best12.;
V7400=1;
V7401=1;
V7402=1;
V7403=1;
V7500=-1;
V7501=-1;
V7502=-1;
V7503=-1;
V7504=-1;
V7505=1;
V7440=7;
IF SUM(V7400,V7401,V7402,V7403,(-1)*V7500,(-1)*V7501,(-1)*V7502,(-1)*V7503,(-1)*V7504,(-1)*V7505) ^= SUM(V7440) then do ;
	put "IT WORKS";
end;
run;

Since the V7440 ne 8, IT WORKS is printted in the log.

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 2 replies
  • 3392 views
  • 0 likes
  • 2 in conversation