RE: [U2] Setting return code when a Universe process terminates
Tony Said: >> Charles, you may be interested in mvExec. mvNet looks interesting, but we use Linux for all of our web servers. I could see it being useful for direct access from a Windows desktop though. Charles Shaffer Senior Analyst NTN-Bower Corporation --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Setting return code when a Universe process terminates
Thanks Tony. I'll check it out. Charles Shaffer Senior Analyst NTN-Bower Corporation --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Setting return code when a Universe process terminates
> From: Charles_Shaffer > I am interested in finding a way to get to the U2 data > more directly than we do currently, which is using a > Java Bridge and Uniobjects for Java. Charles, you may be interested in mvExec. It will execute any command or program on any MV system from anywhere in your network. In your case, you don't need to be concerned about connectivity. All exchanges with Universe are done by executing a local command and reading local files that contain the results. This can be used by any language or tools that you choose and there is no need to learn any new language or protocol. Example: DOS Command: mvexec mvreaditem Uses configuration file mvreaditem.mv0 in a local windows directory to read a customer record from a production server account. Results are stored in \temp. Config file has 4 lines written at runtime: productionserver<--- name any server here EXEC.GET.ITEM <--- call your own program here |CUSTOMERS|12345<--- data for the program c:\temp\mvreaditem.mv1 <--- store results here Software download and full documentation with code samples is on our Freeware page: remove.pleaseNebula-RnD.com/freeware mvExec is completely free and can be used by anyone who already has mv.NET installed. [AD] If you don't have mv.NET you can purchase a single license from Nebula R&D or any other mv.NET reseller. Once you have an inexpensive license it can be used for many other purposes. HTH Tony Gravagno Nebula Research and Development TG@ remove.pleaseNebula-RnD.com Nebula R&D sells mv.NET and other Pick/MultiValue products worldwide, and provides related development and training services --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Setting return code when a Universe process terminates
That is similar to what we are doing now, wxcept the web server is Linux so I use XMLHttpRequests to call a PHP module that calls a Java routine that uses Uniobjects for Java to get the results from Unidata. An open source product called JavaBridge is used to allow php to call Java. Works well, but pretty complex to setup. Thanks for the info. Charles Shaffer Senior Analyst NTN-Bower Corporation --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Setting return code when a Universe process terminates
Symeon, Thanks. I'll check it out. Charles Shaffer Senior Analyst NTN-Bower Corporation --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Setting return code when a Universe process terminates
Hi Any javascript will run in the browser and not on the server. What the javascript calls using XMLHttpRequest will exist on a server somewhere. XMLHttpRequest is the javascript DOM API that is the keystone of AJAX. You probably use that now to contact a webservice written in asp.net that then uses uniobjects to connect to u2. The same XMLHttpRequest call could also use my example php code to do a similar thing, but the php is fairly unsophisticated compared to uniobjects and will not work well if you have heavy load, no licences left etc + does not manage any pooling or device licencing. If you want to connect to a web page/service direct from within your asp.net - well here is a very simple example vb.net function to do just that - tho there are of course many ways to do this Private Function getWeb(ByVal url As String) As String Dim URI As Uri = New Uri(url) Dim webPage As String = String.Empty Dim WebRequest As HttpWebRequest = HttpWebRequest.Create(URI) WebRequest.Timeout = 8000 Try Dim WebResponse As WebResponse = WebRequest.GetResponse() Dim Stream As Stream = WebResponse.GetResponseStream() Dim StreamReader As StreamReader = New StreamReader(Stream) webPage = StreamReader.ReadToEnd Catch ex As WebException Err = ex.ToString End Try Return webPage End Function -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 18 November 2008 14:46 To: u2-users@listserver.u2ug.org Subject: RE: [U2] Setting return code when a Universe process terminates >> Using whatever programming language you run to power your iis web site >> asp/asp.net/php etc. Or your iis web server dishes up static html which has >> a script it in that contacts the u2 server via ajax. . I appreciate your patience. I'm relatively new to AJAX. I am interested in finding a way to get to the U2 data more directly than we do currently, which is using a Java Bridge and Uniobjects for Java. I've done XMLHttpRequests from clients using JavaScript. In this case, the IIS server is doing an XMLHttpRequest to the U2 server, right? It takes the request response from the U2 server and incorporates it into a page that is returned to the client. Is this server side JavaScript, or is there a way to do an XMLHttpRequest from ASP/PHP? Charles Shaffer Senior Analyst NTN-Bower Corporation --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.175 / Virus Database: 270.9.3/1786 - Release Date: 17/11/2008 17:24 No virus found in this outgoing message. Checked by AVG - http://www.avg.com Version: 8.0.175 / Virus Database: 270.9.3/1786 - Release Date: 17/11/2008 17:24 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Setting return code when a Universe process terminates
Sorry - in reply to your statement "I am interested in finding a way to get to the U2 data more directly than we do currently" Then perhaps what you should do is use the u2 web services module to write and deploy a simple webservice that runs a basic subroutine, and you then code your XMLHttpRequests to use that url rather than going through your java bridge. The stack would be Browser runs XMLHttpRequests -> u2 web services -> u2 subroutine -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 18 November 2008 14:46 To: u2-users@listserver.u2ug.org Subject: RE: [U2] Setting return code when a Universe process terminates >> Using whatever programming language you run to power your iis web site >> asp/asp.net/php etc. Or your iis web server dishes up static html which has >> a script it in that contacts the u2 server via ajax. . I appreciate your patience. I'm relatively new to AJAX. I am interested in finding a way to get to the U2 data more directly than we do currently, which is using a Java Bridge and Uniobjects for Java. I've done XMLHttpRequests from clients using JavaScript. In this case, the IIS server is doing an XMLHttpRequest to the U2 server, right? It takes the request response from the U2 server and incorporates it into a page that is returned to the client. Is this server side JavaScript, or is there a way to do an XMLHttpRequest from ASP/PHP? Charles Shaffer Senior Analyst NTN-Bower Corporation --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.175 / Virus Database: 270.9.3/1786 - Release Date: 17/11/2008 17:24 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Setting return code when a Universe process terminates
>> Using whatever programming language you run to power your iis web site >> asp/asp.net/php etc. Or your iis web server dishes up static html which has >> a script it in that contacts the u2 server via ajax. . I appreciate your patience. I'm relatively new to AJAX. I am interested in finding a way to get to the U2 data more directly than we do currently, which is using a Java Bridge and Uniobjects for Java. I've done XMLHttpRequests from clients using JavaScript. In this case, the IIS server is doing an XMLHttpRequest to the U2 server, right? It takes the request response from the U2 server and incorporates it into a page that is returned to the client. Is this server side JavaScript, or is there a way to do an XMLHttpRequest from ASP/PHP? Charles Shaffer Senior Analyst NTN-Bower Corporation --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Setting return code when a Universe process terminates
>> So the client browser requests a page from the IIS server and the IIS >> server requests myPage.php from the U2 server which causes the PHP >> processor on the U2 server to make the exec call to the UniBasic program. >> How do you normally make the page request from IIS? Using whatever programming language you run to power your iis web site asp/asp.net/php etc. Or your iis web server dishes up static html which has a script it in that contacts the u2 server via ajax. Having said that - if you want to call a unidata program from your iis powered web server I would do it in asp.net using uniobjects.net. But sometimes you want to bypass that layer and go direct which is why I have this little php script which is used for unit testing the backend part of our apps separate from the front end asp.net side. Symeon. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Setting return code when a Universe process terminates
>> So no rexec but to do it remotely you just call the web page >> from your other app/website/javascript etc. So the client browser requests a page from the IIS server and the IIS server requests myPage.php from the U2 server which causes the PHP processor on the U2 server to make the exec call to the UniBasic program. How do you normally make the page request from IIS? Charles Shaffer Senior Analyst NTN-Bower Corporation --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Setting return code when a Universe process terminates
Ahh subtle difference our udt box is A web server but not our main one. Our main web farm is based on win iis . Udt is on linux which comes with apache by default. So no rexec but to do it remotely you just call the web page from your other app/website/javascript etc. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 17 November 2008 17:22 To: u2-users@listserver.u2ug.org Subject: RE: [U2] Setting return code when a Universe process terminates Symeon, Nice. Since exec is used, your U2 server must also be your web server, right? In our environment here, the U2 server is a different machine than the web server. I wonder, is there and rexec equivalent in PHP and has anyone done this remotely? > $udtCmd="LANG=en_US.UTF-8;export LANGcd /usr/ud/accounts/$account;/usr/ud71/bin/udt RUN $BP $prog"; > $result = array(); > exec( $udtCmd, &$result); > foreach ( $result as $v ) > { > if (substr($v,0,6)=="!stat="){ > $stat=substr($v,6,10); > } > } Charles Shaffer Senior Analyst NTN-Bower Corporation --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.175 / Virus Database: 270.9.3/1786 - Release Date: 16/11/2008 19:58 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Setting return code when a Universe process terminates
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< 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
RE: [U2] Setting return code when a Universe process terminates
Symeon, Nice. Since exec is used, your U2 server must also be your web server, right? In our environment here, the U2 server is a different machine than the web server. I wonder, is there and rexec equivalent in PHP and has anyone done this remotely? > $udtCmd="LANG=en_US.UTF-8;export LANGcd /usr/ud/accounts/$account;/usr/ud71/bin/udt RUN $BP $prog"; > $result = array(); > exec( $udtCmd, &$result); > foreach ( $result as $v ) > { > if (substr($v,0,6)=="!stat="){ > $stat=substr($v,6,10); > } > } Charles Shaffer Senior Analyst NTN-Bower Corporation --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Setting return code when a Universe process terminates
Again a similar thing in php - I look for a certain string in the output and use that as a return code $udtCmd="LANG=en_US.UTF-8;export LANGcd /usr/ud/accounts/$account;/usr/ud71/bin/udt RUN $BP $prog"; $result = array(); exec( $udtCmd, &$result); foreach ( $result as $v ) { if (substr($v,0,6)=="!stat="){ $stat=substr($v,6,10); } } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 17 November 2008 15:09 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< 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/ No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.175 / Virus Database: 270.9.3/1786 - Release Date: 16/11/2008 19:58 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
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< 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/
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/