Hello!
I've got the G0046 error message (columns don't match) in this specific line and function:
wr = writer(fhtheta,parasim);
However I don't understand why I am getting this error because apparently the number of columns in fhtheta and parasim are the same:
otheta = opath $+ "\\pa";
create fhtheta = ^otheta with THETA, npara, 8; /** npara = 11 **/
parasim = zeros(block_size,npara); /** 1000 x 11 **/
Could you help me with this issue, please?
Thanks!
2 Answers
0
I would add a check after the create statement, to make sure that the dataset file was created, like this:
otheta = opath $+ "\\pa";
create fhtheta = ^otheta with THETA, npara, 8; /** npara = 11 **/
//A negative file handle value means 'create' failed
if (fhtheta < 1);
//'errorlogat' prints your message in the error window
//and also gives you the file and line number that
//the error came from
errorlogat "'create' failed to create file handle for file: "$+otheta;
//stop program, so we can fix problem
end;
endif;
parasim = zeros(block_size,npara); /** 1000 x 11 **/
I suspect that the file creation is failing. If you run your code with this error message, you will see what file it was trying to create. The most often reasons that create would fail to create an error message are that:
- The path to the file does not exist. For example, I do not have a folder on my computer named /Users/Mike/Applesauce. So if I tried to 'create' a dataset /Users/Mike/Applesauce/newdata, the 'create' would fail. If I first created the folder /Users/Mike/Applesauce, then it would be successful.
- GAUSS does not have permissions to write data to that location. All systems have folders in which a standard user is not allowed to write files. For example the root folder on Mac or Linux, '/' or C:\Program Files on Windows (among other folders) are almost always protected from file writes by standard user accounts.
0
Thank you for your help!
Yes, actually I've got fhtheta = -1. It was apparently a working directory problem. I have changed it, and now it works.
Your Answer
2 Answers
I would add a check after the create statement, to make sure that the dataset file was created, like this:
otheta = opath $+ "\\pa";
create fhtheta = ^otheta with THETA, npara, 8; /** npara = 11 **/
//A negative file handle value means 'create' failed
if (fhtheta < 1);
//'errorlogat' prints your message in the error window
//and also gives you the file and line number that
//the error came from
errorlogat "'create' failed to create file handle for file: "$+otheta;
//stop program, so we can fix problem
end;
endif;
parasim = zeros(block_size,npara); /** 1000 x 11 **/
I suspect that the file creation is failing. If you run your code with this error message, you will see what file it was trying to create. The most often reasons that create would fail to create an error message are that:
- The path to the file does not exist. For example, I do not have a folder on my computer named /Users/Mike/Applesauce. So if I tried to 'create' a dataset /Users/Mike/Applesauce/newdata, the 'create' would fail. If I first created the folder /Users/Mike/Applesauce, then it would be successful.
- GAUSS does not have permissions to write data to that location. All systems have folders in which a standard user is not allowed to write files. For example the root folder on Mac or Linux, '/' or C:\Program Files on Windows (among other folders) are almost always protected from file writes by standard user accounts.
Thank you for your help!
Yes, actually I've got fhtheta = -1. It was apparently a working directory problem. I have changed it, and now it works.