Pyrite | Level 9

## 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;

1 ACCEPTED SOLUTION

Accepted Solutions
Pyrite | Level 9

## 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;

3 REPLIES 3
Super User

## 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?

Pyrite | Level 9

## 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;

Pyrite | Level 9

Thanks Tom.

From The DO Loop