You are on the right track in trying to avoid a temporary intermediate outfile.
The tool you want in your arsenal is called a common table expression [CTE]. This a powerful technique that allows you build a complex SELECT statement as a series of logical building blocks.
Yours can be put together like this:
with f as
(
SELECT *
FROM astccdta.Oeinh48 a
JOIN astdta.IcDet1 b ON b.Itcom# = a.IhCom#
AND b.ItTrn# = a.IhIdc#
WHERE A.IHORDD > 20120101
AND b.ItTscc = 'I'
)
SELECT ItQty#,IhDocd,ItPRT#
FROM f -- this refers to the result set of the CTE above
JOIN astdta.icEct1 b ON b.CtCom# = f.ItCom#
AND b.CtPrt# = f.ItPrt#
AND b.CtCtr# = ' '
JOIN astdta.Audia d ON d.IAprt# = f.ItPrt#
WHERE a.IARCC9 > ''
ORDER BY d.IARCC9;
Additional note: Rather than use the STRSQL session options, you can easily use SQL itself to create an outfile. Just put a little wrapper around your query like this:
CREATE TABLE fileout as
(
-- your query goes here
)
WITH DATA;
Or if you wanted to add to an existing file
INSERT INTO fileout
-- your query goes here
;
By using SQL to write your results, rather than session settings, you have created a solution that can be run from other interfaces.