tag:blogger.com,1999:blog-7650953985627040991.post9159893678441096244..comments2024-02-14T05:30:55.538-05:00Comments on Cameron's Blog For Essbase Hackers: No Exit (but not in MaxL)Cameron Lackpourhttp://www.blogger.com/profile/07701786303677521318noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-7650953985627040991.post-57040350422829073882018-02-28T18:21:30.380-05:002018-02-28T18:21:30.380-05:00Hi,
I am using $? to capture MAXL error in shell....Hi,<br /><br />I am using $? to capture MAXL error in shell. But $? returns value 'zero' even though it fails at the first step(Login $1 $2 on $3;)<br /><br />Please suggest.<br /><br />login $1 $2 on $3;<br />IFERROR 'errLogin';<br />spool stderr off;<br />EXIT 0<br /><br />define label 'errLogin';<br />echo "*******";<br />logout;Ronaldhttps://www.blogger.com/profile/12291144717546175427noreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-32671597767422281302018-02-28T18:17:47.526-05:002018-02-28T18:17:47.526-05:00Hi,
I am using $? to capture the return value of ...Hi,<br /><br />I am using $? to capture the return value of MAXL.<br />But even though my MAXL is failing in the fist step(login $1 $2 on $3;) , I am getting $?=0.<br /><br />Please suggest.<br /><br />My code<br />--------<br /><br />login $1 $2 on $3;<br />IFERROR 'errLogin';<br />spool stderr off;<br />EXIT 0<br /><br />define label 'errLogin';<br />echo "*******";<br />logout;Ronaldhttps://www.blogger.com/profile/12291144717546175427noreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-64195821099221561402014-07-22T16:22:00.066-04:002014-07-22T16:22:00.066-04:00Will the iferror function generate an error when a...Will the iferror function generate an error when a calc script exists, but fails when it is run? I'm looking to pass an exit status to a parent shell script if a calc script fails when the MaxL calls it.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-55450139287059610632012-10-23T14:47:07.350-04:002012-10-23T14:47:07.350-04:00Issam,
I am guessing you searched this, but the L...Issam,<br /><br />I am guessing you searched this, but the Linux equivalent appears to be $?<br /><br />Regards,<br /><br />Cameron LackpourCameron Lackpourhttps://www.blogger.com/profile/07701786303677521318noreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-25665625966777719632012-09-27T23:24:10.687-04:002012-09-27T23:24:10.687-04:00Hi Cameron,
I'm using Linux scripting to call...Hi Cameron,<br /><br />I'm using Linux scripting to call MAXL scripts. In Maxl scripts, I'm trapping errors at every level of the code (login, CALC,...) with different error codes. Is there a way to send the trapped error to the linux script ? If yes , how this can be accomplished. I know from windows side, interactively, we can intorrogate the variable %errorlevel% but I don't know if there is a such equivalent in Linux and if there is something that can be used in Linux scripting to do such verification.<br /><br />Thx for your help.<br /><br />IssamAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-5034336059839612072012-04-13T12:49:25.592-04:002012-04-13T12:49:25.592-04:00That is f***ing awesome! I had no idea that was p...That is f***ing awesome! I had no idea that was possible.<br /><br />Just to translate that, if you do in Windoze:<br />import blahblahblah on error write to "c:\\\\bozo.txt" ;<br />shell("dir c:\bozo.txt") ;<br />iferror "NotReallyAnErrorAtAll" ;<br />goto "OhYesThereWasAnError" ;<br /><br />This works because Windows returns %errorlevel% as 1 if the file doesn't exist, and 0 if it does. So an error isn't really an error at all. <br /><br />I am stealing this for my KScope12 "Script or Die!" presentation and giving you all the credit. <br /><br />That technique totally made my day. Thanks for posting it.<br /><br />Regards,<br /><br />Cameron LackpourCameron Lackpourhttps://www.blogger.com/profile/07701786303677521318noreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-76813408346550882812012-04-13T12:39:12.533-04:002012-04-13T12:39:12.533-04:00Sorry -- I was on my phone -- Anon is Tim Faitsch....Sorry -- I was on my phone -- Anon is Tim Faitsch. What I'm trying to say is that you can do the dataload or dim build -- you still probably want to do an iferror in case it can't find the file or can't connect to sql source. Once the import command is done, you do a shell command like so:<br /><br />----<br />Shell("cat filename.txt")<br />iferror "this_actually_means_everything_is_okay"<br />goto "this_means_there_were_rejects"<br />----<br /><br />In 11.1.2 you can catch the error code from a shell command. Just check to see if the file exists, if it doesn't exist you're good, if it does exist you can handle it. I know it sounds backward but I'm not sure how to trigger an error looking for a file that does exist. Anyway, this functionality doesn't work in, say, 11.1.1.3 but it does in 11.1.2. If you notice the tech ref, it's much more robust on the subject in 11.1.2 than 11.1.1.3.TimFhttps://www.blogger.com/profile/05962713873726067372noreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-56321658850526066252012-04-13T11:44:34.236-04:002012-04-13T11:44:34.236-04:00>>You can write to the log without the abort...>>You can write to the log without the abort and use the shell commAnd to check for the existence of the error file -- very easily done in 11.1.2.<br />^^^A *different* Anonymous? Who can tell?<br /><br />Assuming I'm continuing this conversation you're quite right and in fact this has been available as long as there has been a MaxL. <br /><br />However, once you write to an error file, you cannot trap it with iferror as I wrote in the blog. It sure would be nice if you could because otherwise, as you note, you must write a trapping routine in your calling code. That's not impossible (it's actually fairly easy) but it is Yet Another Step.<br /><br />Again, come to KScope12 and see me do just the above in ODI (you could do it anywhere).<br /><br />Regards,<br /><br />Cameron LackpourCameron Lackpourhttps://www.blogger.com/profile/07701786303677521318noreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-84123838570030492272012-04-13T00:55:45.997-04:002012-04-13T00:55:45.997-04:00You can write to the log without the abort and use...You can write to the log without the abort and use the shell commAnd to check for the existence of the error file -- very easily done in 11.1.2.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-8719184316403871112012-04-12T13:14:16.389-04:002012-04-12T13:14:16.389-04:00Dear Anon,
When you use on error abort, MaxL will...Dear Anon,<br /><br />When you use on error abort, MaxL will not write to an error file, so yes, you will know it failed, but not *what* failed. So then you would have to run the import interactively whilst piping the errors to a log file and *then* know what failed. It's a right pain.<br /><br /><br />Warning -- two shameless plugs follow.<br /><br />What I did in my chapter of Developing Essbase Applications is use ODI to interrogate file length/existence and then decide what to do about the error. Come see me at KScope12 when I talk about this. I'm also going to have an Essbase Beginner's session called (I hope the name has been changed) "Script or Die!".<br /><br />Regards,<br /><br />Cameron LackpourCameron Lackpourhttps://www.blogger.com/profile/07701786303677521318noreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-56289936549831758682012-04-12T12:45:34.573-04:002012-04-12T12:45:34.573-04:00Essmsh can trap data and dimension load errors. Y...Essmsh can trap data and dimension load errors. You just need to add "on error abort". You should be able to trap that an error file exists using shell commands too.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-90060169421625823552011-06-22T12:35:24.453-04:002011-06-22T12:35:24.453-04:00Ana,
I was a little confused by your question as ...Ana,<br /><br />I was a little confused by your question as it doesn't relate to this post, but I'll try to answer regardless.<br /><br />It *looks* like your MaxL (I am guessing MaxL, it could be directly from EAS) is failing because you are passing bad SQL authentication information, i.e., your id or password is bad.<br /><br />HTH, <br /><br />Cameron LackpourCameron Lackpourhttps://www.blogger.com/profile/07701786303677521318noreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-25018672561952667092011-06-21T22:44:14.734-04:002011-06-21T22:44:14.734-04:00Hi,
can you help me?
I got this error on essbase...Hi,<br /><br />can you help me?<br /><br />I got this error on essbase:<br /><br /> OK/INFO - 1021013 - ODBC Layer Error: [S1000] ==> [[DataDirect][ODBC Oracle Wire Protocol driver]TNS-12154: TNS:could not resolve the connect identifier specified].<br /> OK/INFO - 1021014 - ODBC Layer Error: Native Error code [0] .<br /> ERROR - 1021001 - Failed to Establish Connection With SQL Database Server. See log file for more information.<br /> ERROR - 1241101 - Unexpected Essbase error 1021001.<br /><br />thanks.<br /><br />Ana MariaAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-29664524018570392632011-06-10T10:05:22.851-04:002011-06-10T10:05:22.851-04:00Tim and Jared,
Thanks for your kind words.
Witho...Tim and Jared,<br /><br />Thanks for your kind words.<br /><br />Without getting embarrassingly mushy, let me just say that to hear praise from guys like you is really, really gratifying.<br /><br />Regards,<br /><br />Cameron LackpourCameron Lackpourhttps://www.blogger.com/profile/07701786303677521318noreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-67798523677146708332011-06-10T10:02:24.426-04:002011-06-10T10:02:24.426-04:00Thanks Cameron, very clear. Will have plenty of o...Thanks Cameron, very clear. Will have plenty of opportunity to use this.<br /><br />I was wondering why they didn't they implement...<br /><br />IFERROR EXIT 10;<br /><br />...until I got to your remarks about reenabling connects etc. Good stuff!TimGnoreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-13795465574629568922011-06-10T09:03:19.584-04:002011-06-10T09:03:19.584-04:00Cameron,
Very informative post! Thanks!Cameron,<br /><br />Very informative post! Thanks!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-20532828767035776232011-06-10T07:25:50.107-04:002011-06-10T07:25:50.107-04:00Sebastien,
I'm glad you liked it.
I'm a...Sebastien,<br /><br />I'm glad you liked it. <br /><br />I'm a big fan of Rififi. Getting Jules Dassin into a post would be hard, even for me, so I used Sartre. :)<br /><br />I know these references are silly, but the subjects can be so dry. And sometimes people even know what I'm talking about. :)<br /><br />Regards,<br /><br />Cameron Lackpour<br /><br />P.S. Interesting looking book -- pity my French never went beyond four years.Cameron Lackpourhttps://www.blogger.com/profile/07701786303677521318noreply@blogger.comtag:blogger.com,1999:blog-7650953985627040991.post-64216467702828373972011-06-10T06:15:12.604-04:002011-06-10T06:15:12.604-04:00Great post Cameron, as far as I can see you're...Great post Cameron, as far as I can see you're preparing yourself and your French for your next book review (http://bit.ly/lynbuZ) btw it could have been named "Born a four of July"...srxhttps://www.blogger.com/profile/07171491730419232141noreply@blogger.com