MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » February 2013

Re: how to copy dtaara text into a physical file



fixed

On 2/8/2013 3:36 PM, Stone, Joel wrote:
No 3rd party stuff. All internal.

Performing an ETL function, dropping the output files on a network folder.

Need to drop a single sentinel file on another network folder telling a network scheduler that the ETL files are ready to pick up.

I keep a data area showing the ETL start/end dates/times. I would like to send that data area contents as the sentinel file.

I am planning on RTVDTAARA into a CL var, then SQL INSERT that into a table to be dropped onto a network file via QNTC as the sentinel file.

Any better / simpler method?

Your choice seems pretty simple as it is. But for kicks, here's how to
do it in Rexx:

/* Test reading a data area and sending it to a table */

signal on error name command_error
signal on failure name command_error
signal on syntax name syntax_error

'RTVDTAARA BUCK/TRGDTAARA RTNVAR(&dtaara)'
insertStatement = 'insert into buck/sqltest1 (text) values('''dtaara''')'
address EXECSQL
EXECSQL 'set option commit=*none'
EXECSQL insertStatement
say 'SQLSTATE = ' sqlstate

exit

/* ---------------------------------------------------------------- */
command_error:

trace off

parse source system start srcmbr srcfile srclib
say 'Unexpected error at line 'sigl' of REXX program ',
srcmbr' in 'srclib'/'srcfile'. The exception ID is 'rc'.'

exit(right(rc,4))
/* ---------------------------------------------------------------- */
syntax_error:

trace off

parse source system start srcmbr srcfile srclib
say 'Syntax error at line 'sigl' of REXX program ',
srcmbr' in 'srclib'/'srcfile'. The error code is 'rc'.',
' The description is :'
say errortext(rc)

exit(rc)







Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact