× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I hope you meant to type in V5R3 and not V3R3.

I - If you create the desired output file first, and query to the existing 
file, will it put it to the right format?
CREATE TABLE DOUGI(
MYKEY CHAR (1 ) NOT NULL WITH DEFAULT,
MYFLD1 DEC (5 , 2) NOT NULL WITH DEFAULT, 
MYFLD2 DEC (5 , 2) NOT NULL WITH DEFAULT)
INSERT INTO ROB/DOUGI VALUES('A', 2.3, 4.5)
CREATE TABLE ROB/DOUGO (
MYKEY CHAR (1 ) NOT NULL WITH DEFAULT, 
MYFLD1 DEC (15 , 5) NOT NULL WITH DEFAULT, 
MYFLD2 NUMERIC (7 , 3) NOT NULL  WITH DEFAULT)
WRKQRY
Output
File . . . . . . . . .   dougo
  Library  . . . . . .     ROB
Member . . . . . . . .   *FILE
Data in file . . . . .   4 
Nope, that won't work.

II - Convert your Query into SQL
INSERT INTO ROB/DOUGO
 SELECT * FROM dougi
 where ...
order by...
SELECT * FROM DOUGO
....+....1....+....2....+....3....+....
MYKEY                 FLD1        FLD2 
  A                2.30000       4.500 
********  End of data  ******** 

III - Leave your query as is.  Use CPYF from the output file to one 
formatted correctly.
WRKQRY
Output
File . . . . . . . . .   dougT
  Library  . . . . . .     ROB
Member . . . . . . . .   *FILE
Data in file . . . . .   4 
CPYF FROMFILE(DOUGT) TOFILE(DOUGO) MBROPT(*REPLACE) FMTOPT(*MAP *DROP)
SELECT * FROM DOUGO
....+....1....+....2....+....3....+....
MYKEY               MYFLD1      MYFLD2 
  A                2.30000       4.500 
********  End of data  ******** 


Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.