CL/400 with Looping ?

550 pts.
Tags:
AS/400 Call stack
CL/400


Hi friends, please help me, I have a looping on this CL ?, this statements below is correct ?, at the first time when the tape is unavailable I receive the e-mail, but on the second time when the tape is available I receive too this same e-mail.

[strong]1800 IF COND(&MSGID = 'CPF6760') THEN(DO) [/strong]

[strong]1900 GOTO CMDLBL(SEMFITA) [/strong]

[strong]2000 ENDDO [/strong]

 

The Complete CL

 

100 PGM 03/07/07

200 DCL VAR(&DIA) TYPE(*CHAR) LEN(2) 03/07/07

300 DCL VAR(&MES) TYPE(*CHAR) LEN(2) 03/07/07

400 DCL VAR(&ANO) TYPE(*CHAR) LEN(2) 03/07/07

500 DCL VAR(&CONTA) TYPE(*DEC) LEN(1) VALUE(0) 03/07/07

600 DCL VAR(&VOLID) TYPE(*CHAR) LEN(6) 03/07/07

700 DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) 03/07/07

800 03/07/07

900 RTVSYSVAL SYSVAL(QDAY) RTNVAR(&DIA) 03/07/07

1000 RTVSYSVAL SYSVAL(QMONTH) RTNVAR(&MES) 03/07/07

1100 RTVSYSVAL SYSVAL(QYEAR) RTNVAR(&ANO) 03/07/07

1200 03/07/07

1300 CHGVAR VAR(&VOLID) VALUE(&DIA *CAT &MES *CAT &ANO) 03/07/07

1400 INICIO:

1500 CHKTAP DEV(TAP01) 03/07/07

1600 MONMSG MSGID(CPF0000) EXEC(RCVMSG MSGID(&MSGID)) 03/07/07

1700 03/07/07

1800 IF COND(&MSGID = 'CPF6760') THEN(DO) 03/07/07

1900 GOTO CMDLBL(SEMFITA) 03/07/07

2000 ENDDO 03/07/07

2100 03/07/07

2200 ELSE 03/07/07

2300 IF COND(&MSGID = 'CPF6772') THEN(DO) 03/07/07

2400 INZTAP DEV(TAP01) NEWVOL(&VOLID) NEWOWNID('TESTA + 03/07/07

2500 FITA') CHECK(*NO) DENSITY(*CTGTYPE) 03/07/07

2600 MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(PROTEGIDA)) 03/07/07

2700 GOTO CMDLBL(FIM) 03/07/07

2800 ENDDO 03/07/07

2900 03/07/07

3000 INZTAP DEV(TAP01) NEWVOL(&VOLID) NEWOWNID('TESTA + 03/07/07

3100 FITA') CHECK(*NO) DENSITY(*CTGTYPE) 03/07/07

3200 MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(PROTEGIDA)) 03/07/07

3300 GOTO CMDLBL(FIM) 03/07/07

3400 03/07/07

3500 SEMFITA: SNDMSG MSG('Unidade de fita indisponivel ou fita + 03/07/07

3600 nao carregada.') TOUSR(QSYSOPR) 03/07/07

3700 03/07/07

3800 SNDDST TYPE(*LMSG) TOINTNET((machine1@mycia.com.br *CC) + 28/03/09

3900 (machine2@mycia.com.br *CC) + 28/03/09

4000 (machine3@mycia.com.br)) + 28/03/09

4100 DSTD('UNIDADE DE FITA NAO DISPONIVEL OU + 28/03/09

4200 SEM FITA') MSG('UNIDADE DE FITA + 28/03/09

4300 INDISPONIVEL OU SEM FITA.') + 28/03/09

4400 LONGMSG('VERIFICAR STATUS COM COMANDO:- + 28/03/09

4500 WRKCFGSTS CFGTYPE(*DEV) CFGD(TAP01) E + 28/03/09

4600 INSERIR NOVA FITA NA UNIDADE, CASO + 28/03/09

4700 CONTRARIO, TEREMOS PROBLEMAS NO BACKUP + 28/03/09

4800 DIARIO .') IMPORTANCE(*HIGH) PTY(*HIGH) + 28/03/09

4900 SUBJECT('UNIDADE DE FITA INDISPONIVEL OU + 28/03/09

5000 SEM FITA') 28/03/09

5100 03/07/07

5200 IF COND(&CONTA = 8) THEN(GOTO CMDLBL(FIM)) 03/07/07

5300 CHGVAR VAR(&CONTA) VALUE(&CONTA + 1) 03/07/07

5400 GOTO CMDLBL(DELAY) 03/07/07

5500 03/07/07

5600 PROTEGIDA: SNDMSG MSG('Fita protegida para gravacao, favor + 03/07/07

5700 desproteger e inserir na unidade + 03/07/07

5800 novamente .') TOUSR(QSYSOPR) 03/07/07

5900 03/07/07

6000 SNDDST TYPE(*LMSG) TOINTNET((machine1@mycia.com.br *CC) + 28/03/09

6100 (machine2@mycia.com.br *CC) + 28/03/09

6200 (machine3@mycia.com.br)) DSTD('FITA + 28/03/09

6300 PROTEGIDA') LONGMSG('FITA PROTEGIDA PARA + 28/03/09

6400 GRAVACAO, FAVOR DESPROTEGER, CASO + 28/03/09

6500 CONTRARIO, TEREMOS PROBLEMAS NO BACKUP + 28/03/09

6600 DIARIO .') IMPORTANCE(*HIGH) PTY(*HIGH) + 28/03/09

6700 SUBJECT('FITA PROTEGIDA PARA BACKUP + 28/03/09

6800 DIARIO') 28/03/09

6900 03/07/07

7000 IF COND(&CONTA = 8) THEN(GOTO CMDLBL(FIM)) 03/07/07

7100 CHGVAR VAR(&CONTA) VALUE(&CONTA + 1) 03/07/07

7200 GOTO CMDLBL(DELAY) 03/07/07

7300 03/07/07

7400 DELAY: DLYJOB DLY(1800) 03/07/07

7500 GOTO CMDLBL(INICIO) 03/07/07

7600 FIM:

7700 ENDPGM 03/07/07

[strong][/strong] 

*****************************************************************

Answer Wiki

Thanks. We'll let you know when a new response is added.

After the delay the program is looping back to INITIO and the variable &MSGID still has the value from the prevous try. To solve: after
<pre>1400 INITIO:</pre>
you should clear the variable &MSGID:
<pre>1410 CHGVAR VAR(&MSGID) VALUE(‘ ‘)</pre>

Hi JennyMack, thanks for Your help, now the CL works, finaly….rsrsr.

Att;
RBDSILVA

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following