|
Help, I'm still getting the Variable length error. It's getting the error on the line where the field AS400CMD is being built. Too me it looks like it should be long enough to hold the data but it still triggers an error. Any ideas? TIA, Frank * FAX log file FQAFFTLOG IF E DISK * D WKLOOP01 S 1A * D P1DATE S 8A D P1FAXNBR S 12A D P1USER S 10A D P1EMAIL S 40A VARYING * D DATE S 8A D FAXNBR S 12A D USER S 10A D STATUS S 1A * D CMDPART1 S 29A D CMDPART2 S 8A D CMDPART3 S 9A D CMDPART4 S 1A D EMAILSUBJ S 100A VARYING D EMAILBODY S 500A VARYING * D COUNTER S 4S 0 * D AS400CMD S 1000A D CMDLENGTH S 15P 5 * D AS400CMD2 S 10A D CMDLENGTH2 S 15P 5 * * --------------------- * Start Main Processing * --------------------- C EXSR MAINPRCS * * ------------------- * End Main Processing * ------------------- C EVAL *INLR = *ON C RETURN * ****************************************************************** * Main Processing Subroutine * ****************************************************************** C MAINPRCS BEGSR * * C EVAL COUNTER = *ZEROS C EVAL WKLOOP01 = 'Y' C DOU WKLOOP01 = 'N' * * Only Process a Maximum of 3 times C EVAL COUNTER = COUNTER + 1 C IF COUNTER >= 0 C EXSR SNDEMAIL C LEAVE C ENDIF * * Wait 3 minutes C EVAL AS400CMD2 = 'DLYJOB 180' C EVAL CMDLENGTH2 = 10 C CALL 'QCMDEXC' CMDPARMS2 * * Find row from table(QAFFTLOG) C/EXEC SQL C+ SELECT QFCDAT, QFDEST, QFUSER, QFSU C+ INTO :DATE, :FAXNBR, :USER, :STATUS C+ FROM QFAX/QAFFTLOG C+ WHERE QFCDAT = :P1DATE AND QFDEST = :P1FAXNBR AND C+ QFUSER = :P1USER C/END-EXEC * * Did NOT find Row; Process again C IF STATUS = *BLANK C ITER C ENDIF * * Fax Successful C IF STATUS = 'S' C LEAVE C ENDIF * * Fax Unsuccessful C IF STATUS = 'U' C EXSR SNDEMAIL C LEAVE C ENDIF * C ENDDO * C ENDSR * ****************************************************************** * SNDEMAIL - Sends "Failed Fax" Email to User ****************************************************************** C SNDEMAIL BEGSR * /FREE CMDPART1 = 'SNDDST TYPE(*LMSG) TOINTNET(('; CMDPART2 = ')) DSTD('; CMDPART3 = ') LONGMSG('; CMDPART4 = ')'; EMAILSUBJ = 'Your Fax to' + '(' + %SUBST(P1FAXNBR:3:3) + ')' + %SUBST(P1FAXNBR:6:3) + '-' + %SUBST(P1FAXNBR:9:4) + ' Failed'; EMAILBODY = 'Your Fax to' + '(' + %SUBST(P1FAXNBR:3:3) + ')' + %SUBST(P1FAXNBR:6:3) + '-' + %SUBST(P1FAXNBR:9:4) + ' Failed. ' + 'Call the customer and ask if they have ' + 'received the fax you had tried to send. If not,'+ ' make sure the fax number is correct. Then ' + 'resubmit the fax through the same program that ' + 'it was sent or detach the copies that were sent '+ 'to your email address and print them out and ' + 'fax them manually.'; error here: >>>>>>>>>>>AS400CMD = CMDPART1 + P1EMAIL + CMDPART2 + EMAILSUBJ + CMDPART3 + EMAILBODY + CMDPART4; CMDLENGTH = %LEN(%TRIM(AS400CMD)); /END-FREE * C CALL 'QCMDEXC' CMDPARMS * C ENDSR * ****************************************************************** * *INZSR ****************************************************************** C *INZSR BEGSR * C *ENTRY PLIST C PARM P1DATE C PARM P1FAXNBR C PARM P1USER C PARM P1EMAIL * C CMDPARMS PLIST C PARM AS400CMD C PARM CMDLENGTH * C CMDPARMS2 PLIST C PARM AS400CMD2 C PARM CMDLENGTH2 * C ENDSR * ******************************************************************
As an Amazon Associate we earn from qualifying purchases.
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.