03-11-2013 06:59 AM
I am using oracle database
connect to oracle(userr=******* password=***** path='****');
execute (execute PROCEDURE_TEST ((to_date(&DATE1,'yyyymmdd')),(to_date(&DATE6,'yyyymmdd')))) by oracle;
create table SAMPLE_TEST as select * from connection to oracle( select * from ORACLE_TEST) ;
disconnect from oracle;
I am executeing orcle procedure in sas and taking final table (ORACLE_TEST)
Some times i am getting error while executing
ERROR: ORACLE execute error: ORA-01722: invalid number
ORA-06512: at "DEVEL.PROCEDURE_TEST", line 209
i want to handle this error in a table or export this error in text
how to handle this error
03-12-2013 05:12 AM
Date or procedure error i am getting error in log
i want to put this error in a table
or take a data set in sas
input name$ sal;
proc print data=examp;
i will get this error
ERROR: File WORK.EXAMP.DATA does not exist.
i want this error to put in table or export as text
03-12-2013 09:58 AM
You can parse your log, but that's the only way I know of.
Use Proc printto to redirect your log to a text file and then scan it for ERROR: and keep those into a table. There's macros floating around the internet that does things like this, so some searching will help.
It really depends on why you want to do this, which you haven't explained.
03-12-2013 06:20 AM
Could you please give more details like what you want.
i mean as per the above code, you got that error because you have created a dataset by name example, however you used the name as examp in proc print procedure. so got that error. if you correct the name in proc print, you can avoid that error.
Is this what you wanted.
I believe this is a very minor issue and you might have easily identified it, i am think you have a different query, could you please elaborate your question with example.
03-12-2013 08:06 AM
I don't think you can trap an error in an oracle procedure like you want. You can look for the existence of a table prior to performing an operation on it (like printing or select * from.). I would suggest understanding what is causing the oracle procedure errors and trap them before executing the procedure.