|
Well, there's nothing wrong with creating your temp file this way, but there's a catch.... Native I/O requires too much work... If I were doing this, I'd make the choice to perform ALL I/O operations to this file via embedded SQL. A single statement could be constructed to build the QTEMP file and populate it with data. That could look something like this: CREATE TABLE QTEMP/MYTEMPDTA AS ( Select OH.Cust#, CM.CstName, CM.B2City, CM.B2State, OH.TtlDue From OrderHdr OH inner join CustMast CM on (OH.Cust#=CM.Cust#) Where OH.PaidFlag <> 'Y' ) WITH DATA Your SQL inside the "Create table as" statement can be any valid select statement, including statements using CTE expressions. There has been some discussion of late about CTE's, so check the archives if you're not familiar with them... Anyway, this is quite powerful when done properly... HTH, Eric -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of mcrangle@xxxxxxxxxxxxxxxxxxxx Sent: Tuesday, November 14, 2006 9:07 AM To: rpg400-l@xxxxxxxxxxxx Subject: SQL Create table Instead of using the CRTDUPOBJ for work files in qtemp I'm trying this... C/EXEC SQL C+ CREATE TABLE QTEMP/LLM43CWK C+ (PART CHAR (8), C+ DESC CHAR (25), C/END-EXEC Where should this file be declared, external data structure? I've tried using an F Spec, but the compiler cannot resolve the file as it isnt there. Hope this makes sense Many thanks
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.