000024 FILE OUTFIL FB(75 23400)
000025 SSN 1 9 A
000026 EFF_DATE 10 10 A
000027 ACT_CD 20 5 A
000028 RSN_CD 25 3 A
000029 TITLE_CD 28 6 A
000032 ************************************************************
000033 DEFINE SSAN W 09 A
000034 EFFDT W 10 A
000035 RSN W 3 A
000036 ACT W 5 A
000037 TIT W 6 A
000040 ************************************************************
000041 * S Q L C U R S O R S E C T I O N
000042 ************************************************************
000043 SQL INCLUDE LOCATION * FROM FMHR201.EMPLOYEE_MSTR_VIEW
000044 SQL DECLARE CURSOR1 CURSOR FOR SELECT DISTINCT +
000045 EMPL_SOC_SEC_NO, EFFECTIVE_DT, LAST_PERS_ACT_CD, +
000046 LAST_PERS_RSN_CD, TITLE_CD, +
000048 FROM FMHR201.EMPLOYEE_MSTR_VIEW +
000049 WHERE PAYROLL_NUMBER_CD LIKE '002%' +
000050 AND EMPLMT_STAT_CD = 'I' +
000051 AND LAST_PERS_RSN_CD = 'M9'
000052 * WHERE HOME_AGENCY_CD = '002' +
000053 ************************************************************
000054 * A C T I V I T Y S E C T I O N
000055 ************************************************************
000056 JOB INPUT NULL START INIT FINISH FINISH-PROC
000057 **
000058 SQL FETCH CURSOR1 INTO :EMPL_SOC_SEC_NO, :EFFECTIVE_DT, +
000059 :LAST_PERS_ACT_CD, :LAST_PERS_RSN_CD, :TITLE_CD, +
000061 IF SQLCODE NE 0
000062 IF SQLCODE NQ 100
000063 DISPLAY 'THE FOLLOWING SQLCODE OCCURRED ON FETCH OF CU
000064 DISPLAY ' SQLCODE = ' SQLCODE
000065 STOP EXECUTE
000066 ELSE
000067 STOP
000068 END-IF
000069 END-IF
000070
000071 *****************************************
000072 * CHANGE THE FORMAT OF THE DATE FIELDS
000073 *****************************************
000074 *MOVE LV-PR-ST-DT TO LV-PROG-DT
000075 *MOVE PAY-AL-RA-D TO AN-RAISE-DT
000076 *****************************************
000077 MOVE EMPL_SOC_SEC_NO TO SSN
000078 MOVE EFFECTIVE_DT TO EFF_DATE
000079 MOVE LAST_PERS_RSN_CD TO RSN_CD
000080 MOVE LAST_PERS_ACT_CD TO ACT_CD
000081 MOVE TITLE_CD TO TIT
000084 PUT OUTFIL
000085 **
000086 PRINT PCEF-REPORT
000087 ************************************************************
000088 * PROCEDURES SECTION
000088 * PROCEDURES SECTION
000089 ************************************************************
000090 INIT. PROC
000091 **
000092 SQL OPEN CURSOR1
000093 **
000094 IF SQLCODE NE 0
000095 DISPLAY 'THE FOLLOWING SQLCODE OCCURRED ON OPEN OF CURSOR
000096 DISPLAY ' SQLCODE = ' SQLCODE
000097 STOP EXECUTE
000098 END-IF
000099 **
000100 END-PROC
000101 ************************************************************
000102 FINISH-PROC. PROC
000103 **
000104 SQL CLOSE CURSOR1
000105 IF SQLCODE NE 0
000106 DISPLAY 'THE FOLLOWING SQLCODE OCCURRED ON CLOSE OF CURSO
000107 DISPLAY ' SQLCODE = ' SQLCODE
000108 STOP EXECUTE
000109 END-IF
000110 **
000111 END-PROC
000112 ************************************************************
000113 * R E P O R T S S E C T I O N
000114 ************************************************************
000115 REPORT PCEF-REPORT
000116 SEQUENCE SSAN
000117 TITLE 1 'ALABAMA ALCOHOLIC BEVERAGE CONTROL BOARD'
000118 LINE 1 EMPL_SOC_SEC_NO EFFECTIVE_DT LAST_PERS_ACT_CD +
000119 LAST_PERS_RSN_CD TITLE_CD
000120 **
000121 ** LINE 1 SSAN EFFDT ACT RSN TIT
000122 /*
000123 //
...... ============================= B O T T O M ==================
When Program Runs I get these errors:
B039--Qualification Required: Title_CD
B204 SQL CURSOR CURSOR1 NOT REFERENCED in AN SQL "FETCH"
B204 SQL -- KEYWORD in ERROR: CURSOR1
Please Help!
jjc3397
000025 SSN 1 9 A
000026 EFF_DATE 10 10 A
000027 ACT_CD 20 5 A
000028 RSN_CD 25 3 A
000029 TITLE_CD 28 6 A
000032 ************************************************************
000033 DEFINE SSAN W 09 A
000034 EFFDT W 10 A
000035 RSN W 3 A
000036 ACT W 5 A
000037 TIT W 6 A
000040 ************************************************************
000041 * S Q L C U R S O R S E C T I O N
000042 ************************************************************
000043 SQL INCLUDE LOCATION * FROM FMHR201.EMPLOYEE_MSTR_VIEW
000044 SQL DECLARE CURSOR1 CURSOR FOR SELECT DISTINCT +
000045 EMPL_SOC_SEC_NO, EFFECTIVE_DT, LAST_PERS_ACT_CD, +
000046 LAST_PERS_RSN_CD, TITLE_CD, +
000048 FROM FMHR201.EMPLOYEE_MSTR_VIEW +
000049 WHERE PAYROLL_NUMBER_CD LIKE '002%' +
000050 AND EMPLMT_STAT_CD = 'I' +
000051 AND LAST_PERS_RSN_CD = 'M9'
000052 * WHERE HOME_AGENCY_CD = '002' +
000053 ************************************************************
000054 * A C T I V I T Y S E C T I O N
000055 ************************************************************
000056 JOB INPUT NULL START INIT FINISH FINISH-PROC
000057 **
000058 SQL FETCH CURSOR1 INTO :EMPL_SOC_SEC_NO, :EFFECTIVE_DT, +
000059 :LAST_PERS_ACT_CD, :LAST_PERS_RSN_CD, :TITLE_CD, +
000061 IF SQLCODE NE 0
000062 IF SQLCODE NQ 100
000063 DISPLAY 'THE FOLLOWING SQLCODE OCCURRED ON FETCH OF CU
000064 DISPLAY ' SQLCODE = ' SQLCODE
000065 STOP EXECUTE
000066 ELSE
000067 STOP
000068 END-IF
000069 END-IF
000070
000071 *****************************************
000072 * CHANGE THE FORMAT OF THE DATE FIELDS
000073 *****************************************
000074 *MOVE LV-PR-ST-DT TO LV-PROG-DT
000075 *MOVE PAY-AL-RA-D TO AN-RAISE-DT
000076 *****************************************
000077 MOVE EMPL_SOC_SEC_NO TO SSN
000078 MOVE EFFECTIVE_DT TO EFF_DATE
000079 MOVE LAST_PERS_RSN_CD TO RSN_CD
000080 MOVE LAST_PERS_ACT_CD TO ACT_CD
000081 MOVE TITLE_CD TO TIT
000084 PUT OUTFIL
000085 **
000086 PRINT PCEF-REPORT
000087 ************************************************************
000088 * PROCEDURES SECTION
000088 * PROCEDURES SECTION
000089 ************************************************************
000090 INIT. PROC
000091 **
000092 SQL OPEN CURSOR1
000093 **
000094 IF SQLCODE NE 0
000095 DISPLAY 'THE FOLLOWING SQLCODE OCCURRED ON OPEN OF CURSOR
000096 DISPLAY ' SQLCODE = ' SQLCODE
000097 STOP EXECUTE
000098 END-IF
000099 **
000100 END-PROC
000101 ************************************************************
000102 FINISH-PROC. PROC
000103 **
000104 SQL CLOSE CURSOR1
000105 IF SQLCODE NE 0
000106 DISPLAY 'THE FOLLOWING SQLCODE OCCURRED ON CLOSE OF CURSO
000107 DISPLAY ' SQLCODE = ' SQLCODE
000108 STOP EXECUTE
000109 END-IF
000110 **
000111 END-PROC
000112 ************************************************************
000113 * R E P O R T S S E C T I O N
000114 ************************************************************
000115 REPORT PCEF-REPORT
000116 SEQUENCE SSAN
000117 TITLE 1 'ALABAMA ALCOHOLIC BEVERAGE CONTROL BOARD'
000118 LINE 1 EMPL_SOC_SEC_NO EFFECTIVE_DT LAST_PERS_ACT_CD +
000119 LAST_PERS_RSN_CD TITLE_CD
000120 **
000121 ** LINE 1 SSAN EFFDT ACT RSN TIT
000122 /*
000123 //
...... ============================= B O T T O M ==================
When Program Runs I get these errors:
B039--Qualification Required: Title_CD
B204 SQL CURSOR CURSOR1 NOT REFERENCED in AN SQL "FETCH"
B204 SQL -- KEYWORD in ERROR: CURSOR1
Please Help!
jjc3397