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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
DB2 Syntax Question
 Login/Join
 
Gold member
posted
Good Morning,

We are using the following syntax for DB2 hold files, however once in we cannot open the .fex back into the GUI. Not too big of a deal, just very annoying. Is there any other syntax we can use?

 
ON TABLE HOLD AS APP/MASNAME FORMAT DB2 TABLENAME AS400LIBRARY/DB2TABLENAME


Thank you!

John C.


WF 7703 Outputs all
Windows 7 32
DB2 CLI
 
Posts: 59 | Registered: August 09, 2012Report This Post
Virtuoso
posted Hide Post
Maybe just code it as the GUI would...
ON TABLE HOLD AS DB2TABLENAME FORMAT DB2

The sql connection that is active for DB2 will define what database to use.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Gold member
posted Hide Post
If we are working in our production library, then want to save a file in another library. Is there a syntax to use? Possibly a set value? I haven't been able to find anything on the topic searching the documentation and previous posts here.

Our production files are in Library A, however when we save files we only have authoirty over Library B.


WF 7703 Outputs all
Windows 7 32
DB2 CLI
 
Posts: 59 | Registered: August 09, 2012Report This Post
Member
posted Hide Post
We have the same scenario. We just created two different synonyms, one that points to LIB_A and one that points to LIB_B. The other way we've done this is to create an AS/400 stored procedure where we pass the library we want to use and the dataset we want and it does the insert/update to the appropriate table.


WF 7.7.02
iSeries/Windows
 
Posts: 8 | Registered: December 02, 2011Report This Post
Virtuoso
posted Hide Post
You could read the data with one db2 connection active, hold the data in a temporary intermediate file, change the db2 connection, read the intermediate file and hold it as DB2 in the new connection.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Gold member
posted Hide Post
quote:

You could read the data with one db2 connection active, hold the data in a temporary intermediate file, change the db2 connection, read the intermediate file and hold it as DB2 in the new connection.

GamP



GamP,

Do you happen to have an example with CARS? Would like to see how this is done. Appreciate the feedback!

JC


WF 7703 Outputs all
Windows 7 32
DB2 CLI
 
Posts: 59 | Registered: August 09, 2012Report This Post
Gold member
posted Hide Post
quote:
Originally posted by drbrown:
We have the same scenario. We just created two different synonyms, one that points to LIB_A and one that points to LIB_B. The other way we've done this is to create an AS/400 stored procedure where we pass the library we want to use and the dataset we want and it does the insert/update to the appropriate table.


drbrown,

Do you also have an example? Would like to see how your doing this on the WebFOCUS side.

Thank you!

JC


WF 7703 Outputs all
Windows 7 32
DB2 CLI
 
Posts: 59 | Registered: August 09, 2012Report This Post
Virtuoso
posted Hide Post
Example ... no, I have none at hand.
But it would be something like:
SQL SQLMSS SET DEFAULT_CONNECTION READ_DB
END
TABLE FILE WHATEVER
PRINT *
ON TABLE HOLD AS INBETWEEN FORMAT ALPHA
END
-RUN
SQL SQLMSS SET DEFAULT_CONNECTION WRITE_DB
END
TABLE FILE INBETWEEN
PRINT *
ON TABLE HOLD AS TABLENAME FORMAT MSSQL
END

Haven't tested this and I don't have DB2 nor AS400 to really help you.


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
The basic premise for writing to a DB2 table as a synonym is this:
SET ASNAMES = ON
TABLE FILE TABLE1
     FIELD1 AS 'DB2FIELDNAME2'
     FIELD1 AS 'DB2FIELDNAME2'
     ETC...
ON TABLE HOLD AS TEST
END

MODIFY FILE DB2TABLE
FIXFORM FROM TEST
DATA ON TEST
END  


For the DB2 stored procedure method, you create your stored procedure on the AS/400, and then you can create a synonym in WebFocus over that stored procedure. Then you do a join from your hold table in Webfocus to the stored procedure synonym and it will call the stored procedure for every record in the hold table. The beauty is that the stored procedure can be RPG, CL, SQL, REXX, Java etc. We have a lot of RPGLE stored procedures and the performance is amazingly fast. I can't show the exact code here, but if you need help with either method or creating stored procedures, let me know. I'd be happy to help.


WF 7.7.02
iSeries/Windows
 
Posts: 8 | Registered: December 02, 2011Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders