Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Empty HOLD file when running .fex via Unix script

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Empty HOLD file when running .fex via Unix script
 Login/Join
 
Member
posted
I have a .fex that contains an execute of a stored procedure. The .fex produces a report with data if I run in Report Caster, or in Developer Studio. An empty report (empty hold file) is produced if I run the same .fex from a Unix command line.

The .t3o (output file) shows a count of rows that are retrieved in the SQLOUT step. But, then the Print step indicates there are no rows to print.

Any thoughts on why the hold file is empty when the .fex is run via Unix script?

My code structure looks like this.....

ENGINE SQLMSS SET DEFAULT_CONNECTION ICMS
SQL SQLMSS EX ICMS_TEST.dbo.SP_Cases_Changed_SLCT ;
-RUN

TABLE FILE SQLOUT
PRINT CASEID
OPENDATE
CASETYPE
.
.
.
ON TABLE PCHOLD AS STOR
END
-RUN

DEFINE FILE STOR
OPENDT/MDYY = HDATE(OPENDATE,'MDYY')
END

SET EMPTYREPORT = ON
-RUN

TABLE FILE STOR
PRINT
CASEID AS 'Case ID'
OPENDT AS ' Case,Open Date'
RISK/P16.2M AS 'Exposure'
LOCATION AS 'Location'
L3 AS 'Region'
.
.
.
ON TABLE PAGE-BREAK
HEADING
FOOTING BOTTOM
ON TABLE HOLD FORMAT PDF
 
Posts: 8 | Registered: August 06, 2007Report This Post
Virtuoso
posted Hide Post
I don't use what your saying, however, it would probably be helpful if you showed how you were trying to execute from a unix command line.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Expert
posted Hide Post
msands,

We do this with our stored procs:

  
SQL SQLMSS SET SERVER &CONNECTION
SQL SQLMSS EX Impact.dbo.PS_WF_GetPaidBilledAdjustedAmounts '&FROMDATE.EVAL', '&TODATE.EVAL', '&DATETYPE.EVAL', &CUSTKEY.EVAL;
-RUN

TABLE FILE SQLOUT
PRINT *
IF RECORDLIMIT EQ 10
  ON TABLE HOLD AS XSQLOUT
END
-RUN
-*------------------------------------------------------------------------
-* Check the record count, database error and focus error and display
-* relevant message.
-*------------------------------------------------------------------------
-IF &LINES EQ 0 OR &FOCERRNUM NE 0 OR &RETCODE NE 0 GOTO DISPMSG;
-*------------------------------------------------------------------------


Also, your DEFINE field OPENDT/MDYY = HDATE(OPENDATE,'MDYY')
should always end with a semi-colon: OPENDT/MDYY = HDATE(OPENDATE,'MDYY');

Another idea is:

-SET &ECHO=ALL;

This will allow you to see any errors being generated...

Have fun!!


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
I think Leah has already hit on the main question. How are you executing a fex from the command line? If you are using the edastart /x to open a session and execute the fex, remember that your hold files, unless otherwise specified, go into temp directories which are cleaned up at the end of the session. Since the /x option runs the fex and closes the session, you would not have a HOLD file after the script has completed.

If this is the case you could redirect the output using a FILEDEF or one of the APP command like APP HOLD. This would put your hold file outside of the temporary workspace and it would still exist after the WF session has closed.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Virtuoso
posted Hide Post
quote:
PCHOLD


Shouldn't this be just HOLD?


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Member
posted Hide Post
Yes, it should be HOLD. Thanks

quote:
Originally posted by GamP:
quote:
PCHOLD


Shouldn't this be just HOLD?
 
Posts: 8 | Registered: August 06, 2007Report This Post
Member
posted Hide Post
I have a Unix script (ic005_test.ksh) that contains a statement to execute a .t3i file which contains the program name to run and needed parameters. The script looks like this:

----------------------------------------------------------------
Begin example code

# Execute the .t3i (contains the program and parameters)
$EDACONF/bin/edastart -f $USCRIPTS/ic005_internal <-----------ic005_internal is the t3i file to execute

errcheck=$?

#Check to see if the hold.pdf file is empty
if [ ! -s hold.pdf ]
then
echo "ICM080340E STEP0210 File Empty: hold.pdf,$scriptName:"
$USCRIPTS/s_stats.ksh $scriptName STEP0210 FAILED File empty
exit 1
fi

End example code
-------------------------------------------------------------------


EDACONF=/app/ibi_dev7/ibi/srv71/wfs

On the command line (path = /app/ibi_dev7/ibi/apps/icms) I type: ./ic005_test.ksh to execute the script.

Thank you.

quote:
Originally posted by Darin Lee:
I think Leah has already hit on the main question. How are you executing a fex from the command line? If you are using the edastart /x to open a session and execute the fex, remember that your hold files, unless otherwise specified, go into temp directories which are cleaned up at the end of the session. Since the /x option runs the fex and closes the session, you would not have a HOLD file after the script has completed.

If this is the case you could redirect the output using a FILEDEF or one of the APP command like APP HOLD. This would put your hold file outside of the temporary workspace and it would still exist after the WF session has closed.
 
Posts: 8 | Registered: August 06, 2007Report This Post
Virtuoso
posted Hide Post
Has this tecnique ever worked and just stopped working (or won't work for this job) or are you in the process of trying to get it to work for the first time. If other jobs work using the technique, it would be interesting to compare it to others.

My understanding is that the -f option takes input from a .t3i file and outputs to a .t3o file. You have specified the input file but not the output file (such as $USCRIPTS/hold) Also, instead of HOLD FORMAT PDF, just use SET ONLINE-FMT PDF, which I suppose would allow it to be written out to the hold file instead of held on the server (in temp space and then cleaned up.)

I personally have not used the -f option, so this may be alot of hot air, but it may give you some ideas. I still think the main issue is that the output file is going to temp space and when the edastart process finishes, it removes all temp files.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Master
posted Hide Post
Yes, this technique works. I have about 100 jobs where I use this. Darin has the right answer. Somehow, in the fex, you have to do one of the following to save the output:
  • FILEDEF the output file a a permanent location
  • Use APP HOLD to create the file in a permanent location
  • Use -UNIX cp or -UNIX mv to copy/move the file from the temp folder to a permanent location.

For example, if the file to be save is report.pdf (HOLD AS REPORT FORMAT PDF), just issue:

-UNIX mv report.pdf /pathname/baseapp

I've used all 3 methods and they work just fine. The only thing to be aware of is that if there are two jobs running at the same time using this method, they will use the same temp folder unless you do something extra.

What I do is I have a application folder named temp under ibi/apps. My script creates a temp folder named /ibi/apps/temp/fexname. The folder is then deleted when the job completes. If the same job can run more than once (in our environment, this cannot happen), just create a folder named /ibi/apps/temp/fexname_runtime.

If you are an old FOCUS user, .t3o file contains the SYSPRINT messages, not the output from the procedure.

This message has been edited. Last edited by: jgelona,


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Master
posted Hide Post
"If you are an old FOCUS user, .t3o file contains the SYSPRINT messages, not the output from the procedure."

I guess I should add that what is in the .t3o file is everything that would normally go to the screen (SYSPRINT). So if you just print a report but don't redirect it to a file, the report will be in the .t3o.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Empty HOLD file when running .fex via Unix script

Copyright © 1996-2020 Information Builders