What about if you had a unix directory call ../truefalse If the output of UD/UV program is good, then "touch ../truefalse/PID" If the output of UD/UV program is false, then "/bin/rm ../truefalse/PID"
then RUN BP $udtProgram ; cat ../truefalse/`method-of-returning-current-pid` I can't remember how to return your current PID. The idea is that if the UV program is ok, create a file so the cat command returns a 1 (successful), if the UV program output needs to be not ok then make the output of the cat command unsuccessfull (file non existant). George > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > [EMAIL PROTECTED] > Sent: Monday, November 17, 2008 10:09 AM > To: u2-users@listserver.u2ug.org > Subject: Re: [U2] Setting return code when a Universe process > terminates > > > We do something similar here. In a UNIX shell script we call > a Unidata > sub and capture the output into a log file. > > echo Running BP $udtProgram >> $logfilepath > $UDTBIN/udt<<EOD | tee -a $logfilepath > RUN BP $udtProgram -N > bye > EOD > > Any output from the Unibasic program will be captured. In > this case we > send it to the log and to standard output. If you could > limit the output > of the Unibasic sub to only the values, or messages you > wanted, you could > use DISPLAY to return them. A more experienced *nix person > might be able > to tell you how to pipe the output to a variable, or possibly > your perl > program could use the standard ouput of the shell program. > > Hope this helps. > > > > I'm trying to write some Universe programs that plug into an > > existing perl framework. For this to work these programs need to set > > the standard unix exit code to different values when these programs > > terminate. This will allow this framework to test for different > > error conditions. (The equivalent test in a ksh script would be on > > $?). What is the best way to make this work? Everthing I've tried > > returns 0. > > BRAD > >>I ended up using a shell script to call my UniBasic program > and pass in > a > >>location and name of an ascii file. The program determines > exit status > and > >>echoes it to the ascii file. > > Charles Shaffer > Senior Analyst > NTN-Bower Corporation > > > > > [EMAIL PROTECTED] > Sent by: [EMAIL PROTECTED] > 11/17/2008 07:20 AM > Please respond to u2-users > > > To: u2-users@listserver.u2ug.org > cc: > Subject: Re: [U2] Setting return code when a > Universe process terminates > > > Ian, I tried for a long time to figure out a way to do this > entirely from > within UD. Couldn't figure it out. I hit two walls. First, > the exit code > that nix receives is the status of the udt command. If you're > program runs > > at all, you get a '0'. The second wall was when I tried setting an > environment variable from within my code. The issue there is > that shelling > > out starts a new shell that is closed as soon as you return > to UD. The > only way I could make it work was to echo a status code to an > ascii file. > > I ended up using a shell script to call my UniBasic program > and pass in a > location and name of an ascii file. The program determines > exit status and > > echoes it to the ascii file. After the program completes, the > shell script > > checks the contents of the ascii file and does an 'exit #'. > I've had this > working for a couple years with no issues. I'd be willing to discuss > details off-list if you like. > > Brad > > > > > I'm trying to write some Universe programs that plug into an > > existing perl framework. For this to work these programs need to set > > the standard unix exit code to different values when these programs > > terminate. This will allow this framework to test for different > > error conditions. (The equivalent test in a ksh script would be on > > $?). What is the best way to make this work? Everthing I've tried > returns 0. > > U.S. BANCORP made the following annotations > --------------------------------------------------------------------- > Electronic Privacy Notice. This e-mail, and any attachments, contains > information that is, or may be, covered by electronic communications > privacy laws, and is also confidential and proprietary in > nature. If you > are not the intended recipient, please be advised that you > are legally > prohibited from retaining, using, copying, distributing, or otherwise > disclosing this information in any manner. Instead, please > reply to the > sender that you have received this communication in error, and then > immediately delete it. Thank you in advance for your cooperation. > > > > --------------------------------------------------------------------- > ------- > u2-users mailing list > u2-users@listserver.u2ug.org > To unsubscribe please visit http://listserver.u2ug.org/ > ------- > u2-users mailing list > u2-users@listserver.u2ug.org > To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/