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.
Hi All, I am trying to do a remote to our AS/400 to use native SQL and its not working. here is the syntax I am sending:
-SET &ECHO= 'ALL';
-*APP MAP FOCHOLD C:\Inetpub\wwwroot\Output_Hold\
-*APP HOLD FOCHOLD
-DEFAULT &OUTPUT = 'HTML';
-DEFAULT &TIMELINE = 'WTD';
-DEFAULT &report_date = '20060114';
-DEFAULT &report_date_month = '01';
-DEFAULT &report_date_day = '14';
-DEFAULT &report_date_year = '06';
-*
-*
-**********************************************************************************
-*SET REPORT OUTPUT
-SET &HLD = '-*';
-IF &OUTPUT EQ 'REPORT' GOTO SKIPHOLD;
-SET &HLD = IF &OUTPUT EQ 'PDF' THEN 'ON TABLE PCHOLD FORMAT PDF'
- ELSE IF &OUTPUT EQ 'EXL2K' THEN 'ON TABLE PCHOLD FORMAT EXL2K'
- ELSE &HLD ;
-SKIPHOLD
-*GET CALENDAR DATA
-IF &report_date = '$*' GOTO SKIP_DT;
-IF &report_date = ' ' GOTO SKIP_DT;
-SET &report_date_month = EDIT(&report_date, '$$$$99$$');
-SET &report_date_day = EDIT(&report_date, '$$$$$$99');
-SET &report_date_year = EDIT(&report_date, '$$99$$$$');
DEFINE FILE CALMST
REPORT_DATE/I6 = &report_date - 20000000;
END
REMOTE DEST = ******;
REMOTE USER = ******;
REMOTE PASS = ******;
-MRNOEDIT BEGIN
-REMOTE BEGIN
SQL
SELECT MIN((CALFYR*1000000)+(CALFMT*10000)+(CALFWK*100)+CALFDY)
,MAX((CALFYR*1000000)+(CALFMT*10000)+(CALFWK*100)+CALFDY)
FROM CALMST
-IF &TIMELINE NE 'LTD' GOTO SKIP_LTD;
;
-GOTO SKIPP;
-SKIP_LTD
-IF &TIMELINE NE 'YTD' GOTO SKIP_YTD;
WHERE CALYER = (&report_date_year);
-GOTO SKIPP;
-SKIP_YTD
-IF &TIMELINE NE 'MTD' GOTO SKIP_MTD;
WHERE CALYER = (&report_date_year) AND CALMTH = (&report_date_month);
-GOTO SKIPP;
-SKIP_MTD
-IF &TIMELINE NE 'WTD' GOTO SKIP_WTD;
-**WHERE CALYER = (&report_date_year) AND
-**CALMTH = (&report_date_month) AND
-**CALDAY = &report_date_day;
WHERE WEEK(TRIM(CHAR(CALMTH)) || '/' || TRIM(CHAR(CALDAY)) || '/'
|| TRIM(CHAR(2000 + CALYER))) = WEEK('01/14/2006') AND CALYER = &report_date_year;
-GOTO SKIPP;
-SKIP_WTD
-SKIPP
END
-REMOTE END
-MRNOEDIT END
and it generates the following error:
(FOC14067) STATEMENT CONTAINS UNKNOWN SCALAR FUNCTION 'WEEK'
(FOC1400) SQLCODE IS 14067 (HEX: 000036F3)
: STATEMENT CONTAINS UNKNOWN SCALAR FUNCTION 'WEEK'
L (FOC1405) SQL PREPARE ERROR.
-*-MRNOEDIT END
I am under the assumption that -remote sends the SQL to the remote server without checking the SQL syntax. I want the AS400 to execute the SQl so can use the WEEK function in the where clause.This message has been edited. Last edited by: Lloyd,
Lloyd Prendergast Michael Kors (USA), Inc. Phone: 201-453-5076 Fax: 646-354-4776 Lloyd.Prendergast@Michaelkors.com
It looks as though that scalar function is not supported via WF. This is from the iWay SQL Reference manual -
The following scalar functions for queries that are candidates for Dialect Translation if the RDBMS engine supports the scalar function type: CHAR, DATE, DAY, DAYS, DIGITS, HEX, HOUR, LENGTH, MICROSECOND, MINUTE, MONTH, SECOND, TIME, TIMESTAMP, VALUE, VARGRAPHIC, and YEAR.
Also, it looks as though you have a spurious END in your code snippet.
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
if the code works on your host, then run it on and from your host. use a remote call to execute the host-resident fex, and not pass the entire server-resident fex up to the host.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003