× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Here's an example of what indented code looks like. I find this fairly readable. It is actually part of the CPP for the CL indent command.

DCL VAR(&BGNCOL) TYPE(*DEC) LEN(2 0)
DCL VAR(&CVTCASE) TYPE(*CHAR) LEN(6)
DCL VAR(&INDCOL) TYPE(*DEC) LEN(1 0)
DCL VAR(&INDCONT) TYPE(*DEC) LEN(1 0)
DCL VAR(&INDRMKS) TYPE(*CHAR) LEN(4)
DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(80)
DCL VAR(&MSGF) TYPE(*CHAR) LEN(10)
DCL VAR(&MSGFLIB) TYPE(*CHAR) LEN(10)
DCL VAR(&MSGID) TYPE(*CHAR) LEN(7)
DCL VAR(&OUTPUT) TYPE(*CHAR) LEN(7)
DCL VAR(&QSRCF) TYPE(*CHAR) LEN(20)
DCL VAR(&RTNLIB) TYPE(*CHAR) LEN(10)
DCL VAR(&SAVOLDSRC) TYPE(*CHAR) LEN(4)
DCL VAR(&SRCF) TYPE(*CHAR) LEN(10)
DCL VAR(&SRCFLIB) TYPE(*CHAR) LEN(10)
DCL VAR(&SRCMBR) TYPE(*CHAR) LEN(10)
DCL VAR(&SRCTYPE) TYPE(*CHAR) LEN(10)

/* Break qualified name */
CHGVAR VAR(&SRCF) VALUE(%SST(&QSRCF 1 10))
CHGVAR VAR(&SRCFLIB) VALUE(%SST(&QSRCF 11 10))

/* If not *ALL, process member immediately */
IF COND(&SRCMBR *NE '*ALL') THEN(DO)
RTVMBRD FILE(&SRCFLIB/&SRCF) MBR(&SRCMBR) SRCTYPE(&SRCTYPE)
IF COND(&SRCTYPE *NE 'CL' *AND &SRCTYPE *NE 'CLP' *AND +
&SRCTYPE *NE 'CLP38') THEN(DO)
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Member' +
*BCAT &SRCMBR *BCAT 'is not a CL source member') +
MSGTYPE(*ESCAPE)
RETURN
ENDDO
ELSE CMD(DO)
CALL PGM(INDCLC2) PARM(&SRCMBR &SRCF &SRCFLIB &CVTCASE +
&INDRMKS &OUTPUT &SAVOLDSRC &BGNCOL &INDCOL &INDCONT)
MONMSG MSGID(CPF0000) EXEC(DO)
RCVMSG MSGTYPE(*EXCP) MSGDTA(&MSGDTA) MSGID(&MSGID) +
MSGF(&MSGF) MSGFLIB(&MSGFLIB)
SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) +
MSGDTA(&MSGDTA) MSGTYPE(*ESCAPE)
RETURN
ENDDO
ENDDO
ENDDO

/* Otherwise, process multiple members */
ELSE CMD(DO)
RTVMBRD FILE(&SRCFLIB/&SRCF) MBR(*FIRSTMBR) RTNMBR(&SRCMBR) +
SRCTYPE(&SRCTYPE)
MONMSG MSGID(CPF0000) EXEC(DO)
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Source +
file' *BCAT &SRCF *BCAT 'in' *BCAT &SRCFLIB *BCAT 'has +
no members') MSGTYPE(*ESCAPE)
RETURN
ENDDO

LOOP: +
IF COND(&SRCTYPE *EQ 'CLP' *OR &SRCTYPE *EQ 'CLP38' *OR +
&SRCTYPE *EQ 'CL') THEN(DO)
CALL PGM(INDCLC2) PARM(&SRCMBR &SRCF &SRCFLIB &CVTCASE +
&INDRMKS &OUTPUT &SAVOLDSRC &BGNCOL &INDCOL &INDCONT)
MONMSG MSGID(CPF0000) EXEC(DO)
RCVMSG MSGTYPE(*EXCP) MSGDTA(&MSGDTA) MSGID(&MSGID) +
MSGF(&MSGF) MSGFLIB(&MSGFLIB)
SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) +
MSGDTA(&MSGDTA) MSGTYPE(*DIAG)
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA(&SRCTYPE +
*BCAT 'member' *BCAT &SRCMBR *BCAT 'not processed') +
MSGTYPE(*DIAG)
GOTO CMDLBL(NEXT)
ENDDO
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Member' +
*BCAT &SRCMBR *BCAT 'indented successfully') +
MSGTYPE(*INFO)
ENDDO
ELSE CMD(DO)
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA(&SRCTYPE +
*BCAT 'member' *BCAT &SRCMBR *BCAT 'skipped') +
MSGTYPE(*INFO)
ENDDO
NEXT: +
RTVMBRD FILE(&SRCFLIB/&SRCF) MBR(&SRCMBR *NEXT) +
RTNMBR(&SRCMBR) SRCTYPE(&SRCTYPE)
MONMSG MSGID(CPF0000) EXEC(RETURN)
GOTO CMDLBL(LOOP)
ENDDO

ENDPGM

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.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 on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.