in one rpg source,i found "call QCLSCAN" ,then i found it exist in QSYS lib,but no source code of QCLSCAN. can anyone tell me what is QCLSCAN?(is that API???) , after "call QCLSCAN",what mean fo it's entrance Parameter ?
thx!
thx!
/* Command intervace to QCLSCAN API */ PGM PARM(&STRING &STRLEN &STRPOS &PATTERN + &PATLEN &TRANSLATE &TRIM &WILDCARD &RETURN) DCL &STRING *CHAR 999 DCL &STRLEN *DEC 3 DCL &STRPOS *DEC 3 DCL &PATTERN *CHAR 999 DCL &PATLEN *DEC 3 DCL &TRANSLATE *LGL DCL &TRIM *LGL DCL &WILDCARD *CHAR 1 DCL &RETURN *DEC 3 DCL &ABEND *LGL DCL &MSGDTA *CHAR 132 DCL &MSGID *CHAR 7 DCL &MSGF *CHAR 10 DCL &MSGFLIB *CHAR 10 MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ABEND)) CALL PGM(QCLSCAN) PARM(&STRING &STRLEN &STRPOS + &PATTERN &PATLEN &TRANSLATE &TRIM + &WILDCARD &RETURN) EXIT: RETURN /* NORMAL END OF JOB */ ABEND: IF COND(&ABEND) THEN(SNDPGMMSG MSGID(CPF9898) + MSGF(QCPFMSG) MSGDTA('Function check.') + MSGTYPE(*ESCAPE)) CHGVAR VAR(&ABEND) VALUE('1') DMPCLPGM /* Forward diagnostic messages from this program message queue to previous */ FORWARD: RCVMSG MSGTYPE(*DIAG) RMV(*NO) MSGDTA(&MSGDTA) + MSGID(&MSGID) MSGF(&MSGF) MSGFLIB(&MSGFLIB) IF (&MSGID ª= ' ') DO SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) + MSGDTA(&MSGDTA) MSGTYPE(*DIAG) GOTO FORWARD ENDDO RCVMSG MSGTYPE(*EXCP) RMV(*NO) MSGDTA(&MSGDTA) + MSGID(&MSGID) MSGF(&MSGF) MSGFLIB(&MSGFLIB) IF (&MSGID ª= ' ') DO SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) + MSGDTA(&MSGDTA) MSGTYPE(*ESCAPE) ENDDO ENDPGM
Required Parameter Group Character string INPUT;CHAR(*) A character field from 1 through 999 characters that contains the string to be scanned for the pattern. Length of character string INPUT;PACKED(3,0) The length of the string to be scanned. If this length is greater than the actual length of the string, unexpected results can occur. Starting position INPUT;PACKED(3,0) The position in the string where the scan is to start. The position must be greater than zero and not greater than the string length. Normally this value is 1. If the same string has multiple sets of patterns, this allows the string to remain the same while only the start position is varied to find the additional patterns. Character pattern INPUT;CHAR(*) The pattern being scanned for. Length of character pattern INPUT;PACKED(3,0) The length of the pattern. If this length is greater than the actual length of the pattern, unexpected results can occur. Translate characters INPUT;CHAR(1) A variable that indicates to translate lowercase characters in the specified character string to uppercase characters. If this field contains a 1, the program translates lowercase characters of the string to uppercase before the scan using the coded character set identifier (CCSID) for the current job. If the translation cannot be done using the CCSID for the job, *CCSID37 is used. This does not change the user's data. Note that if 1 is specified and the pattern contains lowercase characters, a match never occurs. If 1 is specified, and the data to be searched contains noncharacter data (for example, packed or binary), unexpected results can occur. Trim trailing blanks INPUT;CHAR(1) A fixed-length pattern field filled (left-justified) by a variable number of characters. If this variable contains a 1, trailing blanks are trimmed from the end of the pattern before the scan is started. Wildcard character INPUT;CHAR(1) A variable that you can specify in the pattern, in positions that should not be tested when scanning for a match. When this character appears in the pattern, any character in the data is considered a match. A value of blank indicates that all characters of the pattern take part in the scan. If the wildcard character is the first character in the pattern, an error will occur. Character string result OUTPUT;PACKED(3,0)
Comment