The SPLIT() built-in functions reads the Session Variable and returns the text up to the separator and then remove the data including the separator from the Session Variable.
The SPLIT() built-in function reads characters from the Session Variable until it detects the character(s) specified on the Separator parameter or hits the end of the value.
The input Session Variable is reduced by the same set of characters.
-- This routine extracts the Library, File and Member names along with the SEU Type #define &source = QGPL/QRPGLESRC(DEMO.RPGLE) eval &srclib = split(&source,"/().,"); eval &srcFile = split(&source,"/().,"); eval &srcMbr = split(&source,"/().,"); eval &srcType = split(&source,"/().,"); #Msg Source Mbr: &srcMbr SEU(&srcType) in &srclib/&srcfile
The &SOURCE session variable contains a qualified file with a member and SEU type. To extract the individual elements of this name, the SPLIT built-in function is called once for each value.
The output written to the joblog would be:
Source Mbr: DEMO SEU(RPGLE) in QGPL/QRPGLESRC