Created
July 4, 2020 02:21
-
-
Save nickgs/b5ac19b71552984dbc5c2c801055586a to your computer and use it in GitHub Desktop.
Convert an RPGLE source member in OS/400 to a stream file with and .RPGLE extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PGM PARM(&LIB &MEMBER) | |
DCL VAR(&LIB) TYPE(*CHAR) LEN(20) | |
DCL VAR(&MEMBER) TYPE(*CHAR) LEN(20) | |
DCL VAR(&IPATH) TYPE(*CHAR) LEN(150) + | |
VALUE("/QSYS.LIB/") | |
/* You will want to change this to your required path */ | |
DCL VAR(&SPATH) TYPE(*CHAR) LEN(150) + | |
VALUE("/HOME/NICK/") | |
/* Build path to System I member */ | |
CHGVAR VAR(&IPATH) VALUE(&IPATH *TCAT &LIB) | |
CHGVAR VAR(&IPATH) VALUE(&IPATH *TCAT '.LIB/') | |
CHGVAR VAR(&IPATH) VALUE(&IPATH *TCAT "QRPGLESRC.FILE/") | |
CHGVAR VAR(&IPATH) VALUE(&IPATH *TCAT &MEMBER) | |
CHGVAR VAR(&IPATH) VALUE(&IPATH *TCAT ".MBR") | |
/* Build path to IFS member */ | |
CHGVAR VAR(&SPATH) VALUE(&SPATH *TCAT &MEMBER) | |
CHGVAR VAR(&SPATH) VALUE(&SPATH *TCAT ".rpgle") | |
/* Copy to stream file command */ | |
CPYTOSTMF FROMMBR(&IPATH) TOSTMF(&SPATH) STMFOPT(*REPLACE) + | |
CVTDTA(*AUTO) STMFCCSID(*STMF) + | |
STMFCODPAG(*PCASCII) /* Convert to stream file */ | |
endpgm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment