Statistical programming, matrix languages, and more

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

Accepted Solution Solved
Reply
Super Contributor
Posts: 271
Accepted Solution

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;

answer = j(nrow(DM),1);

do i = 1 to nrow(DM);

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

answer = result;

end;

create kaplan1n var{A  B Answer };

append;

quit;


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

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;

answer = j(nrow(DM),1);

do i = 1 to nrow(DM);

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

answer = result;

end;

create kaplan1n var{A  B Answer };

append;

quit;

View solution in original post


All Replies
Super User
Super User
Posts: 5,991

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: 271

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;

answer = j(nrow(DM),1);

do i = 1 to nrow(DM);

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

answer = result;

end;

create kaplan1n var{A  B Answer };

append;

quit;

Super Contributor
Posts: 271

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.

Post a Question
Discussion Stats
  • 3 replies
  • 1368 views
  • 1 like
  • 2 in conversation