Nice! That will also work on “PTF challenged” systems.

Jim Oberholtzer
Agile Technology Architects



On Aug 11, 2022, at 11:02 AM, Stephen Landess <steve_landess@xxxxxxxxxxx> wrote:

On the subject of file transfers, this is what I have been doing for a while now.

I use SEU to create SQL scripts in source members (old-fashioned, you know), and then run them with RUNSQLSTM.

1. Use SQL to create a work file in QTEMP.
2. Use CPYTOIMPF to copy the work file to a CSV file in the IFS.
3. use SNDSMTPEMM to send the CSV file to my company email address.

Example script:
==============

--
-- Show accounting dates for CO's in JE batches.
--
CREATE OR REPLACE VARIABLE SJL.$$EDTN1 CHAR(20) DEFAULT( '00251249');
CREATE OR REPLACE VARIABLE SJL.$$EDTN2 CHAR(20) DEFAULT( 'xxxxxxxx');
CREATE OR REPLACE VARIABLE SJL.$$EDTN3 CHAR(20) DEFAULT( 'xxxxxxxx');
CREATE OR REPLACE VARIABLE SJL.$$EDTN4 CHAR(20) DEFAULT( 'xxxxxxxx');
--
DROP TABLE QTEMP/CO_BEGFYPD ;

CREATE TABLE QTEMP/CO_BEGFYPD
( XXCO , CCDFYJ , CCPNC , GLDATE )
AS (
SELECT DISTINCT
VNCO
, CCDFYJ , CCPNC
, JDEDATE( CCDFYJ )
FROM F0911Z1

JOIN F0010
ON VNCO = CCCO

WHERE VNEDTN in ( SJL.$$EDTN1
, SJL.$$EDTN2
, SJL.$$EDTN3
, SJL.$$EDTN4
)
Order by 1

) with data ;
--
-- Copy to IFS
--
CL: ?CPYTOIMPF ??FROMFILE(QTEMP/CO_BEGFYPD)
??TOSTMF('/HOME/SLANDESS/JE/CO_BEGFYPD.CSV')
??MBROPT(*REPLACE)
??STMFCCSID(1208)
??STMFAUT(*INDIRFILE)
??RCDDLM(*CRLF)
??STRDLM(*NONE)
??RMVBLANK(*TRAILING)
??ADDCOLNAM(*SYS);

--
-- E-mail the files:
--
CL: ?QSYS/SNDSMTPEMM ??RCP((SLANDESS@xxxxxxx))
??SUBJECT('CO Beginning FY and Period')
??NOTE('CO_BEGFYPD = CO Beg FY and Current Period ')
??ATTACH(('/home/SLANDESS/JE/CO_BEGFYPD.CSV'));


Regards,
Steve Landess
(512) 289-0387
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

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.