Okay a brief explanation of what the code is doing.. I am gathering information based on a date so that I can send a notice to the desired recipients informing that their grants is about to expire in 30 days. I noticed that this error doesn’t happen all the time. I was only able to create this error by changing the date range from anything between 5 and 31 days. Which leads me to believe that it is a certain record maybe that is throwing off the program?
-SET &ECHO=ALL;
-SET &YEAR = EDIT(&DATEYYMD, '9999');
-SET &YYYYMMDD = EDIT(&DATEYYMD, '9999$99$99');
-SET &STARTDATE = AYMD(&YYMD,29,'I8');
-SET &ENDDATE = AYMD(&YYMD,31,'I8');
-*ENGINE SQLORA SET DEFAULT_CONNECTION TEST
TABLE FILE FRBGRNT
PRINT
'FRBGRNT.FRBGRNT.FRBGRNT_AGENCY_PIDM'
'FRBGRNT.FRBGRNT.FRBGRNT_LONG_TITLE'
'FRBGRNT.FRBGRNT.FRBGRNT_PI_PIDM'
'FRBGRNT.FRBGRNT.FRBGRNT_PROJECT_END_DATE'
BY 'FRBGRNT.FRBGRNT.FRBGRNT_CODE'
WHERE ( FRBGRNT_PROJECT_END_DATE_TS LT DT(&ENDDATE) ) AND ( FRBGRNT_PROJECT_END_DATE_TS GT DT(&STARTDATE) );
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE HOLD AS STEPA FORMAT ALPHA
ON TABLE SET HTMLCSS ON
END
JOIN
STEPA.STEPA.FRBGRNT_CODE IN STEPA TO MULTIPLE FRREVNG.FRREVNG.FRREVNG_GRNT_CODE
IN FRREVNG AS J2
END
JOIN
INNER STEPA.STEPA.FRBGRNT_PI_PIDM IN STEPA TO MULTIPLE
GOREMAL.GOREMAL.GOREMAL_PIDM IN GOREMAL AS J3
END
JOIN
STEPA.STEPA.FRBGRNT_CODE IN STEPA TO MULTIPLE FTVFUND.FTVFUND.FTVFUND_FUND_CODE
IN FTVFUND AS J4
END
JOIN
FTVFUND.FTVFUND.FTVFUND_FMGR_CODE_PIDM IN STEPA TO MULTIPLE
FTVFMGR.FTVFMGR.FTVFMGR_FMGR_CODE_PIDM IN FTVFMGR AS J5
END
JOIN
FTVFMGR.FTVFMGR.FTVFMGR_FMGR_CODE_PIDM IN STEPA TO MULTIPLE
SPRIDEN.SPRIDEN.SPRIDEN_PIDM IN SPRIDEN AS J6
END
JOIN
SPRIDEN.SPRIDEN.SPRIDEN_PIDM IN STEPA TO MULTIPLE GOREMAL.GOREMAL.GOREMAL_PIDM
IN GOREMAL AS J1
END
DEFINE FILE STEPA
RESPN/A30=LOCASE(30, FRREVNG.FRREVNG.FRREVNG_RESPONSIBLE_USER_ID , RESPN);
RESPNEMAIL/A90=RESPN || '@fau.edu';
USERFAU/A100=GOREMAL.GOREMAL.GOREMAL_EMAIL_ADDRESS || ',' || ' ' || ',$';
FINMGR_ID/A9=SPRIDEN.SPRIDEN.SPRIDEN_ID;
FINMGR_LNAME/A60=SPRIDEN.SPRIDEN.SPRIDEN_LAST_NAME;
FINMGR_FNAME/A60=SPRIDEN.SPRIDEN.SPRIDEN_FIRST_NAME;
END
TABLE FILE STEPA
SUM
FRREVNG.RESPN
RESPNEMAIL
GOREMAL.J3GOREMAL_EMAIL_ADDRESS
J1GOREMAL_EMAIL_ADDRESS AS 'FINMGR_EMAIL'
BY FRBGRNT_CODE
WHERE GOREMAL_EMAL_CODE EQ 'FAU';
WHERE GOREMAL_STATUS_IND EQ 'A';
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE HOLD AS STEPB FORMAT ALPHA
ON TABLE SET HTMLCSS ON
END
DEFINE FILE STEPB
DISTVAL/A300=STEPB.STEPB.RESPNEMAIL ||';'|| STEPB.STEPB.J3GOREMAL_EMAIL_ADDRESS ||';'|| STEPB.STEPB.J1GOREMAL_EMAIL_ADDRESS || ',' || STEPB.STEPB.FRBGRNT_CODE || ',$';
END
FILEDEF EMAILGRNTTO DISK &FAU_DOMAIN_DIR.EMAILGRNTTO
TABLE FILE STEPB
PRINT
'STEPB.STEPB.DISTVAL'
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE HOLD AS EMAILGRNTTO FORMAT ALPHA
ON TABLE SET HTMLCSS ON
END
TABLE FILE STEPA
SUM
FRBGRNT_AGENCY_PIDM
GOREMAL.J3GOREMAL_EMAIL_ADDRESS
FRBGRNT_LONG_TITLE
FRBGRNT_PI_PIDM
FRBGRNT_PROJECT_END_DATE
MAX.FRREVNG_SEQ_NUM AS 'MAX,FRREVNG_SEQ_NUM'
FRREVNG_RESPONSIBLE_USER_ID
RESPN
RESPNEMAIL
FTVFUND_FUND_CODE
MAX.FTVFMGR_FMGR_CODE_PIDM AS 'MAX,FTVFMGR_FMGR_CODE_PIDM'
FINMGR_ID
FINMGR_FNAME
FINMGR_LNAME
BY FRBGRNT_CODE
WHERE ( J3GOREMAL_STATUS_IND EQ 'A' ) AND ( J3GOREMAL_EMAL_CODE EQ 'FAU' );
WHERE FTVFMGR_STATUS_IND EQ 'A';
WHERE SPRIDEN_CHANGE_IND EQ MISSING;
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE HOLD AS STEPC FORMAT ALPHA
ON TABLE SET HTMLCSS ON
END
JOIN
STEPC.STEPC.FRBGRNT_AGENCY_PIDM IN STEPC TO MULTIPLE
SPRIDEN.SPRIDEN.SPRIDEN_PIDM IN SPRIDEN AS J0
END
DEFINE FILE STEPC
AGENCY_NAME/A60=SPRIDEN.SPRIDEN.SPRIDEN_LAST_NAME;
PROJECT_TITLE/A48=SQUEEZ(48, FRBGRNT_LONG_TITLE, 'A48');
END
TABLE FILE STEPC
PRINT
FRBGRNT_AGENCY_PIDM
AGENCY_NAME
J3GOREMAL_EMAIL_ADDRESS
FRBGRNT_LONG_TITLE
PROJECT_TITLE
FRBGRNT_PI_PIDM
FRBGRNT_PROJECT_END_DATE
FRREVNG_SEQ_NUM
FRREVNG_RESPONSIBLE_USER_ID
RESPN
RESPNEMAIL
FTVFUND_FUND_CODE
FTVFMGR_FMGR_CODE_PIDM
FINMGR_ID
FINMGR_FNAME
FINMGR_LNAME
BY FRBGRNT_CODE
WHERE ( SPRIDEN_CHANGE_IND EQ MISSING ) AND ( SPRIDEN_ENTITY_IND EQ 'C' );
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE HOLD AS STEPD FORMAT ALPHA
ON TABLE SET HTMLCSS ON
END
JOIN
STEPD.STEPD.RESPN IN STEPD TO MULTIPLE GOBTPAC.GOBTPAC.GOBTPAC_EXTERNAL_USER
IN GOBTPAC AS J8
END
JOIN
GOBTPAC.GOBTPAC.GOBTPAC_PIDM IN STEPD TO MULTIPLE SPRIDEN.SPRIDEN.SPRIDEN_PIDM
IN SPRIDEN AS J9
END
TABLE FILE STEPD
BY FRBGRNT_CODE NOPRINT AS 'Grant Code:'
ON FRBGRNT_CODE PAGE-BREAK REPAGE
HEADING
"Email Contents"
WHERE SPRIDEN_CHANGE_IND EQ MISSING;
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT DOC
ON TABLE SET HTMLCSS ON
END
WebFOCUS 7.1.4
Platform: Solaris
Output: Excel, PDF, HTML, ALPHA, WP
Database: Oracle, DB2