|
You're right, Loyd - I'm so into using QMQRY that I forget about INSERT INTO. But STRQMQRY would create the file if it does not exist, with (I hope) the right record length - unless it uses variable length. <g> Later Vern At 04:07 PM 11/6/2002 -0600, you wrote:
Thanks for jumping in, Vern, I was in a meeting for the past hour.... I do think that the below can be used with RUNSQLSTM, if you do the following: CRTPF FILE(MYFILE) RCDLEN(82) In this example, the real record length is 80, with 2 positions for CRLF. Then, do this in the RUNSQLSTM: Insert into MYFILE (MYFILE) ( select /* first part */ AAA1 concat /* numeric part, right justify with floating left - sign */ /* this is the leading blanks - 10 because 8,2 */ /* can have a decimal AND an optional sign */ substr(cast(' ' as char(10)),1, 10 - length(strip(char(BBB2), b, ' '))) concat /* the number itself with decimal, lefthand sign, */ /* and denuded of blanks */ strip(char(BBB2),b,' ') concat /* text */ CCC3 concat /* CRLF */ x'0d25' from yourlib/yourfile ) Then, do a CPYTOSTMF, specifying ENDLINFMT(*FIXED). Loyd
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.