I've been away from an As400 for about 4yrs. But what I need is a confirmation that the following can be done. I need to take a spool file and instead of printing it make it a file that can be pulled into a database and then indexed. I think I can just use ODBC to move the physical file from the 400 to the database, but the code from taking a spool file to a file that is 'indexable' (not a real word) is what I need to do. Will this code do it?
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+
NEWFLDSUB: PGM
DCL VAR(&DOC) TYPE(*CHAR) LEN(8)
DCL VAR(&USER) TYPE(*CHAR) LEN(10)
RTVJOBA USER(&USER)
CHGVAR VAR(&DOC) VALUE(%SST(&USER 1 8) +
*TCAT '.TXT')
CRTPF FILE(QTEMP/TEMPFL) RCDLEN(150)
CPYSPLF FILE(YOURSPLF) TOFILE(QTEMP/TEMPFL) +
SPLNBR(*LAST) CTLCHAR(*FCFC)
ENDCLP: ENDPGM
...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+
NEWFLDSUB: PGM
DCL VAR(&DOC) TYPE(*CHAR) LEN(8)
DCL VAR(&USER) TYPE(*CHAR) LEN(10)
RTVJOBA USER(&USER)
CHGVAR VAR(&DOC) VALUE(%SST(&USER 1 8) +
*TCAT '.TXT')
CRTPF FILE(QTEMP/TEMPFL) RCDLEN(150)
CPYSPLF FILE(YOURSPLF) TOFILE(QTEMP/TEMPFL) +
SPLNBR(*LAST) CTLCHAR(*FCFC)
ENDCLP: ENDPGM