## ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted stringa numeric constant, a datetime constant, a missing value

Solved
Super Contributor
Posts: 328

# ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted stringa numeric constant, a datetime constant, a missing value

I wish to ask if any can help correct the bold section of the code below????

THANKS

Data sim;

Input A B;

cards;

1 3

2 7

3 10

4 12

;

Run;

proc iml;

use sim;

read all  var{A B} into DM;

close;

A = DM[,1]; B = DM[,2];

n = nrow(DM);

start Func(x);

return(  exp(2-x)#[cdf("Normal", x-10)-cdf("Normal", x-4)]*exp(-x) );

finish;

do i = 1 to nrow(DM);

call quad(result, "Func", A || B,);

end;

create kaplan1n var{A  B Answer };

append;

quit;

Accepted Solutions
Solution
‎09-25-2014 10:07 PM
Super Contributor
Posts: 328

## Re: ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted stringa numeric constant, a datetime constant, a missing value

I see, This works,

Data sim;

Input A B;

cards;

1 3

2 7

3 10

4 12

;

Run;

proc iml;

use sim;

read all  var{A B} into DM;

close;

A = DM[,1]; B = DM[,2];

n = nrow(DM);

start Func(x);

return(  exp(2-x)#(cdf("Normal", x-10)-cdf("Normal", x-4))*exp(-x) );

finish;

do i = 1 to nrow(DM);

call quad(result, "Func", A || B,);

end;

create kaplan1n var{A  B Answer };

append;

quit;

All Replies
Super User
Posts: 7,936

## Re: ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted stringa numeric constant, a datetime constant, a missing value

It doesn't like the square brackets.  Why are they there?

Solution
‎09-25-2014 10:07 PM
Super Contributor
Posts: 328

## Re: ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted stringa numeric constant, a datetime constant, a missing value

I see, This works,

Data sim;

Input A B;

cards;

1 3

2 7

3 10

4 12

;

Run;

proc iml;

use sim;

read all  var{A B} into DM;

close;

A = DM[,1]; B = DM[,2];

n = nrow(DM);

start Func(x);

return(  exp(2-x)#(cdf("Normal", x-10)-cdf("Normal", x-4))*exp(-x) );

finish;

do i = 1 to nrow(DM);

call quad(result, "Func", A || B,);

end;

create kaplan1n var{A  B Answer };

append;

quit;

Super Contributor
Posts: 328

## Re: ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted stringa numeric constant, a datetime constant, a missing value

Thanks Tom.

🔒 This topic is solved and locked.