output error "Variable not initialized"

What the purpose of my program this error? Please help me,

Currently active call:

File paxnum.src, line 145, in _popt
max = ste*nint_opt + ori;

Traceback:

File paxnum.src, line 27, in _paxnum
{ ori,ste,max,mint } = _popt(minx,maxx);
File pxy.src, line 104, in xy
{ qysig,qyfield,qyprec,qypow,qyorig,qystep,qymax,qymint,qylab } =
File MS_EGARCH_PFT (2).txt, line 141, in <main>
xy(seqa(1,1,rows(smooth0)),smooth0);

1 Answer



0



If this error is being returned for the line:

max = ste*nind_opt + ori;

then either: std, nind_opt or or have not been assigned a value at the time that this line was called. For a very simple example, imagine we had a program that only contained these lines:

new;
a = 1;
c = 3;

d = a + b + c;

We would get an error of "uninitialized variable", because the variable b has never been given a value. If you do not know which variable is uninitialized, you can add print statements before each of the variables. Using our simple example, we would change it to:

new;
a = 1;
c = 3;

print a;
print b;
print c;
d = a + b + c;

After running this code, we should see that the error is on the line that reads "print b". This will tell us that b is not initialized before we try to use it.

aptech

1,773

Your Answer

1 Answer

0

If this error is being returned for the line:

max = ste*nind_opt + ori;

then either: std, nind_opt or or have not been assigned a value at the time that this line was called. For a very simple example, imagine we had a program that only contained these lines:

new;
a = 1;
c = 3;

d = a + b + c;

We would get an error of "uninitialized variable", because the variable b has never been given a value. If you do not know which variable is uninitialized, you can add print statements before each of the variables. Using our simple example, we would change it to:

new;
a = 1;
c = 3;

print a;
print b;
print c;
d = a + b + c;

After running this code, we should see that the error is on the line that reads "print b". This will tell us that b is not initialized before we try to use it.


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.