As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
How can I pass error code generated in FOCUS (&FOCERRNUM or &RETCODE ) error code as to UNIX Shellscript? Basically I want to trap FOCUS errors while executing focus programs from UNIX shellscript.
Here is code in my shellscript. I have created error condition in my FOCUS program so that it will throw error but I am not able to catch that error in shellscript?
Also how do we pass error code to Windows BatchFile?
Thanks
#-----------Shell Script---------------- cd /eda/ibi/focexecs/prodcomm
Does your perl script returns you value in $? Also when you are scanning log which I belive you mean is edaprint.log, How do you make sure that error is not from other program and everything is kosher?
The edaprint log is worthless, and edastart does not return a useful return code (as you've discovered). Here's a simple example that includes a test fex that has an error in it, and a perl script that runs edastart and captures the error.
TABLE FILE CAR PRINT COUNTRSYDSD END -RUN
#!/usr/bin/perl -w use strict; use English;
my $logfile = 'test.log';
my $rc = system(qq(/path/to/edastart -x "ex test" > $logfile));
my $focerr = scanlog($logfile);
print "rc: $rc focerr: $focerr\n";
sub scanlog { my $logfile = shift(@_);
my $focerr = 0;
open IN, "X$logfile" or die "Could not open $logfile: $ERRNO\n";
while (my $line = <IN> { chomp $line;
next if (!($line =~ m/\(foc(\d+)\)/io)); # Got a (FOCnnnn) error?
$focerr = $1;
last; }
close IN;
return $focerr; }
BTW, You'll have to change the 'X' in "X$logfile" to a "less than" character due to this persnickety bulletin board software. Grrrrrrr. HTH, -James
Posts: 83 | Location: Dartmouth Hitchcock Medical Center | Registered: April 17, 2003