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
March 14, 2008, 09:40 AM
Leah
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
March 14, 2008, 11:03 AM
Tom Flynn
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...
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
March 14, 2008, 01:13 PM
GamP
quote:
PCHOLD
Shouldn't this be just HOLD?
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
March 14, 2008, 02:40 PM
msands
Yes, it should be HOLD. Thanks
quote:
Originally posted by GamP:
quote:
PCHOLD
Shouldn't this be just HOLD?
March 14, 2008, 03:00 PM
msands
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.
March 14, 2008, 03:33 PM
Darin Lee
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
March 17, 2008, 12:59 PM
jgelona
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.
March 18, 2008, 08:48 AM
jgelona
"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.