/*TMCI18N BEGIN HEADER*/ #if !defined( tmBundle_EXISTS ) #define TM_ON_STARTUP tmInitGlobS_sfrnslc #include "tmcilib.h" static struct TMBundle tmBundle = {"sfrnslc.pc",NULL,NULL,NULL,NULL}; #define tmBundle_EXISTS #endif /*#define SCT_DEBUG 1*/ /*TMCI18N END HEADER*/ /* AUDIT_TRAIL_MSGKEY_UPDATE -- PROJECT : MSGKEY -- MODULE : SFRNSLC -- SOURCE : enUS -- TARGET : I18N -- DATE : Mon Feb 24 06:58:05 2020 -- MSGSIGN : #cf00360b7351535a END AUDIT_TRAIL_MSGKEY_UPDATE */ /* AUDIT_TRAIL_TM63 -- TranMan 6.3 -- PROJECT : HEGDE_I18N -- MODULE : SFRNSLC -- SOURCE : enUS -- TARGET : I18N -- DATE : Sun Oct 28 10:58:53 2007 END AUDIT_TRAIL_TM63 */ /*****************************************************************************/ /* SFRNSLC.PC Copyright 1995 - 2021 Ellucian Company L.P. and its affiliates.*/ /*****************************************************************************/ /* SFRNSLC.PC */ /* */ /* EDI Exract Program with Error Reporting */ /* AUDIT TRAIL: 2.0.8 INIT DATE */ /* _______________________________________________________ ____ ________ */ /* 1. Produces three output files based on user input: CJB 02/24/95 */ /* a) Error Report - identifies students with missing */ /* data or invalid data; to be run prior to creating */ /* the data extract file and loading data to the */ /* National Student Loan Clearinghouse Control table. */ /* */ /* b) EDI TS 190 data extract file. */ /* */ /* c) EDI.Smart data extract file. */ /* AUDIT TRAIL: 2.1.5 Supplemental CFIX 09/29/95 */ /* 1. Program modified by cfix.c to remedy mostly Pro*C related problems: */ /* split SQL concatenations joined, colons added to FETCH targets, */ /* file extensions added to SQL INCLUDEs, 'static' modifier removed from */ /* indicator variables, new logic to hadle CLOSE_CURSOR was added to SQL */ /* function wrappers, and object owner references were removed as part of */ /* BANNER2.1. (Not all changes necessarily apply.) */ /* AUDIT TRAIL: 2.1.8 MKH 04/01/96 */ /* 1. Modified SEL_STATUS and SEL_GRAD_DATE_G to populate */ /* the graduation date for students who have already */ /* graduated with the SSBSECT_PTRM_END_DATE for the most */ /* recently graded course section for the specified term */ /* rather than the date contained in SHRDGMR_GRAD_DATE. */ /* 2. Replaced AND SGBSTDN_TERM_CODE_EFF IN with */ /* AND SGBSTDN_TERM_CODE_EFF =, and added */ /* WHERE SGBSTDN_PIDM = :pidm to the subquery in */ /* cursor_042. */ /* AUDIT TRAIL: 2.1.11 */ /* 1. Added AND SFBETRM_PIDM >= 0 condition and modified MKH 04/25/96 */ /* the order of the WHERE clause in cursor_100 to force the */ /* index on SFBETRM to be used to improve performance time. */ /* 2. Defect #4498 - Extended FICE code to 8 characters MKH 05/08/96 */ /* in both the EDI and EDI.Smart flat files to resolve */ /* the branch code problem encountered when the file was */ /* processed by the NSLC. The 6 character FICE code was */ /* right-padded with 2 zeros as requested by the NSLC. */ /* 3. Defect #4559 - Modifications to ensure expected MKH 05/28/96 */ /* graduation date meets new standards established by NSLC. */ /* a) Added new variable, leave_date to hold leave */ /* begin date (SGBSTDN_LEAV_FROM_DATE). */ /* b) Modified sel_status function to retrieve the */ /* leave begin date from SGBSTDN. */ /* c) Modified the getdata function to compare the */ /* expected graduation date (grad_date_fha) against */ /* the end of term date (enroll_end_date) and */ /* provide an error message when the process is run */ /* in Missing/Invalid Data mode. */ /* d) Added case to switch statements to create a DTP */ /* 007 record containing the date the leave of */ /* absence began when the status is an approved */ /* leave of absence. */ /* e) Modified main and retrieve_parms functions to */ /* call enrollment_period function to make term */ /* begin and end dates available for comparison */ /* purposes throughout the process. Removed calls */ /* to enrollment_period from getdata function. */ /* 4. Defect #4417 - Modified retrieve_parms function to call MKH 05/28/97 */ /* the read_line_count function after the run_mode has been */ /* retrieved by readrun_mode so that the "if" condition has */ /* been met when the run_mode selected is "1". */ /* 5. Defect #4717 - Removed duplicated column from select in MKH 07/10/96 */ /* CURSOR_050 to ensure that the time status date is */ /* included in the file to be submitted to the NSLC. */ /* 6. Defect #4749 - Modifications to eliminate unnecessary MKH 07/10/96 */ /* error messages when run mode '1' is selected. */ /* a) Added initialization of time status and enrollment */ /* status variables to getdata function. */ /* b) Modified call to sel_full_half_status in getdata to */ /* cause it to be executed only if no student status */ /* ('D', 'W', 'G' or 'A') exists; and to execute */ /* immediately after the student status has been */ /* determined. */ /* c) Modified call to sel_grad_date_fha in getdata to */ /* be executed only if the enrollment status is 'F' */ /* or 'H', or the student status is 'A'. */ /* d) Corrected syntax following nslc_fhl_code in */ /* CURSOR_051, replacing comma with a semicolon. */ /* AUDIT TRAIL: 2.1.13 */ /* 1. Defect #5046 - Modifications to resolve problem with MKH 10/09/96 */ /* BANNER zipcodes that are longer than the 9 characters */ /* permitted by the NSLC. */ /* a) Modified getdata function to check the length of */ /* the zipcode when option 1 is selected and if the */ /* length is greated than 9 characters include an error */ /* message in the report. */ /* b) Modified seladdr function to trim spaces from the */ /* right and left sides of the zipcode when it is */ /* retrieved from SPRADDR to eliminate the inclusion of */ /* any inadvertant spaces at either end of the zipcode. */ /* 2. Defect #4612 - Modifications to resolve problem with MKH 10/09/96 */ /* platform specific trailing null missing from STR bind */ /* variable problem. */ /* a) Removed argument from readcolr function in calls to, */ /* declaration of, and definition of the function. */ /* b) Added call to strcpy function to place value in */ /* colr_type variable prior to call to readcolr */ /* function when printing control information page. */ /* Occurs twice, once for student attributes ("S"); */ /* and once for address types ("A"). */ /* AUDIT TRAIL: 2.1.21 */ /* 1. Defect #5368 - Modifications to correct the release MKH 07/11/97 */ /* number in the report control information. */ /* a) Replaced the existing release number with the correct */ /* release number (2.1.21). */ /* 2. Defect #5355 - Modifications to ensure that the correct MKH 07/11/97 */ /* time stamp is stored in SFRCTRL when the time is greater */ /* than 09:59:59. */ /* a) Modified insert of SFRTCTL_RPRT_DATE to insert */ /* :sel_date||' '||:time_var not :sel_date||:time_var. */ /* 3. Defect #6788 - Modifications to cause a DTP|007 record MKH 07/11/97 */ /* to be created when a drop in status occurs. */ /* a) Modified where clause in control_table function to */ /* retrieve only values for the specified term, not all */ /* terms <= the specified term. */ /* 4. Year 2000 Changes MKH 08/01/97 */ /* a) Changed sel_date, ask_sel_date, date, and use_date */ /* from TMCHAR to[10] TMCHAR to[12] accommodate the 4 digit year. */ /* b) Modified the prompt for REPORT DATE to ask for and */ /* accept the 4 digit year. */ /* c) Modified all inserts into SPRCOLR to convert sel_date */ /* to the 4 digit year format before inserting it. */ /* d) Modified the WHERE clause of cursor_050 to use the */ /* 4 digit year format when comparing SFRTHST_TMST_DATE */ /* to :use_date. */ /* d) Modified the format the date being inserted into */ /* AUDIT TRAIL: 3.0.0.1 */ /* 1. Defect #8187 - Modifications to resolve problem where MKH 11/11/97 */ /* certification date is not included in the data file. */ /* a) Modified conversion of entered Report Date to the */ /* printing format to include the 'DD-MON-YYYY' format */ /* in the TO_DATE portion of the conversion when option */ /* 2 or 3 is selected. */ /* 2. Defect #8371, #8417 - ORA-01830: date format picture MKH 12/05/97 */ /* ends before converting entire input string error will */ /* occur when a student qualifies for the status of LEAVE */ /* ABSENCE. */ /* a) Replaced TO_DATE function on SGBSTDN_LEAV_FROM_DATE */ /* and SGBSTDN_LEAVE_TO_DATE with TO_CHAR function in the */ /* WHERE clause of CURSOR_42. */ /* b) Added date format mask to the TO_CHAR function in a) */ /* above. */ /* AUDIT TRAIL: 3.0.0.2 */ /* 1. Defect #9060 - Modifications to resolve problems with MKH 04/16/98 */ /* date comparisons. */ /* a) Increased size of control_rpt_date variable to TMCHAR2[1]. */ /* b) Modified WHERE clause of cursor_042 to compare */ /* SGBSTDN_LEAV_FROM_DATE and SGBSTDN_LEAV_TO_DATE */ /* to TO_DATE(:sel_date,'DD-MON-YYYY'). */ /* c) Modified WHERE clause of cursor_050 to compare */ /* SFRTHST_TMST_DATE to TO_DATE(:use_date,'DD-MON-YYYY'). */ /* d) Added TO_CHAR to select of SFRTCTL_RPRT_DATE in */ /* cursor_055 to cause the format to be 'DD-MON-YYYY'. */ /* 2. Increased size of fice variable to TMCHAR[9]. */ /* AUDIT TRAIL: 3.1 */ /* 1. Year 2000 compliance. AT 04/16/98 */ /* AUDIT TRAIL: 3.2 */ /* 1. Y2K corrections. CE 06/01/98 */ /* 2. Add gdatevalid code for Y2K compliance. CE 06/16/98 */ /* */ /* AUDIT TRAIL: 3.2.1 */ /* 1. Defect 10268 - When report is run same day that time JC 10/16/98 */ /* status is updated, time status is not recognized. */ /* a) Modified cursor_050. Added TO_DATE function to */ /* SFRTHST_TMST_DATE in WHERE clause. */ /* 2. Enhancement for Tax Relief Act of 1997 - Must indicate JC 10/19/98 */ /* if student is enrolled in ONLY grad level courses. */ /* Write out on ENR record. */ /* a) Created new fields glvl_ind, ask_glvl_code, glvl_code, reg_levl. */ /* b) Added parameter for grad level codes. */ /* c) Added functions check_grad_levl, inscolrglvl, */ /* check_reg, check_reg_levl, readglvl. */ /* */ /* AUDIT TRAIL: 4.1 */ /* 1. Regulatory upgrade. Set ENR10 segment based on value JC 06/01/99 */ /* found in spbpers_confid_ind. */ /* */ /* 2. Defect 14080. JC 09/10/99 */ /* Problem..Printing value 28 in ENR02 segment when no GRAD */ /* LEVL parameters are specified. */ /* Unreported problem: Rows not deleted from SPRCOLR */ /* at EOJ when run via Job Submission. */ /* LEVL parameters are specified. */ /* Fix......Optional parameters not being handled correctly when */ /* entered via Job Submission. */ /* Modified functions "readglvl" and "readstudex" to */ /* select only where GJBPRUN_VALUE IS NOT NULL, and */ /* modified calls to these functions. */ /* Also added call to function "delcolr" at Job Submission EOJ. */ /* */ /* AUDIT TRAIL: 4.3 */ /* */ /* 1. Defect 14648. JC 12/21/99 */ /* Problem..ofile_name length is wrong. Prevents running job from */ /* job sub. */ /* Fix......Change length of ofile_name from 40 to 81. */ /* */ /* 2. Defect 33080. JC 12/21/99 */ /* Problem..If grad_date same as term_end_date, reported as */ /* error. */ /* Fix......Change following line of code in function get_date: */ /* if (strcmp(grad_date_fha,enroll_end_date)<=0) */ /* to: */ /* if (strcmp(grad_date_fha,enroll_end_date)<0) */ /* */ /* 3. Defect 33836. JC 01/06/00 */ /* Problem..Users with NLS_DATE_FORMAT set to DD-MON-YY have */ /* problem with date comparison in cursor_050. */ /* Fix......Changed left side of date comparison in cursor_050 to: */ /* TO_DATE(TO_CHAR(SFRTHST_TMST_DATE,'DD-MON-YYYY'),'DD-MON-YYYY' */ /* */ /* AUDIT TRAIL: 4.3.0.1 */ /* */ /* 1. Defect 36145. AG 03/28/00 */ /* Problem..No nation code was displayed for run modes 2 and 3. */ /* Fix......Added variable natn_edi_equiv. Edited macro seladdr to populate*/ /* natn_edi_equiv.Added this to the output N4 for run modes 2 & 3.*/ /* Also added a default value of "FO" is the state code as NULL. */ /* */ /* 2. AG 03/29/00 */ /* Problem..No birth date. */ /* Fix......Added variable student_birth_date. Edited cursor cursor_100 to */ /* populate student_birth_date.Added NULL check in mode 1 and DMG */ /* outputs to modes 2 and 3. */ /* */ /* AUDIT TRAIL: 5.0 EFD 01/23/01 */ /* 1. Corrected definition of function sel_level to be static void */ /* to correct MS compiler warning message. */ /* */ /* AUDIT TRAIL: 5.1.1 */ /* 1. Regulatory Release. JC 04/23/01 */ /* Problem..National Student Loan Clearinghouse (NSLC) changed its */ /* name to National Student Clearinghouse (NSC). */ /* Fix......Changed one line of code in function "getdata", to print */ /* 'NSC' on report, instead of 'NSLC'. (Program name will */ /* still print as 'SFRNSLC'). */ /* */ /* AUDIT TRAIL: 5.1.1.1 JC 05/23/01 */ /* 1. Problem..Some clients do not store birth dates in Banner. */ /* This causes a problem when running the report. */ /* An error is generated for each student with no birth date, */ /* and the DMG segment is not created in the files for NSC. */ /* Fix......In function "getdata", cursor "cursor_100", changed the */ /* following line at the end of the SELECT clause: */ /* Old: TO_CHAR(SPBPERS_BIRTH_DATE,'YYYYMMDD') */ /* New: COALESCE(TO_CHAR(SPBPERS_BIRTH_DATE,'YYYYMMDD'),'00000000') */ /* */ /* AUDIT TRAIL: 5.3 */ /* 1. Added column names to all INSERT statements. JC 07/23/01 */ /* */ /* AUDIT TRAIL: 5.3.1.1 */ /* 1. Defect 66016. JC 10/29/01 */ /* Problem..DTP|007 not being created when drop in status. This is due */ /* to sel_full_half_status function, which is reading the same */ /* record each time. Also, if multiple status created on same */ /* day that report is run, latest status is not always selected. */ /* Fix......Modified function 'sel_full_half_status' and renamed it to */ /* 'sel_full_half_status_latest'. */ /* Created function sel_full_half_status_prior. */ /* Added variable 'prior_use_date'. */ /* Commented out the following line of code wherever it occurred: */ /* strcpy(old_nslc_fhl_code, nslc_fhl_code) */ /* */ /* AUDIT TRAIL: 5.4.0.1 */ /* 1. Defect 76900 JC 04/08/02 */ /* Problem..Still problems similar to defect 66016, plus some students */ /* not being reported at all, if they're new on a subsequent run. */ /* Fix......Backed out changes that were made for defect 66016. */ /* Added fields sel_time, control_rpt_time, use_time, date_type. */ /* Modified functions sel_full_half_status, control_table, and */ /* various places in function getdata (each place where function */ /* sel_full_half_status is called). */ /* */ /* AUDIT TRAIL: 5.4.0.2 */ /* 1. Defect 78525 JC 06/21/02 */ /* Problem..Generating erroneous "No Address on SPAIDEN" messages. */ /* Fix......Rewrote function 'seladdr'. */ /* */ /* AUDIT TRAIL: 5.5.0.1 */ /* 1. Defect 84014 JC 01/12/03 */ /* Problem..Student's time status not always being reported. This was */ /* caused by a timestamp problem that could occur as follows: */ /* Batch process to set Time Status is run on the same day as */ /* the school's Report Date. For example: Student's Time Status */ /* is set to Full Time on 01-JAN-2003 at 4 PM. The school's */ /* reporting date is 01-JAN-2003, but they don't run the report */ /* till the following morning at 9 AM and use 01-JAN-2003 as the */ /* Report Date. So we now have the following situation, in which */ /* the Report Date is EARLIER THAN the student Time Status date, */ /* so the student's Time Status will not be reported. */ /* - Student's Time Status is 01-JAN-2003 16:00:00 . */ /* - Report Date is 01-JAN-2003 09:00:00 . */ /* Fix......Created function "seltime". If SFRTHST records exist with the */ /* same date as the Report Date, use MAX timestamp from SFRTHST. */ /* If no SFRTHST records exist for Report Date, use time that */ /* report is being run (from SYSDATE). */ /* */ /* AUDIT TRAIL: 6.0 */ /* 1. Compiled for release. JC 01/12/03 */ /* */ /* AUDIT TRAIL: 6.0.0.1 */ /* 1. Defect 67828. JC 07/30/03 */ /* Problem..If student has more than one degree at the same level, the */ /* second degree is not reported. Student is reported as either */ /* full or half-time student, rather than as a graduate (EB4). */ /* Fix: Modified cursor_041. Added the following condition: */ /* AND (SHRDGMR_GRAD_TERM_CODE = :term */ /* OR SHRDGMR_GRAD_TERM_CODE IS NULL) */ /* */ /* AUDIT TRAIL: 7.2.1.1 */ /* 1. Defect 1-91WGA PL 01/18/06 */ /* Problem..program aborts with an Oracle error ora-3113 when running in */ /* 10G. The spraddr cursor select is the cause of the problem. */ /* Fix: Modified seladdr cursor to rework the selection of data */ /* from sprcolr. */ /* */ /* AUDIT TRAIL: 7.3.1 */ /* 1. RPEs NSC Project WG 07/20/06 */ /* Problem..It would be nice to run the report with Population selection. */ /* Fix: Modified driving cursor to be dynamic and use new popsel parms.*/ /* 2. CMS-RPE3044 WG 07/20/06 */ /* Problem..Leave of Absence is always reported if found. */ /* Fix: Added check for STVLEAV_THIRD_PARTY_REPORT_IND = 'Y'. */ /* 2. SR 1-L1F26 WG 07/20/06 */ /* Problem..Error Message spells "precedes" incorrectly. */ /* Fix: The word is correctly spelled now. */ /* 3. SR CMS-DFCT80233 WG 07/26/06 */ /* Problem..ZIP codes are not validated to be at least 5 characters. */ /* SSNs are not validated to be numeric. */ /* Fix: Added validate_ssn function and length check on zip and calls */ /* to them. */ /* 4. CMS-RPE31566/ CMS-RPE32623 WG 07/26/06 */ /* Problem: Branch Code is always hard coded as '00'. */ /* Fix: Allow entry of branch code as a new optional parameter. */ /* Default will remain '00'. */ /* 5. CMS-RPE32046 WG 07/26/06 */ /* Problem: Add an option to print the list of students being sent. */ /* Fix: The .log file will remain the same. */ /* The .lis file will now be a control report with or without */ /* summary as determined by the new parameter. */ /* The .txt file will be added the flat file output for runmodes */ /* 2 and 3. */ /* */ /* AUDIT TRAIL: 7.3.2 */ /* 1. 1-19WD68 WG 11/15/06 */ /* Problem: Getting two error records on SSN when it doesn't exist. */ /* Fix: Change if (!*student_ssn) to if (*student_ssn). */ /* 2. 1-1IB1QF WG 1/4/07 */ /* Rewrote find_name_for function to make it more universal by platform. */ /* */ /* AUDIT TRAIL: 7.3.3 */ /* 1. Defect 1-1N2EBF JC 04/30/07 */ /* Problem: "Zipcode length is less than 5 characters" message displays */ /* for international students who have no zip code. */ /* Fix: Modified the following code for report_type 1: */ /* if (*state) <--- ADDED THIS LINE */ /* { */ /* if ( strlen(zip) > 9 ) */ /* ... */ /* if (( strlen(zip) < 5)) */ /* ... */ /* Problem: Job numbers longer than 6 are truncated in output file names. */ /* Fix: Rewrote function find_name_for. */ /* */ /* AUDIT TRAIL: 7.4.0.1 */ /* 1. 1-2PTKEF WG 11/15/06 */ /* Problem: Job aborts when run from the host. */ /* Fix: Added: if (*ofile_name2) before calling find_name_for(ofile_name2);*/ /* 2. 1-2SELT7 JC 09/20/07 */ /* Problem: New summary report shows SYSDATE as the Expected Graduation */ /* Date for students who have none on SGASTDN. Only the report */ /* is incorrect, the submittal file contains correct information. */ /* Fix: Modified function copy_report_variables as follows: */ /* OLD: if (*print_sel_date) */ /* strcpy(report_grad_date, print_sel_date); */ /* NEW: if (*grad_date_g) */ /* strcpy(report_grad_date, grad_date_g); */ /* Also added the following line at two places in function getdata: */ /* *grad_date_g = '\0'; */ /* */ /* AUDIT TRAIL: 8.0 */ /* 1. Migrated 7.x changes to 8.0 JC 06/06/07 */ /* 2. Concurrent Curricula ES 06/13/07 */ /* Remove retrieval of the level from sgbstdn, replaced cursor sel_level.*/ /* Added procedure call to get level for the primary learner curriculum. */ /* AUDIT TRAIL : 8.0 (I18N) */ /* 1. Internationalization Unicode Conversion */ /* */ /* AUDIT TRAIL: 8.1 */ /* 1. Defect 1-3V7LWU MAH 8/4/08 */ /* Change the expression: */ /* sysdate(time_var,ORA_NLS_TIME_FORMAT); */ /* which gets the current time, to the following: */ /* sysdate(time_var,_TMC("HH24:MI:SS")); */ /* ORA_NLS_TIME_FORMAT returns the time in the format HH:MI:SS AM and the */ /* required format is HH24:MI:SS. The format from ORA_NLS_TIME_FORMAT */ /* was causing a data overflow into the run mode field which made it */ /* invalid and the process to not run. */ /* */ /* AUDIT TRAIL: 8.2 */ /* 1. Defect 1-4Q9IKP JC 03/12/09 */ /* Problem: Institutions who run the process for multiple branches */ /* or multiple FICE codes must manipulate the control file */ /* for each run, because control records do not contain Branch */ /* or FICE Code. */ /* Fix: Added BRANCH and FICE codes to control file (SFRTCTL). Added new */ /* jobsub parameter 15, to allow input of FICE code. Modifed logic to */ /* use new parameter and to store BRANCH and FICE in the control table. */ /* */ /* AUDIT TRAIL: 8.3 */ /* 1. NSC to include additional fields to output. RG 11/16/09 */ /* Major 1 & 2 with CIP codes, email address, gender, race, class level, */ /* Banner ID, and SSN. */ /* Added Select Actual Enrollment dates for output file. */ /* */ /* */ /* AUDIT TRAIL: 8.4 */ /* 1. SCP RG 02/09/2010 */ /* Added new parm process by SCP. If process by SCP =Y then calc will */ /* be based on SCP and if process by SCP =N then */ /* parm term entered will be used for processing. */ /* =>If the student is enrolled BOTH terms of the SCP then Report SCP time */ /* status from SFRSTSH.Use GSR from the highest term */ /* (the term entered in the Term Code parm) in the SCP in which the */ /* student has registration to determine student class, level and major. */ /* =>else if student ONLY enrolled in the FIRST term of the SCP then */ /* Report enrollment status, level, class, major from this term. */ /* =>else if Report enrollment status, level, class, major from parm term. */ /* Created new variables scp_process,term_to_process,scps_code,cycle_code, */ /* scps_reg_all_terms,count_scp_terms,count_reg_terms,enrl_cycle_code, */ /* check_scpreg_flag. */ /* Created new functions readscpprocess,fetchscp,countscpterms, */ /* countregterms,fetch_enrl_cycle,fetch_first_reg_scp, */ /* student_centric_period. */ /* */ /* 2. Added gtvsdax checks for processscp RG 02/24/2010 */ /* If GTVSDAX Student centric period is not implemented then Process by */ /* student period Parm cannot by Y. */ /* Created new parm print_process_scp. */ /* Created new function process_scp_settings. */ /* */ /* 3. 1-AYKY6H RG 03/01/2010 */ /* Corrected message in process_scp_settings to include string GTVSDAX. */ /* */ /* 4. 1-AZNKOJ RG 03/04/2010 */ /* Corrected .log file to show corrected result when GTVSDAX processscp<>Y */ /* and parm process by student period=Y. */ /* */ /* AUDIT TRAIL: 8.4.0.2 */ /* 1. Defect correction 1-C3XDB0 RG 06/16/2010 */ /* Removed withdrawn check from enrollment dates selection cursor. */ /* Function Name :selstartenddates. */ /* Cursor Name :cursor_404. */ /* */ /* AUDIT TRAIL: 8.4.0.4 */ /* 1. Defect correction 1-CSBZVT RG 07/27/2010 */ /* Error:Withdrawal date missing when parm 12=y and no sfrwdrl record. */ /* Fix: */ /* Cursor Name :cursor_044 for sfrwdrl date fetch cursor. */ /* Changed if ( NO_ROWS_FOUND ) to if ( !*eff_wdrl_date ) for above cursor.*/ /* */ /* AUDIT TRAIL: 8.5.0.1 */ /* 1. Defect correction 1-DXDBPL RG 09/23/2010 */ /* Error:The ENT|01 segment that contains the SSN in the EDI file is */ /* missing for students with no SSN. */ /* Fix : */ /* a)If SSN optional param='Y' and SSN is blank print SSN segment */ /* ENT|01|S2|34|. */ /* b)If SSN optional param='N' and SSN is blank or not blank print */ /* student id segment ENT|03|S2|93| in place of SSN segment. */ /* */ /* 2. Defect 1-DU9Q0R RG 11/04/2010 */ /* Error : SFRNSLC missing Enroll Start/End dates. */ /* Fix : Added the below code in function selstartenddates. */ /* */ /* if (!*partofterm_mindate) */ /* { */ /* tmstrcpy(partofterm_mindate,enroll_start_date); */ /* tmstrcpy(partofterm_maxdate,enroll_end_date); */ /* } */ /* */ /* AUDIT TRAIL: 8.5.6 */ /* 1. RPE 1-1A0YW31 PL 02/12/2013 */ /* New regulatory to collect Expected Grad dates for all enrolled students */ /* and Credential Levels */ /* Fix: Made changes to each run type logic section to obtain and */ /* process credential levels, based on student status, run type and */ /* the class level parameter setting. Add N1 segment to output file */ /* when creating EDI.Smart TS190 file. Added to check for graduation date */ /* for less than half time status. Changed the ENR segment write logic */ /* to include the graduation date for less than half time status records */ /* run modes 2 and 3. */ /* AUDIT TRAIL: 8.5.8 */ /* 1. Defect 1-16O3N2X PL 05/16/2013 */ /* Incorrectly reporting the term start and end dates for the */ /* term in parameter 1 when processing by student centric period. */ /* Time Status is not being reported correctly when processing by */ /* student centric period. Non student centric time status rules should */ /* never be applied when processing by student centric period. */ /* The process which identifies the terms to be included for */ /* reporting is incorrect when processing by student centric period. */ /* Fix: Added a new function select_scpterm_dates, called during */ /* initialization to retrieve the start date of the earliest term for the */ /* scp and the end date of the latest term for the scp. Changed the */ /* selstartenddates function to default scp dates when no student */ /* registration is found. Changed all logic where parameter 1 term dates */ /* were used to look for process for scp and use the scp dates instead. */ /* Changed the sel_full_half_status function to use the parameter */ /* 25 value of Y or N to determine which time status table to use. */ /* 2. Defect 1-C3T47H PL 05/17/2013 */ /* Problem: EB Status on SFRNSLC output not reflecting change in Status */ /* from newest Time Stamp IBM AIX 5.3 only. */ /* Fix: In sel_full_half_status function, replace the catstr with tmstrcat.*/ /* AUDIT TRAIL: 8.6.6 */ /* 1. 150% changes AS 07/25/2014 */ /* 1.Added new variables and the following new procedures: */ /* get_status(),get_enr_data(),calc_overall_status(),get_fos_data(), */ /* get_program_status(),check_student_withdrawn(),check_student_deceased()*/ /* check_stud_apprv_leave(),check_student_graduated(),fill_status_order() */ /* 2.Also modified existing procedure getdata() to display the new segments.*/ /* Modified it for run mode 1,2 and 3. */ /* 3.Modified procedure control_table() to insert value into the new column */ /* sfrtctl_nslc_version. */ /* 4.Removed call to procedure sel_status since the student status will now */ /* depend on program status and will be fetched using new procedues. */ /* 5.Removed all references for input parameter major1cipccode and */ /* major2cipccode. */ /* 6.Added a new paramter OPEID.Added new procedure readopeid for same. */ /* AUDIT TRAIL: 8.6.6.1 */ /* 1. 150% Changes AS 09/01/2014 */ /* Defects Corrected:CR-000119547,CR-000119549,CR-000119826,CR-000119491, */ /* CR-000119491,CR-000120097. */ /* Added the following new procedures validate_nation,get_secondlast_run_date*/ /* selmajr_1_2_cipccode(),fetch_major_data(),sel_majrcipc_desc() and */ /* incl_withdraw_records(void). */ /* Added logic to remove display of pipe at the end of each tag. */ /* Changed the order in which SES,ENR,FOS and NTE are printed. */ /* Added two new parameters Nation Code and Citizenship. */ /* Added logic to display non-current and active programs only if they have */ /* become inactive since July 1, 2014.Also if the withdrawn program has been*/ /* reported twice, it will not be included in future reports. */ /* Placed back display of Demographic information. */ /* AUDIT TRAIL: 8.6.6.2 */ /* 1. Defect:CR-000120170,CR-000120211,CR-000120306. */ /* Solution: Changed SFRNSLC to translate credential level 99 to PC.Changed*/ /* NTE to display 'N' if special program indicator is NULL.Also if ENR01 */ /* is null.the pidm will not be included in report. */ /* 2. Defect CR-000120549 PL 09/17/2014 */ /* Problem: When a student's curriculum is changed using Duplicate, */ /* Replace, or Update, the activity date on the original sorlcur record */ /* is not updated, therefore, the SFRNSLC process does not recognize */ /* the program change. */ /* Fix: Changed get_sovlcur cursor to retrieve */ /* sorlcur_activity_date_update if present for date comparisons */ /* 3. Defect CR-000120574 */ /* Problem:SFRNSLC Error report listing STVACAT issues. All credential */ /* level fields will now be retrieved from the rule in SFACPLR rather than */ /* STVACAT. */ /* Solution: Removed the error corresponding to STVACAT.Also changed the way*/ /* student credential level was picked for the student level SES element */ /* Now the class level and the student credential level will be retrived */ /* from the same record from which student level status is derieved. */ /* Removed procedure sel_level and selcredentiallevel. */ /* AUDIT TRAIL: 8.6.6.3 */ /* 1. CR-000120743, CR-000120777 PL 09/27/2014 */ /* Problem: SFRNSLC is including some changed/withdrawn curricula that */ /* were changed prior to July 1 2014 */ /* Fix: Modified get_program_status. When calculated status is withdrawn */ /* and there is an end term on the sorlcur learner record, logic added to */ /* set program status date to the start date from stvterm for the end term. */ /* 2. CR-000120591 PL 10/01/2014 */ /* Problem: When running SFRNSLC with Parameter 21 Class Level = Null, the */ /* first SES record is not being created. SFRNSLC incorrectly reports a */ /* default value of ZZ when there are no NSC Class Level Translations */ /* on STVCLAS. */ /* Fix: Changed the write of the class data segment to be unconditional. */ /* Changed the default for class code to be 'UN". */ /* 3. CR-000120747 PL 10/01/0214 */ /* Problem: SFRNSLC Run Mode 2 is reporting some enrolled students as EB3 */ /* (withdrawn) - if they have more than 6 active/ non active curricula */ /* Fix: Changed the order by clause in the get_sovlcur cursor to return */ /* records from most current to least current. Added check for term */ /* in the where clause. Added a loop in get_fos_data to process each */ /* major attached to the learner and create the set of records for the */ /* FOS|P segment. Changed references in the arrays from lcur_cnt to */ /* lfos_cnt to process up to 6 majors. */ /* 4. CR-000121728 PL 10/03/2014 */ /* Problem: 1 - Curricula records that are active and non-current may not */ /* be reported if SFRNSLC was run in Run Mode 2 prior to 8.6.6. */ /* 2 - BGN segments are always reported as ES Eastern Standard time */ /* Fix: 1 -Modified get_secondlast_run_date cursor to include term code */ /* and version in the where clause for the SFRTCTL table */ /* 2 - Changed the default ES to LT - local time. */ /* 5. CR-000120873 PL 10/3/2014 */ /* Problem: SFRNSLC Error: 1561 - Program 1 Status Eff Dt is Prior to */ /* Prog Beg Date. */ /* Fix: Added a new function check_start_date that is called when the */ /* status effective date is less than the program begin date to set the */ /* status effective date to the start date of the term. */ /* AUDIT TRAIL: 8.6.6.4 */ /* 1. CR-000121963 PL 10/09/2014 */ /* Problem: SFRNSLC is missing code to handle the case when a student */ /* drops from F to Q, therefore a DTP|007 record with the change date */ /* will not be created. */ /* Fix: added logic to check the drop_in_status from 'F' - full to */ /* 'Q' - 3/4 time for both run mode 2 and run mode 3. */ /* 2. CR-000121958 PL 10/09/2014 */ /* Problem: SFRNSLC not reporting change in program since 7/1/2014 */ /* Fix: Modified get_sovlcur cursor to exclude active but not current */ /* learner records whose end term does not equal the process term. */ /* Changed get_program_status to set program status effective date to the */ /* start date of the end term when there is an end term on the learner */ /* record. Changed get_enrl_data - once a program is considered withdrawn */ /* it will be reported. Removed date comparison and check for how many */ /* times a program has been reported. */ /* 3. CR-000122077 PL 10/09/2014 */ /* Problem: Continuing Education programs for degree-seeking students */ /* need to be excluded. */ /* Fix: Modified get_status which is used to set the SUM segment active */ /* program to Y or N to remove curriculum assigned to the CE level */ /* (stvlevl_ceu_ind) from being counted as active. Modifed get_enr_data - */ /* changed get_sovlcur cursor to identify CEU programs (stvlevl_ceu_ind) */ /* Modified get_fos_data to add program level ceu indicator to the */ /* enrollment_data structure. Added check to skip any field of study */ /* majors attached to a curriculum assigned the CEU level. Modified the */ /* cursor in fetch_major_data to return only fields of study assigned to a */ /* program that is not a CEU program. Modified logic to suppress all FOS */ /* segments where the reported curriculum is at the CEU level. */ /* 4. CR-000121975 PL 10/09/2014 */ /* Problem: Records are being rejected when data includes puncuation. */ /* Fix: Modified sel_majrcipc_desc cursors to strip out any characters */ /* that are not alphanumeric in the major descriptions. Modified */ /* seladdr to strip out any characters that are not alphanumeric in */ /* street line 1 and street line 2. */ /* 5. CR-000122073 PL 10/17/2014 */ /* Problem: Program grad date for EB4 (Graduate) is rejected when the */ /* date is past the report term end date. */ /* Fix: Added logic to set the grad date to the report term end date */ /* if the grad term is past the end of term date. */ /* 6. CR-000122086 PL 10/17/2014 */ /* Problem: SFRNSLC may still reject records with the following error: */ /* Program 1 Status Eff Dt is Prior to Prog Beg Date if the reported */ /* time status date is prior to the report term start date. */ /* Fix: Added logic to ensure that all status dates are checked against */ /* the report term start date and that the term start date will be */ /* substituted for the status date in the report file if the report date */ /* preceeds the start date. */ /* 7. CR-000121997 PL 10/17/2014 */ /* Problem: SFRNSLC may not create DTP|007 records when SFRNSLC was run */ /* for the Term using a pre-8.6.6 version of SFRNSLC */ /* Fix: Removed the comparison of SFRTCTL_NSLC_VERSION = '8.6.6' */ /* from cursor_055 in the control_report function. */ /* 8. CR-000122030 PL 10/17/2014 */ /* Problem: SFRNSLC will incorrectly create DTP|007 statements when the */ /* date on the time status history record is before the start of the term */ /* Fix: Logic added to confirm that the time status date for the drop in */ /* status logic is on or after the term start date. Replaced the time */ /* status date with the term start date for ENR reporting. */ /* of the report term. */ /* AUDIT TRAIL: 8.6.6.5 */ /* 1. Defect CR-000120590 PL 10/29/2014 */ /* Problem: SFRNSLC is defaulting a Y for the Program Indicator Code for */ /* non-degree seeking students. */ /* Fix: Changes made throughout the program to identify non-degree majors */ /* and suppress reporting of those majors. The majors are identified in */ /* the get_fos function by checking the credential level returned from the */ /* call to the SFKCPLR package. If that value is '00', the major will */ /* not be reported in either the FOS|M record or the FOS|P segment loop. */ /* If all of the student's qualifying learner records are detected as */ /* having only non-degree majors the SUM record will be created with an N */ /* for active programs. */ /* 2. CR-000120556 PL 10/31/2014 */ /* Problem: sfrnslc runmode =1 missing anticipated graduation date check */ /* error on 3/4 time status students. */ /* Fix: Added check of stud_status = 'Q' in the anticipated graduation */ /* date edit. */ /* 3. CR-000122228 PL 10/31/2014 */ /* Problem: 4 part issue where students are not included in the error */ /* report or text file, or the error report is not complete. */ /* Fix: When stud_status was null due to no time */ /* status, removed logic that skipped both error reporting and writing to */ /* sfrnslc.txt when stud_status is null. */ /* 4. CR-000122247 PL 10/31/2014 */ /* Problem: An Oracle error may occur when address lines 1 or 2 are null */ /* Fix: Made the oracle function REGEXP(REPLACE) conditional so that it */ /* it is only executed when data is contained in those fields. */ /* 5. 1-1261WPK PL 10/31/2014 */ /* Problem: An Oracle error can occur when running SFRNSLC with Parameter */ /* 21 Class Level = Y and Parameter 06 Run Mode = 2 or 3 and the class */ /* code cannot be calculated within the SGACLSR rules. */ /* Fix: Added an COALESCE wrapper around the call to the SGKCLAS package. */ /* 6. 1-1932JYA PL 11/03/2014 */ /* Problem: SFRNSLC will display incorrect messages when running SFRNSLC */ /* with a Population Selection */ /* Fix: Changed SELSTMT2 cursor definition - replaced SPBPERS_PIDM with */ /* SPRIDEN_PIDM. The PIDM variable for students with no SPBPERS record */ /* was null, causing other PIDM lookups on tables to fail and give */ /* incorrect error messages. */ /* 7. CR-000122308 PL 11/03/2014 */ /* Problem: The fix for Defect CR-000122073 did not fix the Graduation */ /* Date being reported at the Program Level in the ENR records. */ /* Fix: Added logic to get_fos to check for graduated status. If true */ /* execute the sel_grad_dte_g function to get the correct end of term */ /* date and write it to the array used for FOS|P segment loop. */ /* AUDIT TRAIL: 8.7.0.1 */ /* 1. CR-000122530 MH/PL 11/06/2014 */ /* Problem: An active and non-current curriculum record is incorrectly */ /* reported at the Program Level as EB3 (Withdrawn). */ /* Fix: Changed get_fos_data to check for duplicates prior to writing */ /* to the arr_enrdata array. Check if there is an entry in the array */ /* with same credential level and major,replace if the status has higher */ /* priority. If it has lower priority do not add to the array. Added logic */ /* to report students with majors with missing cipc codes to the error */ /* report. */ /* 2. CR-000122550 PL 11/10/2014 */ /* Problem: Some students with non-degree majors are being reported */ /* incorrectly when running with a large pop-sel. */ /* Fix: Added code to initialize all counters and arrays that contain */ /* student data with each new student processed in get_enr_data. */ /* 3. CR-000122513 PL 11/11/2014 */ /* Problem: SFRNSLC may report registered students as withdrawn. Students */ /* whose primary learner is a CEU level and that have non current but */ /* active learner(s) where the end term matches the report term are */ /* reported as withdrawn. */ /* Fix: Remove check that prevented CE level data from being included in */ /* the get_fos_data logic. Added checks in the FOS|P write loop to */ /* skip any data that applies to a CE level program. */ /* 4. CR-000122559 PL 11/12/2014 */ /* Problem: SFRNSLC will incorrectly report a student as EB3 (Withdrawn) */ /* when the student has no time status or the NSC equivalent is unspecified */ /* and the student has a curriculum record that was ended in the term */ /* entered when running SFRNSLC. */ /* Fix: Modifed calc_overall_status to look for a null program status in */ /* the first entry of the arr_enrdata array and allow that status to be */ /* selected for reporting. */ /* 5. CR-000122084 PL 11/13 2014 */ /* Problem: sfrnslc is reporting active/current and active/non-current */ /* major field of study records with the same EB enrollment status when */ /* student has an ended curriculum that ends in the same term as the */ /* report term and that curriculum is a duplicate of the current and */ /* active curriculum. */ /* Fix: Added code in get_fos_data - modified the c_sovlfos cursor, */ /* removed the check for sovlfos_active_ind = 'Y', Added code to examine */ /* the active and current indicators. All current and inactive, and non */ /* current and active to be reported as withdrawn. Non current and non */ /* active records will not be reported. Records identified as withdrawn */ /* will be reported with the start date of the report term as the status */ /* date. */ /* 6. CR-000122759 PL 11/13/2014 */ /* Problem: An Oracle error may occur when processing a student whose */ /* contains only punctuation in strett line 1 and street line 2. */ /* Fix: Added an COALESCE wrapper around the regexp function. Added code to */ /* check the address lines returned for the COALESCE value and set them to null */ /* for reporting. */ /* AUDIT TRAIL: 8.7.1 */ /* 1. CR-000122966, CR-000122967,CR-000122970 MH & PL 11/20/2014 */ /* CR-000122966 /* SFRNSLC/SFRSSCR should report Program start/begin date as the first /* date the student began pursuing a certain major. /* CR-000122967 /* Program Status Effective date needs to be the first date a student /* started at a particular status for a certain program. /* CR-000122970 /* When a student changes major within the term, the Field of Study Major End /* Term is not populated when the major is made inactive or non-current, /* which will cause the major to be reported as withdrawn with each run of SFRNSLC/SFRSSCR. /* Withdrawn majors should only be reported for the term they were withdrawn in. /* Fixes for calculating the program start date and effective date and knowing if a major /* withdrawn has been previously reported : /* i) Add new job submission parameter 29 to list all previously required /* reporting terms. Determining gaps in enrollment based on reviewing the terms in the list. /* Add new procedure find_gap to get the missing enrollment term /* for the student. The program status effective date will be after the gap. /* ii) Created new function create_reported_majors called to create an */ /* sfrmnsc record all majors reported to nslc. The table is strictly audit trail /* information to help users track reported data and created during run mode 2. /* iii) Modified get_fos_data. Modified the cursor to return needed columns */ /* for new insert logic. Added variables to the arr_enrdata to save these */ /* values. Revised cursor to select all unique majors in desc seq order */ /* iv) In get_fos_data added new cursor to get min sovlcur term for lcur with same /* major and same level. The term start date becomes the program start date. /* v) Add new procedure to get the last term the student was enrolled before the report term. /* All curriculum changes are reported if the change occurred between the students last enrollment /* term in the reporting term. /* vi) In get_fos_data skip reporting withdrawn majors if the term /* is before the last term the student was enrolled or the lcur end term is filled in on the lcur and /* is not between the last enrolled term and current reporting term. The effective date for the withdraw is /* the term start date when the curriculum was ended if there is an end term, else its the start date on the lfos /* term. /* vii) Replace all cursors to find reporting term's effective date in sel_full_half_status /* with new cursors, one if a gap exists and one not. The new cursors read the time /* status records in term and date descending order to get the first occurrence of the time /* status. A new view sfvtmst was created to pull time status for each term the student is enrolled /* and since the last gap in enrollment if one exists. The new view gets the time status as of the /* reported periods for each term. The date on the earliest occurrence of the time status since any gap is used /* as the effective date. /* viii) add the sel_full_half_time as sel_last_full_half_time to compare previous /* tmst as of the last reporting date to the current one. If the student drops from full time /* to less a DPT|007 is reported to show the drop. */ /* */ /* 8. CR-000122390 PL 12/03/2014 */ /* Problem: NSC is rejecting records with 3 characters in the State/Province */ /* for foreign addresses. */ /* Fix: Add logic around the creation of the N4 record to check for */ /* nation codes identified as Canada or the US and change the state value */ /* to 'FO' when address belongs to other nations. */ /* */ /* AUDIT TRAIL: 8.7.2.1 */ /* 1. Defect CR-000123588 PL/RLG 01/23/2015 */ /* Problem: The process may abort when a student has INACTIVE sorlfos */ /* records, where there is no priority 1 record entered. */ /* Fix: Modified the lfos_first_term_c cursor. Commented the check for */ /* sovlfos_active_ind = 'Y'. */ /* 2. Defect CR-000124719 PL 01/23/2015 */ /* Problem: The time status codes for Continuing Education only terms */ /* are being considered for regulatory reporting. If a student is in a */ /* degree seeking program, their time status for Continuing Education */ /* should not be considered. */ /* Fix: Modified the cursors that read sfvtmst in sel_full_half_status. */ /* Added a look-up on sfrstcr for the term. If all course level codes are */ /* determined to be CEU level courses, discard that term's time status */ /* when calculating program status effective date. Add the same check to */ /* the get_prev_enrl_gap cursor in find_gap. */ /* 3. Defect CR-000124664 PL 01/26/2015 */ /* Problem: When the student has more than one degree record that both */ /* match the program in Learner, and the first degree seq number is not */ /* the awarded degree, the program is reported as withdrawn. */ /* Fix: Modified the check_student_graduated method. Removed code that */ /* checked for the rolled sequence number in the learner to return the */ /* shrdgmr record based on that. The code will now look for awarded */ /* degrees by matching the curriculum elements not the rolled sequence number. */ /* 4. CR-000124815 PL 01/29/2015 */ /* Problem: SFRNSLC should not be looking at the report flag that gets */ /* stored in SFRTCTL (parm 3 in SFRNSLC) when determining program status */ /* effective date. */ /* Fix: Modifed the cursor in the sfrtctl control table lookup. */ /* Removed the check for sfrtctl_rprt_standard_ind from the where clause. */ /* Changed the cursors that read sfvtmst. Removed the check for a match */ /* on sfvtmst_rprt_standard_ind from the where clause. */ /* 5. CR-000124192 PL 02/02/2015 */ /* Problem: Graduated programs reported in a previous term are reported */ /* as withdrawn in a subsequent term. */ /* Modified get_fos_data to identify a non current graduated program and */ /* do not report the status in the FOS|P loop segments. */ /* 6. CR-000125333 PL 02/06/2015 */ /* The program start date is currently calculated by finding the earliest */ /* learner record with the same curriculum level and a major that matches */ /* the major being processed. */ /* Fix: Modified the get_sovlcur cursor to retrieve the stvdegc_acat_code */ /* for the degree code on the sovlcur record. Modified the */ /* lfos_first_term_c cursor to include a comparison of the learner degree */ /* acat code in the subquery that returns the minimum term code of the */ /* learner for the major being processed. */ /* AUDIT TRAIL: 8.7.4 */ /* 1. CR-000125678 PL 02/20/2015 */ /* Problem: When SFRNSLC run for a term, and is processing a large number */ /* of students,some may be missing the campus level time status code and */ /* anticipated graduation date. */ /* Fix: Corrected conflicting field definitions. Added logic around */ /* the missing cipc code array to ensure that it will process the correct */ /* number of rows. Added code to set all fetched columns to null when the */ /* result of the fetched cursor is not found to cursors get_sovlcur, */ /* get_prev_enrl_gap, and c_sovlfos. Corrected the where clause in the */ /* last_enrollment_c cursor to use term_to_process variable. */ /* 2. CR-000124227 PL 02/24/2015 */ /* Problem: Reporting different Major codes that use the same CIP code: */ /* The guidance is that if there are two programs/majors that are */ /* identical in the Department of Education's way of evaluating programs */ /* (OPEID, credential level, CIP, program length), they should be merged */ /* and reported with earliest begin and latest end dates. */ /* Fix: Changed the logic in get_fos_data that was comparing major code */ /* and credential level to decide if the major was a duplicate or not to */ /* to compare cipc code, program length and credential level to identify */ /* duplicates. Moved the call to get_program_status from the learner level*/ /* to get_fos_data so that each major's status is calculated. Added two */ /* new arrays, arr_duplmajr and arr_gradmajr to process duplicate majors */ /* where there is a graduated status(es) and enrollment time status(es). */ /* In that case all majors are reported in the FOS|P loops. */ /* Modified fill_status_order, enrollment time status takes priority over */ /* graduated status when a programs of each time are being reported. */ /* Modified the lfos_first_term_c cursor to compare cipc codes rather than */ /* major codes when determining program begin date. Added several functions */ /* to support this reporting. arr_duplmajr is a mirror image of arr_enrdata plus*/ /* duplicates. arr_gradmajr contains any non current active graduated */ /* major data. load_duplicate_array creates the arr_duplmajr data. */ /* write_to_save_graduated_majors creates the arr_gradmajr data. */ /* review_majors is called after each learner and it's majors are */ /* processed. It reviews arr_duplmajr against enrollment data arr_enrdata */ /* and calls add_to_arr_enrdata to add duplicate majors back into */ /* arr_enrdata when there a duplicate majors in both graduated and */ /* enrollment statuses. update_status_date is called to reset the PSED of */ /* enrollment status to be one day past graduation date, when there */ /* are both graduation status and enrollment status for a duplicate */ /* major to be reported. Removed the check for PSED greater than the term */ /* end date when creating the .txt file to allow this new requirement. */ /* list_out_array displays the content of arr_enrdata after other */ /* processing is complete for debug purposes only. */ /* 3. CR-000126483 PL 03/05/2015 */ /* Problem: The Program Status Effective Date may be reported with a date */ /* greater than the Certification Date. This occurs when reporting a */ /* withdrawn program whose end term is greater than the report term. */ /* Fix: Modified get_fos_data comparison that examines the learner end */ /* term to include a check for end term greater than report term, and */ /* bypass that record instead of reporting it. */ /* 4. CR-000124885 PL 03/09/2015 */ /* Problem: When there are different groups of students that need to be */ /* reported in the same run of SFRNSLC, there is no way to determine */ /* required terms if they are different between the groups of students. */ /* Fix: removed code around job sub parameter 29. */ /* Added new function findcpltseqno to retrieve the correct required terms */ /* rule. This function reads the new sovcplt view to locate primary current */ /* active curriculum and match it to a required terms rule. Modified the */ /* get_prev_enrl_gap cursor for finding enrollment gaps and the cursors for */ /* time status to use the new required terms table sfrcptt that replaces */ /* parameter 29 values. /* 5. CR-000122822 PL 03/10/2015 */ /* Problem: When SFRNSLC is run in Run Mode 1, the "No Matching Rule on */ /* SFACPLR" should not be produced when the curriculum level is defined */ /* as a CEU level. */ /* Fix: Modified the logic that sets the err_no_match variable to one, */ /* added a check for CEU level equal to N, so that the no match on the */ /* SFACPLR rule message is only provided when the curriculum level is not */ /* a CEU level(CEU Indicator checked on STVLEVL). */ /* 6. CR-000126813 PL 03/12/2015 */ /* Problem: An error will be reported by NSC if the state code reported */ /* is more than 2 characters and the nation code edi equivalent */ /* is "US" (United States) or "CA" (Canada). */ /* Fix: Added a check for the length of the state code and produce an */ /* error message if detected to the missing and invalid data report. */ /* 7. CR-000127296 PL 04/03/2015 */ /* Problem: a) When the Learner curricula has multiple majors assigned but the */ /* corresponding Outcome curricula for the awarded degree does not have */ /* all majors assigned, all majors from the Learner curricula are being */ /* reported as Graduated. b) The Learner curricula has two majors assigned.*/ /* There are two SHRDGMR degree records created (one for each major), but */ /* only one degree is awarded, both majors from the Learner curricula are */ /* being reported as Graduated. */ /* Fix: Modified check_student_graduated degree_c cursor to remove requirement */ /* that curriculum elements from the outcome record match the */ /* curriculum elements of the parent learner for the major being processed. */ /* Campus,acat and major codes are the new requirement to determine if */ /* there is an awarded degree for the major being processed. */ /* 8. CR-000130331 PL 06/15/2015 */ /* Problem: The awarded degree cursor is processes are not looking at the */ /* degree sequence when comparing the learner records to degree records, */ /* causing Sought status records to be treated as graduated. */ /* Fix: Modified degree_c cursor to include a check of the outcome record's */ /* key sequence number against the SHRDGMR sequence number. */ /* 9. CR-000130084 PL 06/15/2015 */ /* Problem: The Class Level is not being reported correctly. */ /* Fix: Modified calc_overall_status, restore the setting of stud_levl_code */ /* stud_credential_level to the array values. */ /* 10.CR-000130144 PL 06/15/2015 */ /* Problem: fetch into cursor get_sovlcur uses the same indicator Ind_12 */ /* for 2 variables lcur_levl_ceu_ind and lcur_active_ind. */ /* Fix: Modifed get_sovlcur cursor to assigned unique indicators to each */ /* column fetched. */ /* AUDIT TRAIL: 8.8.3.3 */ /* 1. CR-000130099 PL 07/07/2015 */ /* Problem: SFRNSLC Majors that have the same CIP - when one is graduated*/ /* and one is enrolled, the enrolled record should have a later effective*/ /* date. */ /* Fix: Modified sel_full_half_status. Added prev_degree_c cursor to */ /* select the grad term of a duplicate major that has been awarded. */ /* Modified tmst_with_gap_c and tmst_without_gap_c cursors in new package */ /* sfkenrl.p_find_time_status_psed to eliminate time status records whose */ /* term is less than or equal to the awarded degree's grad term. This */ /* will cause the program status effective date to be later than the */ /* program status effective date that was posted for the awarded degree. */ /* 2. CR-000127860 PL 07/08/2015 */ /* Problem: The fix for Defect CR-000124719 did not completely fix all */ /* occurrences where the time status codes for Continuing Education only */ /* terms are being considered for regulatory reporting for degree seeking*/ /* students. */ /* Fix: Added code for new job submission repeating optional parameter */ /* 30 to identify continuing education level codes to be used in */ /* conjunction with stvlevl_ceu_ind = 'Y'. Replaced code in find_gap */ /* with call to new package sfkenrl.p_find_gap. Replaced code in */ /* get_last_enrollment with call to new package */ /* sfkenrl.p_find_last_enrollment. Replaced code in sel_full_half_status */ /* with call to new package sfkenrl.p_find_time_status_psed. Added code */ /* throughout as needed to look for the new parameter as well as the */ /* stvlevl_ceu_ind = 'Y'. */ /* Problem:When a student does not have coursework or a sfbetrm for */ /* SFRNSLC run term, and that term is in a centric period where the */ /* student does have course work and a valid time status, the centric */ /* period time status is correctly reported. The status effective date is*/ /* being reported incorrectly as the beginning of their first term for */ /* that Major instead of the status in SFASCPR. */ /* Fix: Modified sel_full_half_status. If no earlier time status exists */ /* for the period, set the fhl_date to the current time status date. */ /* 2. CR-000130011 PL 10/08/2015 */ /* The dates on DTP|007 records for students on leave or withdrawn may */ /* be incorrect when running for student centric periods. */ /* Fix: added logic to use the start date of the period for both on leave */ /* and withdrawn status. Added initialization of leave and withdrawn */ /* variables to get_enr_data. */ /* AUDIT TRAIL: 8.9.0.4 */ /* 1. CR-000136163 PL 11/30/2015 */ /* Problem: SFRNSLC needs to report the Leave of Absence From Date from */ /* the Miscellaneous Tab of SGASTDN for the Status Date on the DTP|007 row. */ /* Fix: Removed logic to reset the date reported on the DTP|007 row for */ /* leave of absence to the term start date when the leave date is prior */ /* to the term start date for report mode 2 and 3. */ /* 2. CR-000135122 PL 12/01/2015 */ /* Problem: A value of UK should be reported in the address columns when */ /* a student has no address information. This is a new reporting */ /* requirement which is documented in the October 2015 NSLDS Enrollment */ /* Reporting Guide. */ /* Fix: Modified seladdr to set a variable to indicate that no valid address*/ /* was found for the student. Modified code that processes the N3 and N4 */ /* to set street line 1 to 'UK', and suppress the N4. */ /* 3. CR-000132103 Pl 12/10/2015 */ /* Problem: Add Achieving the Dream fields to SFRNSLC, remedial attribute */ /* and Pell grant receipient flag. */ /* Fix: Modified the run mode 2 and 3 logic that writes the SUM record */ /* to inlcude these new Y/N flags, remedial attribute in SUM 02 and */ /* Pell grant recipient flag in SUM 10. The process calls sfkenrl.f_find */ /* attribute and sfkenrl.f_find_pell accordingly to set the values of these*/ /* flags for each student. Also added logic, variables throughout for the */ /* new job submission parameters 31 and 32. Updated control report to */ /* these new parameters. */ /* AUDIT TRAIL: 8.10.7.1 */ /* 1. CR-000141358: RG 08/23/2016 */ /* Problem: Campus level effective date needs to be the actual date of */ /* withdrawal date. */ /* Solution: When status is W (Withdraw) at campus level, we will now show*/ /* the actual withdrawal date at DTP|007 row. Commented out the */ /* code which was replacing the actual wd date to term start date.*/ /* */ /* 2. CR-000141322: RG 09/15/2016 */ /* Problem: Students are incorrectly reported as EB3 under the following */ /* conditions. */ /* => Student has a time status for the term that does no have */ /* an NSLC Equivalent on STVTMST or the student has no time */ /* status for the term. */ /* => Student has a curriculum record that was ended in the term */ /* entered when running SFRNSLC. */ /* Solution: If there is no time status for term code or nslc equivalent not*/ /* available on stvtmst table, prog_status in array arr_enrdata is*/ /* inserted as null and when duplicate check occurs, added below check*/ /* to see if current fos withdraw status is "W" it should not override*/ /* the null prog_status which is higher the current status "W" and*/ /* this can happen only in cases as mentioned above and rest of the*/ /* cases prog_status should never be null. */ /* */ /* tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("")) */ /* */ /* AUDIT TRAIL: 8.13 */ /* 1. CR-000145110 AS 02/13/2017 */ /* Problem: When a student changes from a degree seeking program to a non-degree*/ /* seeking program, a withdrawal date is needed for the degree seeking program. */ /* Solution:Added a new procedure chk_withdrawl_degree_seek_exists and called it*/ /* from getdata. */ /* */ /* AUDIT TRAIL: 8.14.1 */ /* 1. CR-000148696 RG 03/10/2017 */ /* Problem: The Status Start Date on the DTP|007 row is being reported incorrectly */ /* by SFRNSLC when a student is registered in part of term that extends past the */ /* end date for the term on STVTERM and the student is being report as graduated (EB4)*/ /* Solution : A student who is registered in a part of term that exceeds the STVTERM */ /* end date will have the part-of-term end date reported in the DTP|007 record and */ /* NOT the STVTERM_END_DATE if the student record status is graduated. */ /* a) */ /* Commented out the below part of code which was re-initializing date to stvterm*/ /* end date when POT end date or anticipated grad date was greater than stvterm */ /* end date. */ /* */ /* if ( (*grad_date_g) && (tmstrcmp(term_end_date,grad_date_g) < 0) ) */ /* { */ /* (tmstrcpy(grad_date_g,term_end_date)); */ /* } */ /* */ /* b) Modified cursor in method sel_grad_date_g() to fetch anticipated grad date in either */ /* of two cases .i.e. SFRSTCR_GRDE_DATE is not null or ( STVRSTS_INCL_SECT_ENRL = 'Y' */ /* and STVRSTS_VOICE_TYPE = 'R' ). */ /* */ /* 2.CR-000150887 RG 10/09/2017 */ /* Issue : NSC has changed their processes on the data that is reported to NSLDS. */ /* NSC allows institutions to set up dummy branches which should not be sent to NSLDS. */ /* To accommodate this new practice the OPEID parameter field for the SFRNSLC process */ /* needs to be set from 'Required' to 'Optional'. */ /* Solution : Parameter 26 - OPEID field should be changed from 'Required' to 'Optional' */ /* making 'Null' a valid value. SFRNSLC Process Changes to TXT Output : */ /* When Parameter 26 - OPEID field is Null the ENT|05 line should be removed from the */ /* output in the TXT file. */ /* */ /* AUDIT TRAIL: 8.16 */ /* 1. CR-000155715 RG 04/20/2018 */ /* Issue : Add functionality to include Final Exam dates in Enrollment Reporting. */ /* Resolution : a)Created new variables: usefinaldateflag,final_end_dates. */ /* b)Created new methods:readusefinaldate(),selfinaldates(). */ /* c)Added logic to retrieve new parameter value for 33, Use Final Dates.*/ /* d)Added logic in selfinaldates() to get max final date from new tables*/ /* sorfncr/sorfnpt for the CRN or POT. */ /* e)Modified selstartenddates() to support this new functionality to Use*/ /* Final dates. */ /* f)Modified sel_grad_date_g() to get max grad date from the above new */ /* tables or PTRM DATE if parameter 33 value = Y. */ /* g)DTP|382|RD8| dates will be displayed based on this new logic if */ /* parameter 33 value = Y. */ /* */ /* AUDIT TRAIL: 8.16.1 */ /* 1. CR-000159904 RG 07/25/2018 */ /* Issue : Issue SFRNSLC, When run with parm 33 = Y (use final's Date) a student */ /* may be reported with a end date from another Part of term from SOAFNDT.*/ /* Resolution : Re-initialized below variables for every new student with original value.*/ /* tmstrcpy(enroll_end_date,enroll_end_date_orig); */ /* tmstrcpy(scp_term_end,scp_term_end_orig); */ /* */ /* AUDIT TRAIL: 8.17.0.2 */ /* 1. CR-000163330 RG/AP 20-NOV-2018 */ /* Issue : Currently when a student changes their major/program, the start date */ /* of the term in which the program/major was changed is reported as the */ /* Program Status Effective Date. Now requires that the actual */ /* date the program change took place be reported. */ /* Resolution : */ /* 1) Add 2 new Tmchar variables to store program start and end dates : */ /* lcur_prog_start_date , lcur_prog_end_date. */ /* 2) Modified "EXEC SQL DECLARE get_sovlcur CURSOR FOR" in get_enr_data()*/ /* method, to fetch SOVLCUR_START_DATE and SOVLCUR_END_DATE in format */ /* 'YYYYMMDD' and store the values in variables lcur_prog_start_date */ /* and lcur_prog_end_date. */ /* 3) Modified get_fos_data() cursor c_sovlfos to provide the format mask */ /* for Sovlfos_start_date and sovlfos_end_date in format 'YYYYMMDD'. */ /* 4) Modified get_program_status() to populate (fos_end_Date or */ /* lcur_prog_end_date) instead of STVTERM_START_DATE in "else */ /* /* if not current */ /*condition" part only if one of the value is not null, else */ /* /*it populate the same value as it is currently now populating STVTERM_START_DATE. */ /* 5) In get_fos_data() method, modified the "Program Begin Date" to be */ /* either fos_start_date or lcur_prog_start_date if value exists, else */ /* it will be STVTERM_START_DATE. */ /* 6) In get_fos_data() method, for withdrawn status fos_end_date or */ /* lcur_prog_end_date is populated instead of lcur_term_code_end's */ /* stvterm_start_date. */ /* 7) Modified struct enrollment_data,dupl_majors,grad_majors to include */ /* 4 new variables to store fos start and end dates, and program start */ /* and end dates. */ /* 8) Modified array enrollment_data,dupl_majors,grad_majors elements to */ /* store fos start and end dates, and program start and end dates. */ /* 9) Modified get_program_status() method, if fhl_date is lesser than */ /* fos_start_date or program_start_date then prog_enr_stat_eff_date */ /* will be fos_start_date or program_start_date. */ /* 10) Added logic to fetch the new 34th parameter into usecurrstartenddatesflag */ /* for "Use Curriculum Start/End Dates". Also added logic to print/use */ /* program/major Start/End Dates only when this new parameter value is Y */ /* Otherwise report should Report Program Start Date and Program Status */ /* Effective Date as per previous logic. */ /* 11) Modified "get_fos_data()" method. Modified "c_sovlfos" cursor to have a new criteria as */ /* and COALESCE(m.sovlfos_active_ind,'N') = 'Y' */ /* This criteria is added in subquery so that subquery should only fetch the */ /* "Current and Active" and "Non-Current and Active" major records and should not */ /* fetch "Inactive" major record. This is becasue the Start/End Dates from pop-up */ /* are being updated for "Non-Current and Active" record when user Inactivate a */ /* Major. */ /* 12) In case of multiple Majors having same CIP Code and Old Major was Inactivated */ /* and New Major inserted but they both have the same CIP Code so the EB3 record */ /* with do not appear in output similarly the "Program Begin Date" and "Program */ /* Status Effective Date" for EB6 (or Time Status record) should also display the */ /* from old Major Record or the Date which is lesser. */ /* Modified "get_fos_data()" method. Modified "c_sovlfos" cursor to */ /* have a new order by clasue as "Decode(COALESCE(sovlfos_current_ind,'N'),'Y',1,'N',2)" */ /* The complete order by clause looks like following: */ /* order by Decode(COALESCE(sovlfos_current_ind,'N'),'Y',1,'N',2),sovlfos_priority_no, sovlfos_seqno desc; */ /* This order by change will actually pull the "current and Active" records first */ /* and then the "Non-Current and Active" records. */ /* Declared a new variable "orig_prog_enr_stat_eff_date_for_dup" to hold*/ /* the value of Original "Program Status Effective Date" based on Time Status */ /* for current looping Major. */ /* Also added an "else" condition for "fos is a duplicate so its skipped writing in Arrays" */ /* In this else part have put logic to replace the value of "Program Status Effective Date" */ /* in Array arr_enrdata[lfos_write].prog_enr_stat_eff_date from "orig_prog_enr_stat_eff_date_for_dup" */ /* Also in another situation where FOS is not Duplicate but having Same CIP Code, */ /* added logic to check when CIPC, Credential Level and Program Length are same for 2 Majors */ /* System checks the "Program Begin Date" of both Major records and keeps the lesser value in Array." */ /* Same logic fro "Program Status Effective Date" as well. */ /* 13) When the student changes a major in a new term, and the new major has the same */ /* CIP and program length criteria as the original major, AND the dates in the */ /* pop-up box are nulled out when updating the major in the new term, AND the */ /* student is enrolled for the same status as the originating (previous) term, */ /* the program status effective date is incorrectly resetting to the new term's */ /* start date. When this criteria is all met, the original program start and */ /* program status effective date should continue to be the dates reported. */ /* User's should not null out a start date for a program, if they do, it's */ /* a user issue and not a coding issue. If a user nulls out a start date, */ /* then the stvterm_start_date is reported in the new term where the new major */ /* is assigned. This would be a user issue and not something we'll address from */ /* a coding perspective. However, the program status effective date should not */ /* reset to the start of the new term where the major is changed, and right now, */ /* it is getting reset. This is the issue we need to focus on fixing. */ /* Solution: */ /* Created a new method sel_full_half_status_for_term_code(). */ /* This sel_full_half_status_for_term_code() method is being used to Determine the */ /* Program Status Effective DATE only for the Program/Major which was withdrawn. */ /* It calculates the Status and Date based on the Term Code being Passed. */ /* In Multiple Major Same CIP Code scenario, the Term Code being Passed will be */ /* the Term Code in which the Program/Major was Active. Since in this scenario the */ /* PSED needs to be reported as it was reported in earlier Term when it was Active. */ /* This method is being called in get_program_status() and under */ /* usecurrstartenddatesflag=Y condition and after this method call */ /* irrespective of Program Status Determined by this method, the Program Status */ /* will be made as W but Program Status Effective Date is been used for reporting. */ /* This method is not using SCP_Process = Y. It will be used only for processing */ /* Regular Term. */ /* 2. 1-ERPAVT RG/AP 31-AUG-2018 */ /* Issue : SFRNSLC parm 24 = Y does not look for STVRSTS_INCL_SECT_ENRL = 'Y' */ /* in looking at SFRAREG. */ /* Resolution : */ /* Modified selstartenddates() to add STVRSTS_INCL_SECT_ENRL = 'Y'. */ /* Modified selfinaldates() to add STVRSTS_INCL_SECT_ENRL = 'Y'. */ /* AUDIT TRAIL: 8.18.1 */ /*1. CR-000165558 AS 17/05/2019 */ /* Issue:SFRNSLC is aborting with the following error in Runmode = 2 when the student has*/ /* Program information (current or Ended in run term) and there is no matching rule in */ /* SFACPLR for that data.Cannot insert NULL into ("SATURN"."SFRMNSC"."SFRMNSC_START_DATE")*/ /* Solution: Modified get_fos_data,placed an if clause to consider the case when major is */ /* not duplicate and is a new major and a new array element has to filled. */ /* */ /* 2. CR-000164412 AP 27-MAY-2019 */ /* Issue : SFRNSLC may not reporting correct withdrawal date in program student */ /* effective date */ /* Resolution : */ /* This is a very specific scenario. The steps/example to replicate the */ /* scenario are as follows: */ /* 1. Add or create a student within Term 301910, Program: BA-ARTS, */ /* Major: Art. */ /* 2. Student A00076086 has been created with BA-ART curriculum record */ /* and Registered in 101 CRN for 301910 Term on 10-APR-2019. */ /* 3. Open SFAREGS, term = 301910 and ID= A00076086 and Withdraw 101 CRN */ /* on 15-May-2019. Save. */ /* 4. Start Over and withdraw (Enrollment Information Section) the student*/ /* for term 301910 on 15-May-2019. Save. */ /* 5. Check data in SFAWDRL page for 301910 where the Withdrawal Date is */ /* showing as 15-May-2019. */ /* 6. Before Updating the Curriculum Record , Run SFRNSLC for term 301910 */ /* and PSED get displayed as 15-May-2019 which is the withdrawal date */ /* ( param 34 is marked as Y). */ /* 7. Now update the curriculum on 20-May-2019. */ /* Start Over > Go to "Curriculum" tab > Click on Update button. > */ /* Pop-up box will appear > Remove the default End Date (Start a& End */ /* Date both should be empty) > Click Ok > No Other Data added/Modified*/ /* Just Save the Records. */ /* 8. After Updating the Curriculum Record , Run SFRNSLC for term 301910 */ /* and PSED get displayed as the STVTERM start date 01-Sep-2018 */ /* instead of the withdrawal date ( param 34 is marked as Y). */ /* Modifications : */ /* 1) Modified get_fos_data() to call the check_curriculum_changed() */ /* when Status is determined as W and there is FOS Start/End Dates */ /* available and "Term Code End" is available */ /* */ /* 2) Added 3 new functions: check_major_changed(),check_program_changed()*/ /* and check_curriculum_changed(). */ /* Added code in check_major_changed() to fetch the Start/End Date */ /* of the "Non-Current and Active" record for the Major being processed*/ /* If the record found that means user has not changed the Major Code */ /* In this case the Actual Withdrawal Date should be displayed as PSED */ /* So check_major_changed() return False to denote No data has been */ /* changed. It return True if Major Data changed */ /* check_curriculum_changed() function checks if Program or Major has */ /* been changed and accordigly returns True or False. */ /* */ /* 3. CR-000166458 AP 19-JUN-2019 */ /* Issue : When a student is withdrawn in the term, SFRNSLC is not sending the */ /* term end date from SOAFNDT when parm 33 = Y (use Final dates) and */ /* there is a row in SOAFNDT for the part of term. */ /* /* This change will make the term end date consistent with the term end */ /* date that was previously reported in the term for the student. */ /* Resolution : */ /* The issue happens only when option has been unchecked on STVRSTS */ /* (Step 5 in pre- requisites) Withdrawn courses typically do not count */ /* towards enrollment totals. */ /* */ /* In 8.17.0.2 we fixed 1-ERPAVT - the resolution is Modified */ /* selstartenddates() to add STVRSTS_INCL_SECT_ENRL = 'Y'. */ /* */ /* We changed the behavior so that if the Count in Enrollment box is */ /* unchecked, it does not use the SOAFNDT dates. */ /* */ /* We need to change the behavior when the Use Finals Dates parameter */ /* is set to Y, then the process should ignore the code we put in 1-ERPAVT*/ /* (if possible), and still use the SOAFNDT dates. */ /* */ /* Modified selstartenddates() and selfinaldates() to add following */ /* condition */ /* AND ( */ /* s3.STVRSTS_INCL_SECT_ENRL = 'Y' */ /* OR */ /* 'Y' = :usefinaldateflag */ /* ) */ /* When usefinaldateflag will be Y and even STVRSTS_INCL_SECT_ENRL will */ /* be N then also the dates from SOAFNDT will be fetched. */ /* When usefinaldateflag will be N then based on STVRSTS_INCL_SECT_ENRL */ /* value Y or N, dates will fetched from SOAFNDT. */ /* */ /* 4. CR-000165415 AP 27-JUN-2019 */ /* Issue : SFRNSLC may give the following error when Parameter 6 (run mode) = 1 */ /* and Parameter 34 (Use curriculum start/end dates) = Y. This occurs */ /* when the student's First terms 'time status' does not have a NSC */ /* equivalent. The error displayed is: */ /* No NSC EQUIV for XX in STVTMST */ /* The issue is the students current time Status in the term is not the */ /* value being displayed. */ /* There is no error for the student if Parm 34 = N */ /* */ /* Resolution : */ /* Modified sel_full_half_status_for_term_code() method. */ /* This method was created to get the Time Status for previous Terms. */ /* There is a section inside this method which checks if Time Status is */ /* 00 or 99 then "err_nslc_fhl_code" flag is set to 1 */ /* This logic is not required for previous term so added a condition for */ /* if the Term for which SFRNSLC procs is being run is different then the*/ /* Term for which this method is called then No need to execute this */ /* this section. So added following condition: */ /* if( tmstrcmp(p_term_code,term_to_process) == 0 ) */ /* */ /* 5. CR-000167447 AP 08-JUL-2019 */ /* Issue : Issue with date comparison in SFRNSLC in Oracle 12.2 environment: */ /* The following line of code: */ /* and m.sfrthst_tmst_date <= TO_DATE(:use_date_time,'DD-MON-YYYYHH24:MI:SS')) ; */ /* Had to be changed to for some clients: */ /* and to_date(to_char(m.sfrthst_tmst_date,'DD-MON-YYYYHH24:MI:SS'),'DD-MON-YYYYHH24:MI:SS') <= */ /* to_date(:use_date_time,'DD-MON-YYYYHH24:MI:SS')); */ /* */ /* Resolution : */ /* Modified sel_full_half_status and sel_full_half_status_for_term_code()*/ /* methods. Code */ /* */ /* and m.sfrthst_tmst_date <= TO_DATE(:use_date_time,'DD-MON-YYYYHH24:MI:SS')) ; */ /* */ /* Changed to */ /* */ /* and to_date(to_char(m.sfrthst_tmst_date,'DD-MON-YYYYHH24:MI:SS'),'DD-MON-YYYYHH24:MI:SS') <= */ /* to_date(:use_date_time,'DD-MON-YYYYHH24:MI:SS')); */ /* */ /* 6. CR-000150148 AP 12-JUL-2019 */ /* Issue : The Program Enrollment Status Effective Date may be reported */ /* incorrectly when SFRNSLC Parameter 24 Report Start and End Dates = Y. */ /* */ /* Note: The following error may be sent by NSC when this data condition */ /* is reported to NSC: */ /* Error Resolution Instructions: Error Number 264 */ /* */ /* The Status Start Date, SSD provided is not with the dates of the term.*/ /* All data should be for the current term only. Please review and */ /* correct on this Error Resolution Report as well as in your Student */ /* Information System, SIS. */ /* */ /* Resolution : */ /* In this scenario, the PSED is earlier than the start date of the POT. */ /* This is incorrect for enrollment reporting, and will cause an error */ /* when the customer reports this data. The PSED cannot be earlier than */ /* start date of the students "term" (the dates reported in the DTP 382 */ /* line). */ /* */ /* Using Report Start and End Date = Y changes how the "term" dates are */ /* reported to the Clearinghouse (NSC) - rather than using the STVTERM */ /* dates for the "term", it uses the min start and max end for the */ /* student's registered CRNs. The PSED in this scenario should be */ /* reported as the min start date for the student's registered CRNs. */ /* */ /* The method selstartenddates() is responsible for fetching the Min/Max */ /* Dates for Part Of Terms (Period) for which the the Status is valid. */ /* This method was being called in much after the method sel_full_half_status() */ /* where the Time Status and PSED is being fetched hence made a new call */ /* to selstartenddates() before calling get_enr_data() method inside getdata() */ /* method so the partofterm_mindate and partofterm_maxdate can be determined */ /* */ /* Modified sel_full_half_status() and placed a logic to replace the PSED */ /* with partofterm_mindate if PSED is lesser then partofterm_mindate since*/ /* partofterm_mindate is being reported as Start date in DTP|382|... line */ /* This logic will only execute when "Report Start and End Date will be Y */ /* */ /* */ /* AUDIT TRAIL: 8.19 AP 05-DEC-2019 */ /* Defect: CR-000163457 */ /* Problem: Pro*C jobs SFRNSLC will generate runtime errors when using the */ /* Oracle 12.2.x pre-processor. */ /* Solution: Modified the full ProC file. Inside PLSql block while assigning the value */ /* in ProC Variables indicator variable must be used. */ /* */ /* Also modified following Ind_xx scenarios */ /* 1) No Indicator Variable available into "Select INTO" clause. */ /* 2) Space before variable and :Ind_xx in "Select Into" clause. */ /* 3) Space before variable and :Ind_xx in PL/SQL Block in Left hand side of */ /* Assignment Statement. */ /* 4) Changed update_status_date to use indiator for save_grad_status_date. */ /* */ /* AUDIT TRAIL: 8.19.1 AP 24-FEB-2020 */ /* Defect: CR-000169856 */ /* Problem: In the 8.18.1 version of SFRNSLC, the Program Enrollment Status Effective */ /* Date may not be accurate when the student has been at the same status for */ /* multiple terms. */ /* Solution: */ /* In this scenario, the PSED is shouldbe reported as it was reported */ /* in the previous terms since when the Time Status has not been changed. */ /* when the customer reports this data. The PSED cannot be earlier than */ /* start date of the students "term" (the dates reported in the DTP 382 */ /* line). */ /* */ /* Using Report Start and End Date = Y changes how the "term" dates are */ /* reported to the Clearinghouse (NSC) - rather than using the STVTERM */ /* dates for the "term", it uses the min start and max end for the */ /* student's registered CRNs. The PSED in this scenario should be */ /* reported as the min start date for the student's registered CRNs. */ /* */ /* The method selstartenddates() is responsible for fetching the Min/Max */ /* Dates for Part Of Terms (Period) for which the the Status is valid. */ /* This method was fetching data for "term_to_process" only. Modified this*/ /* method and parameterised it to fetch data for the Term being passed as */ /* parameter. This si so that we can reutilise this method to fetch the */ /* Min/max dates for previous Term for which the Time Status was fetched */ /* by sfkenrl.p_find_time_status_PSED() package. */ /* Modified sel_full_half_status() method to place a call ofselstartenddates() */ /* function when Parameter 24 is Y and "Term to Process" is different than */ /* the Term of Time Status fetched by sfkenrl.p_find_time_status_PSED() */ /* Added 2 new variables temp_partofterm_mindate, temp_partofterm_maxdate. */ /* AUDIT TRAIL: 8.22 PM 24-FEB-2020 */ /* Defect: CR-000166345 */ /* Problem: Truncation of Student First name for characters more than 35 and */ /* no truncation in the characters in case any space is there and length below 35 characters */ /* Solution: Increased the length of the first name to 36. */ /* */ /* ***************************************************************************************/ /* AUDIT TRAIL END */ /* ***************************************************************************************/ #include "guarpfe.h" EXEC SQL INCLUDE guaorac.c; #define RELEASE _TMC("8.22") #define SELSTMT1 _TMC("SELECT X.SFBETRM_PIDM,\ SPBPERS_SSN, SPBPERS_NAME_SUFFIX,\ SPBPERS_CONFID_IND, SPRIDEN_FIRST_NAME, SPRIDEN_LAST_NAME,\ SPRIDEN_MI, SPRIDEN_ID,\ TO_CHAR(SPBPERS_BIRTH_DATE,'YYYYMMDD'),\ DECODE(SPBPERS_SEX,'M','M','F','F','U')SPBPERS_SEX,SPBPERS_ETHN_CDE,\ SPBPERS_CITZ_CODE\ FROM SFBETRM X, SPBPERS, SPRIDEN\ WHERE NOT EXISTS (SELECT 'X'\ FROM SGRSATT\ WHERE SGRSATT_PIDM = X.SFBETRM_PIDM\ AND SGRSATT_TERM_CODE_EFF=\ (SELECT MAX(SGRSATT_TERM_CODE_EFF)\ FROM SGRSATT\ WHERE SGRSATT_TERM_CODE_EFF <= :term\ AND SGRSATT_PIDM = X.SFBETRM_PIDM)\ AND SGRSATT_ATTS_CODE IN\ (SELECT COALESCE(SUBSTR(SPRCOLR_VALUE_ATYP,1,4),'####')\ FROM SPRCOLR\ WHERE SPRCOLR_SESSIONID = :sessionid\ AND SPRCOLR_TYPE = 'S'))\ AND SPBPERS_PIDM(+) = SPRIDEN_PIDM\ AND SPRIDEN_PIDM = X.SFBETRM_PIDM\ AND SPRIDEN_ENTITY_IND = 'P'\ AND SPRIDEN_CHANGE_IND IS NULL\ AND ((:scps_code IS NOT NULL\ AND X.SFBETRM_TERM_CODE =(SELECT MAX(Y.SFBETRM_TERM_CODE) FROM SFBETRM Y\ WHERE Y.SFBETRM_TERM_CODE IN\ (SELECT SORSCPT_TERM_CODE FROM SORSCPT\ WHERE SORSCPT_SCPS_CODE=:scps_code)\ AND Y.SFBETRM_PIDM = X.SFBETRM_PIDM))\ OR (:scps_code IS NULL AND X.SFBETRM_TERM_CODE = :term))\ AND X.SFBETRM_PIDM >= 0\ ORDER BY SPRIDEN_ID") /* #define SELSTMT2 _TMC("SELECT SPBPERS_PIDM, \ */ #define SELSTMT2 _TMC("SELECT SPRIDEN_PIDM, \ SPBPERS_SSN,SPBPERS_NAME_SUFFIX, \ SPBPERS_CONFID_IND,SPRIDEN_FIRST_NAME, SPRIDEN_LAST_NAME,\ SPRIDEN_MI, SPRIDEN_ID,\ TO_CHAR(SPBPERS_BIRTH_DATE,'YYYYMMDD'),\ DECODE(SPBPERS_SEX,'M','M','F','F','U')SPBPERS_SEX,SPBPERS_ETHN_CDE,\ SPBPERS_CITZ_CODE\ FROM SPBPERS, SPRIDEN, GLBEXTR\ WHERE SPBPERS_PIDM(+) = SPRIDEN_PIDM\ AND NOT EXISTS (SELECT 'X'\ FROM SGRSATT\ WHERE SGRSATT_PIDM = SPRIDEN_PIDM\ AND SGRSATT_TERM_CODE_EFF=\ (SELECT MAX(SGRSATT_TERM_CODE_EFF)\ FROM SGRSATT\ WHERE SGRSATT_TERM_CODE_EFF <= :term\ AND SGRSATT_PIDM = SPRIDEN_PIDM)\ AND SGRSATT_ATTS_CODE IN\ (SELECT COALESCE(SUBSTR(SPRCOLR_VALUE_ATYP,1,4),'####')\ FROM SPRCOLR\ WHERE SPRCOLR_SESSIONID = :sessionid\ AND SPRCOLR_TYPE = 'S'))\ AND SPRIDEN_PIDM = GLBEXTR_KEY\ AND SPRIDEN_ENTITY_IND = 'P'\ AND SPRIDEN_CHANGE_IND IS NULL\ AND GLBEXTR_APPLICATION = :parm_popsel_appl\ AND GLBEXTR_SELECTION = :parm_popsel_sel\ AND GLBEXTR_CREATOR_ID = COALESCE(:parm_popsel_crID,GLBEXTR_CREATOR_ID)\ AND GLBEXTR_USER_ID = COALESCE(:parm_popsel_usID, GLBEXTR_USER_ID)\ ORDER BY SPRIDEN_ID") extern short sqltrace_flag; /* sql_trace option is on */ EXEC SQL BEGIN DECLARE SECTION; /* New for popsel */ typedef TMCHAR TMCHAR0[200][2000]; static TMCHAR select_statement[2000]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR parm_popsel_appl[31]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR parm_popsel_sel[31]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR parm_popsel_crID[31]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR parm_popsel_usID[31]={0}/*TMCI18N CHANGED FROM ""*/; /*TMCI18N CHANGED DECLARATION*/ /*static CHAR2 use_popsel=_TMC("N");*/ static CHAR2 TMCHARRYT_GLOB_DCL(use_popsel,2,_TMC("N")); /* End new for popsel */ /*TMCI18N CHANGED DECLARATION*/ /*static CHAR2 eff_wdrl_ind=_TMC("N");*/ static CHAR2 TMCHARRYT_GLOB_DCL(eff_wdrl_ind,2,_TMC("N")); static TMCHAR branch_code[3]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR fice_code_in[7]={0}; /*TMCI18N CHANGED DECLARATION*/ /*static CHAR2 create_rpt=_TMC("N");*/ static CHAR2 TMCHARRYT_GLOB_DCL(create_rpt,2,_TMC("N")); static TMCHAR rptname[8]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR term[7]={0}/*TMCI18N CHANGED FROM ""*/; /*enrollment term */ static TMCHAR studex[5]={0}/*TMCI18N CHANGED FROM ""*/; /* exclude student criteria */ static TMCHAR report_flag[2]={0}/*TMCI18N CHANGED FROM ""*/; /* report flag*/ static TMCHAR atyp_code[4]={0}/*TMCI18N CHANGED FROM ""*/; /* address type code */ static TMCHAR glvl_code[3]={0}/*TMCI18N CHANGED FROM ""*/; /* grad level code */ static TMCHAR sel_date[12]={0}/*TMCI18N CHANGED FROM ""*/; /* report date */ static TMCHAR sel_time[9]={0}/*TMCI18N CHANGED FROM ""*/; /* report time */ static TMCHAR run_mode[2]={0}/*TMCI18N CHANGED FROM ""*/; /* run mode */ static TMCHAR fice[9]={0}/*TMCI18N CHANGED FROM ""*/; /* fice */ static TMCHAR resid_date[12]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR detl_code[5]={0}; static TMCHAR attr_code[5]={0}; static TMCHAR clvl_code[3]={0}; static TMCHAR missing_cipc_sw[2]={0}; static TMCHAR write_duplicate_sw[2]={0}; static TMCHAR majr_code[5]={0}; static TMCHAR row_num[5]={0}; static TMCHAR majr_code_1[5]={0}; static TMCHAR majr_code_2[5]={0}; static TMCHAR majr_lcur_seqno[5]={0}; static TMCHAR majr_lfos_seqno[5]={0}; static TMCHAR emailind[2]={0}/*TMCI18N CHANGED FROM ""*/; /* Email optional ind flag */ static TMCHAR genderind[2]={0}/*TMCI18N CHANGED FROM ""*/; /* Gender optional ind flag */ static TMCHAR raceind[2]={0}/*TMCI18N CHANGED FROM ""*/; /* Race optional ind flag */ static TMCHAR classlvlind[2]={0}/*TMCI18N CHANGED FROM ""*/; /* Class Level optional ind flag */ static TMCHAR banneridind[2]={0}/*TMCI18N CHANGED FROM ""*/; /* banner Id optional ind flag */ static TMCHAR ssnind[2]={0}/*TMCI18N CHANGED FROM ""*/; /* SSN optional ind flag */ static TMCHAR partoftermdateind[2]={0}/*TMCI18N CHANGED FROM ""*/; /* Part of term date optional ind flag*/ static TMCHAR usefinaldateflag[2]={0}/*TMCI18N CHANGED FROM ""*/; /* Use Final Date flag.*/ static TMCHAR usecurrstartenddatesflag[2]={0}/*TMCI18N CHANGED FROM ""*/; /* Use curriculum Start/End Dates flag.*/ static TMCHAR ask_term[7]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR ask_atyp_code[4]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR ask_glvl_code[3]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR ask_report_flag[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR ask_studex[5]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR ask_sel_date[12]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR ask_run_mode[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR ask_clvl_code[3]={0}; static TMCHAR ask_attr_code[5]={0}; static TMCHAR ask_detl_code[5]={0}; /* *** Job submission alteration */ static BANNUMSTR(ask_one_up_no)={0}/*TMCI18N CHANGED FROM ""*/; static BANNUMSTR(rpt_one_up_no)={0}/*TMCI18N CHANGED FROM ""*/; static BANNUMSTR(parm_no)={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR valid_ind[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR rpt_optional_ind[2]={0}/*TMCI18N CHANGED FROM ""*/; /* *** Gdatevalid variables */ static TMCHAR errflag[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR errmsg[61]={0}/*TMCI18N CHANGED FROM ""*/; /* *** */ /* Standard variables */ int count; static TMCHAR date[12]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR institution[31]={0}/*TMCI18N CHANGED FROM ""*/; static BANNUMSTR(linelimit)={0}/*TMCI18N CHANGED FROM ""*/; short int lineno; short int pageno; static TMCHAR time_var[12]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR title_var[31]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR sessionid[31]={0}/*TMCI18N CHANGED FROM ""*/; /* *** */ /* Application variables */ static TMCHAR withdraw_ind[2]={0}; static TMCHAR leave_ind[2]={0}; static TMCHAR atyp_ind[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR glvl_ind[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR clvl_ind[2]={0}; static TMCHAR attr_ind[2]={0}; static TMCHAR detl_ind[2]={0}; static TMCHAR reg_levl[3]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR found_ind[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR ceu_found_ind[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR attr_found_ind[2]={0}; static TMCHAR detl_found_ind[2]={0}; static TMCHAR city_var[22]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR colr_value[30]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR colr_type[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR control_rpt_date[12]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR control_rpt_time[9]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR enroll_start_date[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR enroll_end_date[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR enroll_end_date_orig[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR use_date[12]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR use_time[9]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR date_type[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR grad_date_dgmr[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR grad_date_fha[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR grad_date_g[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR grad_term[7]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR leave_date[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR withdraw_date[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR eff_wdrl_date[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR dead_date[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR eb_status_date[10]={0}/*TMCI18N CHANGED FROM ""*/; short int pagenumlen=4; short int page_pos; short int datetimelen=20; static TMCHAR date_tmp[10]={0}/*TMCI18N CHANGED FROM ""*/; short int inst_len; short int inst_pos; short int numlines; short int rptlen=8; short int rptwid=132; short int rpt_pos; short int termlen=6; short int title_len; short int title_pos; static TMCHAR tmst_code[3]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR pers_atyp_code[3]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR pers_levl_code[3]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR pers_natn[6]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR print_sel_date[9]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR print_sel_date2[9]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR print_sel_date3[5]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR print_sel_date4[12]={0}/*TMCI18N CHANGED FROM ""*/; static BANNUMSTR(pers_type_index)={0}/*TMCI18N CHANGED FROM ""*/; static BANNUMSTR(pers_type_index2)={0}/*TMCI18N CHANGED FROM ""*/; static BANNUMSTR(pers_type_index3)={0}/*TMCI18N CHANGED FROM ""*/; static BANNUMSTR(pers_err_cntr)={0}/*TMCI18N CHANGED FROM ""*/; static BANNUMSTR(pers_reported_cntr)={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR state[4]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR natn_edi_equiv[3]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR street_line1[31]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR temp_street_line1[31]={0}; static TMCHAR street_line2[31]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR street_line3[31]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR zip[11]={0}/*TMCI18N CHANGED FROM ""*/; static BANNUMSTR(seqno)={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR pidm[9]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR studex_ind[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR term_ind[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR stud_status[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR student_ssn[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR student_name_suffix[21]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR student_confid_ind[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR student_fname[36]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR student_lname[61]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR student_mi[16]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR student_fullname[100]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR student_id[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR student_birth_date[12]={0}/*TMCI18N CHANGED FROM ""*/; /* New output fields for NSC*/ static TMCHAR stud_majr1[32]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR stud_majr1_cipc[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR stud_majr2[32]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR stud_majr2_cipc[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR stud_prefemail[82]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR stud_gender[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR stud_ethn_cde[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR stud_race[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR alien[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR stud_classlevel[4]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR stud_classlevel_code[4]={0}/*TMCI18N CHANGED FROM ""*/; static BANNUMSTR(lcur_seqno)={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR lcur_term[8]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR term_yearmm[7]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR partofterm_mindate[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR partofterm_maxdate[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR final_end_dates[10]={0}/*TMCI18N CHANGED FROM ""*/; static BANNUMSTR(emailcount)={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR degc_nsc_cred[2]={0}; static TMCHAR degc_acat_code[3]={0}; static TMCHAR lcur_degc_code[7]={0}; static TMCHAR gap_exists[2]={0}; static TMCHAR prev_enroll_term[7]={0}; static TMCHAR last_gap_term[7]={0}; static TMCHAR enroll_term_for_gap[7]={0}; static TMCHAR remedial_attr_flag[2]={0}; static TMCHAR detl_flag[2]={0}; static TMCHAR scp_process[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR print_process_scp[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR term_to_process[7]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR scps_code[7]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR cycle_code[7]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR scps_reg_all_terms[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR count_scp_terms[6]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR count_reg_terms[6]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR enrl_cycle_code[7]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR check_scpreg_flag[2]={0}/*TMCI18N CHANGED FROM ""*/; /* Control Report Variables */ static TMCHAR report_id[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR report_ssn[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR report_fullname[100]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR report_birth_date[12]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR report_edi_translate[4]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR report_stud_status[3]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR report_eb_status_date[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR report_enroll_start_date[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR report_enroll_end_date[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR report_grad_date[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR scp_term_start[10]={0}; static TMCHAR scp_term_end[10]={0}; static TMCHAR scp_term_end_orig[10]={0}; static TMCHAR term_desc[30]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR nslc_fhl_code[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR old_nslc_fhl_code[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR fhl_code[3]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR fhl_date[10]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR confid_ind[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR fhl_tmst_term[7]={0}; static TMCHAR prev_tmst_code[3]={0}; /* previous tmst code */ static TMCHAR prev_fhl_date[10]={0}; static TMCHAR prev_tmst_term[7]={0}; static TMCHAR prev_fhl_term_date[10]={0}; static TMCHAR lcur_prog_start_date[10]={0}; static TMCHAR lcur_prog_end_date[10]={0}; static TMCHAR orig_prog_enr_stat_eff_date_for_dup[10] ={0}; /* to hold the Original Prog Status effective Date in case of Duplicate CIPC code Withdrawn Major */ /* Shared indicator variables for SELECTs */ short Ind_01; short Ind_02; short Ind_03; short Ind_04; short Ind_05; short Ind_06; short Ind_07; short Ind_08; short Ind_09; short Ind_10; short Ind_11; short Ind_12; short Ind_13; short Ind_14; short Ind_15; short Ind_16; short Ind_17; short Ind_18; short Ind_19; short Ind_20; EXEC SQL END DECLARE SECTION; /* Local prototypes */ static void chk_for_heading(UFILE *ofile_in); static void _rptopen1(TMCHAR *user_pass,int argc,TMCHAR *argv[]); static void del_parms(void); static int enrollment_period(int mode); static int select_scpterm_dates(int mode); static int validate_one_up_no(int mode); static int seladdr(int mode); static int control_table(int mode); static int sel_full_half_status(void); static int sel_last_full_half_status(int mode); static void sel_grad_date_fha(void); static void sel_grad_date_g(void); static int sel_fice(int mode); static void print_heading(UFILE *file_in); static void print_footer(UFILE *file_in); static int read_line_count(void); static int readterm(int mode); static int readstudex(int mode); static int readreport_flag(int mode); static int readatyp(int mode); static int readglvl(int mode); static int readdate(int mode); static int readrun_mode(int mode); static void readcolr (UFILE *file_in); static int readclvl(int mode); static int readattr(int mode); static int readdetl(int mode); static int readusefinaldate(int mode); static int readusecurrstartenddates(int mode); /* new for popsel */ static int readpopselappl(int mode); static int readpopselsel(int mode); static int readpopselcrID(int mode); static int readpopselusID(int mode); static int found_no_etrm(TMCHAR pidm_in[10]); static int validate_popsel(void); static int verify_population(void); /* end new for popsel */ static int validate_ssn(TMCHAR ssn_in[15]); static int validate_branch(TMCHAR branch_in[5]); static void find_name_for(TMCHAR *fullname); static void initialize_report_variables(void); static void copy_report_variables(void); static int readeffwdrldate(int mode); static int readbranchcode(int mode); static int readficecodein(int mode); static int readcreatereport(int mode); static int sel_optional_ind (int mode); static int check_reg (int mode); static int check_grad_levl (int mode); static int check_ceu_levl (int mode); static int check_attr_code (int mode); static int check_detail (int mode); static void check_reg_levl (void); static void inscolrglvl (void); static void inscolratyp (void); static void inscolrstudex (void); static void inscolrclvl (void); static void inscolrattr (void); static void inscolrdetl (void); static void lockcolr(void); static void delcolr(void); static void locktctl(void); static int seldate(int mode); static int selinst(int mode); static void seltime(void); static void seltitle(void); static void retrieve_parms(void); static void getsession(void); static void getdata (void); static void check_cipc_code (void); /*Read optional indicator flags for new output fields*/ static int readprefemail_flag(int mode); static int readgender_flag(int mode); static int readrace_flag(int mode); static int readclasslevel_flag(int mode); static int readbannerid_flag(int mode); static int readssn_flag(int mode); static int readactenroldates_flag(int mode); /*Read optional indicator values for new output fields*/ static void selprefemail(void); static void selrace(void); static void selclasslevel(void); /*static void selstartenddates(void); */ static void selstartenddates(TMCHAR p_term_code[7]); static void checkemailcount(void); static void get_alien(void); static void selfinaldates(void); static int readscpprocess(int mode); static int fetchscp(int mode); static int countscpterms(int mode); static int countregterms(int mode); static int fetch_enrl_cycle(int mode); static int fetch_first_reg_scp(int mode); static void student_centric_period(void); static void process_scp_settings(void); typedef struct enrollment_data { TMCHAR prog_status[2]; TMCHAR prog_begin_date[10]; TMCHAR prog_enr_stat_eff_date[10]; TMCHAR stud_majr1_cipc[10]; TMCHAR prog_length[7]; TMCHAR prog_length_type[2]; TMCHAR prog_weeks_yr[7]; TMCHAR special_prog_ind[2]; TMCHAR prog_credential_level[3]; TMCHAR prog_grad_term[7]; TMCHAR prog_cipc_pub_year[5]; TMCHAR prog_levl_code[3]; TMCHAR prog_term_code[7]; TMCHAR end_start_date[10]; TMCHAR prog_current_ind[2]; TMCHAR prog_ceu_ind[2]; TMCHAR prog_nondgr_ind[2]; TMCHAR prog_majr_code[5]; TMCHAR save_lcur_seqno[5]; TMCHAR save_priority_no[5]; TMCHAR save_dept_code[5]; TMCHAR save_term_code_ctlg[7]; TMCHAR save_term_code[7]; TMCHAR save_cact_code[16]; TMCHAR save_lfos_rule[9]; TMCHAR save_conc_attach_rule[9]; TMCHAR save_start_date[10]; TMCHAR save_end_date[10]; TMCHAR save_term_code_end[7]; TMCHAR save_tmst_code[3]; TMCHAR save_majr_code_attach[5]; TMCHAR save_csts_code[16]; TMCHAR save_activity_date[10]; TMCHAR curr_prog_start_date[10]; TMCHAR curr_prog_end_date [10]; TMCHAR curr_fos_start_date[10]; TMCHAR curr_fos_end_date [10]; } ENRDATA; typedef struct status_order { TMCHAR status[2]; } STATORD; typedef struct nondgr_major_data { TMCHAR nondgr_lcur_seqno[5]; TMCHAR nondgr_lfos_seqno[5]; TMCHAR nondgr_majr_code[5]; } NONDEGREE; NONDEGREE arr_nondgrdata[10]; typedef struct missing_cipc_codes { TMCHAR missingcipc_majr_code[5]; } MISSINGCIPC; MISSINGCIPC arr_missingcipc[6]; ENRDATA arr_enrdata[10]; STATORD arr_statord[10]; /* new array to save duplicate keys for checking graduation status vs fulltime status */ typedef struct dupl_majors { TMCHAR prog_enr_stat_eff_date[10]; TMCHAR prog_status[2]; TMCHAR prog_term_code[7]; TMCHAR prog_current_ind[2]; TMCHAR stud_majr1_cipc[10]; TMCHAR prog_length[7]; TMCHAR prog_begin_date[10]; TMCHAR prog_length_type[2]; TMCHAR prog_weeks_yr[7]; TMCHAR special_prog_ind[2]; TMCHAR prog_credential_level[3]; TMCHAR prog_grad_term[7]; TMCHAR prog_cipc_pub_year[5]; TMCHAR prog_levl_code[3]; TMCHAR prog_ceu_ind[2]; TMCHAR prog_nondgr_ind[2]; TMCHAR prog_majr_code[5]; TMCHAR end_start_date[10]; TMCHAR save_lcur_seqno[5]; TMCHAR save_priority_no[5]; TMCHAR save_dept_code[5]; TMCHAR save_term_code_ctlg[7]; TMCHAR save_term_code[7]; TMCHAR save_lfos_rule[9]; TMCHAR save_conc_attach_rule[9]; TMCHAR save_start_date[10]; TMCHAR save_end_date[10]; TMCHAR save_term_code_end[7]; TMCHAR save_tmst_code[5]; TMCHAR save_majr_code_attach[5]; TMCHAR save_cact_code[16]; TMCHAR save_csts_code[16]; TMCHAR save_activity_date[10]; TMCHAR curr_prog_start_date[10]; TMCHAR curr_prog_end_date [10]; TMCHAR curr_fos_start_date[10]; TMCHAR curr_fos_end_date [10]; } DUPLICATE_MAJORS; DUPLICATE_MAJORS arr_dupmajr[10]; /* new array to save non current and active majors in a graduated status */ typedef struct grad_majors { TMCHAR prog_majr_code[5]; TMCHAR prog_status[2]; TMCHAR prog_cipc_code[7]; TMCHAR prog_enr_stat_eff_date[10]; TMCHAR prog_term_code[7]; TMCHAR prog_length[7]; TMCHAR prog_begin_date[10]; TMCHAR prog_credential_level[3]; TMCHAR curr_prog_start_date[10]; TMCHAR curr_prog_end_date [10]; TMCHAR curr_fos_start_date[10]; TMCHAR curr_fos_end_date [10]; } GRADUATED_MAJORS; GRADUATED_MAJORS arr_gradmajr[10]; static TMCHAR ask_opeid[9]={0}; static TMCHAR opeid[9]={0}; static TMCHAR prog_active_exist[2]={0}; static TMCHAR prog_grad_date[10]={0}; static TMCHAR lcur_activity_date[10]={0}; static TMCHAR lcur_activity_date_update[10]={0}; static TMCHAR end_start_date[10]={0}; static TMCHAR lcur_term_code_end[7]={0}; static TMCHAR term_start_date[10]={0}; static TMCHAR withdraw_start_date[10]={0}; static TMCHAR withdraw_end_date[10]={0}; static TMCHAR temp_withdraw_start_date[10]={0}; static TMCHAR term_end_date[10]={0}; static TMCHAR lcur_term_code[7]={0}; static TMCHAR prog_grad_ind[2]={0}; static BANNUMSTR(prog_lcur_seqno)={0}; static TMCHAR lcur_current_ind[2]={0}; static TMCHAR lcur_active_ind[2]={0}; static TMCHAR save_grad_status_date[10]={0}; static TMCHAR lcur_levl_code[3]={0}; static TMCHAR lcur_coll_code[3]={0}; static TMCHAR lcur_program[13]={0}; static TMCHAR lcur_camp_code[4]={0}; static TMCHAR lcur_rolled_seqno[5]={0}; static TMCHAR stud_cipc_code[10]={0}; static TMCHAR stud_status_date[10]={0}; static TMCHAR stud_grad_term[7]={0}; static TMCHAR nslc_nomatch_tmst[3] ={0}; static TMCHAR prog_status[2]={0}; static TMCHAR print_sel_date5[7]={0}; static BANNUMSTR(fos_seqno)={0}; static TMCHAR fos_prog_status[2]; static TMCHAR fos_fst_code[16]={0}; static TMCHAR fos_majr_code[5]={0}; static TMCHAR fos_term_code[7]={0}; static TMCHAR fos_csts[31]={0}; static TMCHAR fos_activity_date[10]={0}; static TMCHAR fos_lcur_seqno[5]={0}; static TMCHAR fos_priority_no[5]={0}; static TMCHAR fos_dept_code[5]={0}; static TMCHAR fos_term_code_ctlg[7]={0}; static TMCHAR fos_lfos_rule[9]={0}; static TMCHAR fos_conc_attach_rule[9]={0}; static TMCHAR fos_start_date[10]={0}; static TMCHAR fos_end_date[10]={0}; static TMCHAR fos_term_code_end[7]={0}; static TMCHAR fos_tmst_code[3]={0}; static TMCHAR fos_majr_code_attach[5]={0}; static TMCHAR fos_cact_code[16]={0}; static TMCHAR fos_csts_code[16]={0}; static TMCHAR fos_first_term[7]={0}; static TMCHAR fos_last_active_term[7]={0}; static TMCHAR hold_prog_status[2]={0}; static TMCHAR fos_active_ind[2]={0}; static TMCHAR fos_current_ind[2]={0}; static TMCHAR prog_cipc_code[7]={0}; static TMCHAR prog_cred_level[3]={0}; static TMCHAR prog_length[7]={0}; static TMCHAR prog_length_type[2]={0}; static TMCHAR prog_weeks_yr[7]={0}; static TMCHAR prog_begin_date[10]={0}; static TMCHAR special_prog_ind[2]={0}; static TMCHAR prog_enrl_stat[2]={0}; static TMCHAR prog_enrl_effdate[9]={0}; static TMCHAR prog_nondgr_ind[2]={0}; static TMCHAR cplt_seqno[7]={0}; short int lfos_to_lcur_cnt; short int lfos_nondgr_cnt; short int lfos_cnt; short int lfos_dupcntcheck_cnt; short int lfos_write; short int duparray_cnt; short int grad_cnt; short int newcnt; short int lcur_cnt; short int m; short int p; short int c; short int nondgr_cnt; static TMCHAR err_majr1[5]={0}; static TMCHAR err_majr2[5]={0}; static TMCHAR hold_majr[5]={0}; static TMCHAR prog_majr_code[5]={0}; static TMCHAR skip_write[2]={0}; short int fos_skip_cnt; short int savei; short int l_cnt; short int err_scp_tmst_code; short int err_tmst_code; short int err_nslc_fhl_code; short int err_scp_tmst_99; short int err_tmst_99; short int err_no_match; short int t; short int dupcnt; short int x1; short int q; short int r; short int lfosdup_cnt; static TMCHAR lfosdup[2]={0}; static TMCHAR lfosnew[2]={0}; static TMCHAR lfosreported[2]={0}; static TMCHAR lfos_previous_reported[2]={0}; static TMCHAR save_lcur_seqno[5]={0}; static TMCHAR save_priority_no[5]={0}; static TMCHAR save_dept_code[5]={0}; static TMCHAR save_cact_code[16]={0}; static TMCHAR save_csts_code[16]={0}; static TMCHAR save_activity_date[10]={0}; static TMCHAR save_term_code_ctlg[7]={0}; static TMCHAR save_term_code[7]={0}; static TMCHAR save_lfos_rule[9]={0}; static TMCHAR save_conc_attach_rule[9]={0}; static TMCHAR save_start_date[10]={0}; static TMCHAR save_end_date[10]={0}; static TMCHAR save_term_code_end[7]={0}; static TMCHAR save_tmst_code[3]={0}; static TMCHAR save_majr_code_attach[5]={0}; static TMCHAR reported_csts_code[16]={0}; static TMCHAR reported_cact_code[16]={0}; static TMCHAR save_prog_status[2]={0}; static TMCHAR save_cipc_code[7]={0}; static TMCHAR save_majr_code[7]={0}; static TMCHAR save_prog_begin_date[10]={0}; static TMCHAR save_prog_enr_stat_eff_date[10]={0}; static TMCHAR lcur_levl_ceu_ind[2]={0}; static TMCHAR lfos_nondgr_ind[2]={0}; short int prog_nondgr_cnt; short int ceu_cnt; static TMCHAR grad_term_end_date[10]={0}; static TMCHAR last_enrollment_term[7]={0}; static TMCHAR lcur_acat_code[3]={0}; static TMCHAR hold_scp_tmst_date[10]={0}; static TMCHAR degree_seek_withdr_exist[2]={0}; static int readopeid(int mode); static void get_status(void); static void find_gap(void); static void find_terms(void); static void findcpltseqno(void); static void get_enr_data(void); static void calc_overall_status(void); static void get_fos_data(void); static int get_program_status(void); static void check_student_withdrawn(void); static void check_student_deceased(void); static void check_stud_apprv_leave(void); static void check_student_graduated(void); static void fill_status_order(void); static void selNscStvCsts(void); static void get_last_enrollment(void); static void check_for_duplicate_graduated_status(void); static void list_out_array(void); static void load_duplicate_array(void); static void write_to_save_graduated_majors(void); static void review_majors(void); static void add_to_arr_enrdata(void); static void update_status_date(void); static TMCHAR api_error_ind[2]={0}; static TMCHAR error_message1[101]={0}; static TMCHAR error_message2[101]={0}; static TMCHAR error_message3[101]={0}; static TMCHAR error_message4[101]={0}; static TMCHAR ask_nation_code[6]={0}; static TMCHAR nation_code[6]={0}; static TMCHAR ask_citizenship_ind[2]={0}; static TMCHAR citizenship_ind[2]={0}; static TMCHAR prog_cipc_pub_year[5]={0}; static TMCHAR stud_citz_cde[3]={0}; static TMCHAR edi_equiv_nation[3]={0}; static TMCHAR edi_equiv_citz[3]={0}; static TMCHAR include_flag[2]={0}; static TMCHAR secondlast_run_date[9]={0}; static TMCHAR prog_enr_stat_eff_date[10] ={0}; static TMCHAR temp_str[1000]={0}; static TMCHAR prog_withdraw_date[10] ={0}; static TMCHAR date_cmp[9]={0}; static BANNUMSTR(curriculam_seqno)={0}; static int validate_nation(TMCHAR nation_code[6]); static int get_secondlast_run_date(void); static int selmajr_1_2_cipccode(int mode); static void fetch_major_data(void); static void sel_majrcipc_desc(void); static int incl_withdraw_records(void); static void check_start_date(void); static void create_reported_majors(void); static void chk_withdrawl_degree_seek_exists(void); static TMCHAR stud_credential_level[3]={0}; static TMCHAR stud_levl_code[3]={0}; static TMCHAR prog_levl_code[3]={0}; /* Output file. */ int cnt,i,next_arg; static UFILE *ofile = (UFILE *) NULL; static UFILE *ofile2 = (UFILE *) NULL; /*TMCI18N CHANGED DECLARATION*/ /*TMCHAR *default_ext=_TMC("lis");*/ TMCHAR *TMCHARPTR_GLOB_DCL(default_ext,_TMC("lis")); /* default extension for output file */ TMCHAR ofile_name[81] = {0}/*TMCI18N CHANGED FROM ""*/; /* name of the sfrnslc_####.lis */ TMCHAR ofile_name2[81] = {0}/*TMCI18N CHANGED FROM ""*/; /* name of the sfrnslc_output_####.lis */ static TMCHAR fhl_date_for_term_code[10]={0}; static TMCHAR nslc_fhl_code_for_term_code[2]={0}; static TMCHAR fhl_code_for_term_code[3]={0}; static int sel_full_half_status_for_term_code(TMCHAR p_term_code[7]); static TMCHAR chk_major_changed_start_date[10] ={0}; static TMCHAR chk_major_changed_end_date[10] ={0}; static int check_major_changed(TMCHAR p_majr_code[5]); static int check_program_changed(); static int check_curriculum_changed(TMCHAR p_majr_code[5]); static TMCHAR temp_partofterm_mindate[10]={0}; static TMCHAR temp_partofterm_maxdate[10]={0}; /* **************************************************************** */ int main(int argc, TMCHAR *argv[]) { _rptopen1(user_pass,argc,argv); getxnam(*argv); login(); /* allow user to log into the database */ if (sqltrace_flag) EXEC SQL ALTER SESSION SET SQL_TRACE TRUE; tmstrcpy(rptname, _TMC("SFRNSLC")); sysdate(time_var,_TMC("HH24:MI:SS")); /* sysdate(time_var,ORA_NLS_TIME_FORMAT); */ getsession(); /* obtain the current session */ lockcolr(); delcolr(); EXEC SQL COMMIT; POSTORA; seldate(FIRST_ROW); /* Obtain system date */ seldate(CLOSE_CURSOR); /* Standard Ask */ input (ask_one_up_no, TM_NLS_Get("0000","RUN SEQUENCE NUMBER: "), 26, NUM); if ( *ask_one_up_no ) { tmstrcpy(rpt_one_up_no, ask_one_up_no); tmstrcpy(valid_ind, _TMC("N")); validate_one_up_no(FIRST_ROW); validate_one_up_no(CLOSE_CURSOR); if (!tmstrcmp(valid_ind, _TMC("Y")) ) { retrieve_parms(); EXEC SQL COMMIT; POSTORA; } tmprintf(&tmBundle, TM_NLS_Get("0001","Parameter sequence number is invalid, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } /* Prompt for term */ input (ask_term, TM_NLS_Get("0002","TERM: "),6, ALPHA); if (*ask_term ) { tmstrcpy(term, str2uc(ask_term)); } else { tmstrcpy(parm_no, _TMC("01")); sel_optional_ind(FIRST_ROW); if ( !compare(rpt_optional_ind, _TMC("O"), EQS) ) { tmprintf (&tmBundle, TM_NLS_Get("0003","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } enrollment_period(FIRST_ROW); /* Obtain term start and end date */ input (parm_popsel_appl, TM_NLS_Get("0004","APPLICATION: "),30, ALPHA); if (*parm_popsel_appl) { tmstrcpy(parm_popsel_appl, str2uc(parm_popsel_appl)); } else { tmstrcpy(parm_no, _TMC("08")); sel_optional_ind(FIRST_ROW); if ( !compare(rpt_optional_ind, _TMC("O"), EQS) ) { tmprintf (&tmBundle, TM_NLS_Get("0005","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } input (parm_popsel_sel, TM_NLS_Get("0006","SELECTION: "),30, ALPHA); if (*parm_popsel_sel) { tmstrcpy(parm_popsel_sel, str2uc(parm_popsel_sel)); } else { tmstrcpy(parm_no, _TMC("09")); sel_optional_ind(FIRST_ROW); if ( !compare(rpt_optional_ind, _TMC("O"), EQS) ) { tmprintf (&tmBundle, TM_NLS_Get("0007","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } if ((*parm_popsel_appl && !*parm_popsel_sel) || (!*parm_popsel_appl && *parm_popsel_sel)) { tmprintf (&tmBundle, TM_NLS_Get("0008","Popsel Application AND Selection required to use Popsel, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } if ((*parm_popsel_appl && *parm_popsel_sel) && (verify_population())) { tmprintf (&tmBundle, TM_NLS_Get("0009","Popsel must exist in GLBEXTR to use Popsel, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } if ((*parm_popsel_appl && *parm_popsel_sel) && (validate_popsel())) { tmprintf (&tmBundle, TM_NLS_Get("0010","Popsel must exist in GLBSLCT to use Popsel, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } input (parm_popsel_crID, TM_NLS_Get("0011","CREATOR ID: "),30, ALPHA); if (*parm_popsel_crID) { tmstrcpy(parm_popsel_crID, str2uc(parm_popsel_crID)); } else { tmstrcpy(parm_no, _TMC("10")); sel_optional_ind(FIRST_ROW); if ( !compare(rpt_optional_ind, _TMC("O"), EQS) ) { tmprintf (&tmBundle, TM_NLS_Get("0012","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } input (parm_popsel_usID, TM_NLS_Get("0013","USER ID: "),30, ALPHA); if (*parm_popsel_usID) { tmstrcpy(parm_popsel_usID, str2uc(parm_popsel_usID)); } else { tmstrcpy(parm_no, _TMC("11")); sel_optional_ind(FIRST_ROW); if ( !compare(rpt_optional_ind, _TMC("O"), EQS) ) { tmprintf (&tmBundle, TM_NLS_Get("0014","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } input (eff_wdrl_ind, TM_NLS_Get("0015","EFFECTIVE WITHDRAWAL DATE [Y]: "),1, ALPHA); if (*eff_wdrl_ind) { tmstrcpy(eff_wdrl_ind, str2uc(eff_wdrl_ind)); if (!inlist(eff_wdrl_ind,ALPHA,_TMC("Y"),_TMC("N"),_TMC("y"),_TMC("n")) ) { tmprintf (&tmBundle, TM_NLS_Get("0016","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } else { tmstrcpy(eff_wdrl_ind, _TMC("Y")); } input (branch_code, TM_NLS_Get("0017","BRANCH CODE [00]: "),2, ALPHA); if (*branch_code) { if (!validate_branch(branch_code)) ; /* '00' will be defaulted if invalid code */ } else { tmstrcpy(branch_code, _TMC("00")); } /* Prompt for fice code */ input (fice_code_in, TM_NLS_Get("0018","INSTITUTIONAL FICE CODE [000000]: "),6, ALPHA); if ( !*fice_code_in ) { sel_fice(FIRST_ROW); /* Check for institution FICE code */ sel_fice(CLOSE_CURSOR); } else { tmstrcpy(fice,fice_code_in); } /* Prompt for run mode */ input (ask_run_mode, TM_NLS_Get("0019","RUN MODE [1:Missing/Invalid Data, 2:EDI, 3:EDI.Smart]: "),1,ALPHA); if ( !inlist(ask_run_mode,ALPHA,_TMC("1"),_TMC("2"),_TMC("3")) ) { tmprintf (&tmBundle, TM_NLS_Get("0020","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } if (*ask_run_mode ) { tmstrcpy(run_mode,ask_run_mode); } else { tmstrcpy(parm_no,_TMC("06")); sel_optional_ind(FIRST_ROW); if ( !compare(rpt_optional_ind,_TMC("O"),EQS) ) { tmprintf (&tmBundle, TM_NLS_Get("0021","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } if (!tmstrcmp(run_mode,_TMC("2"))||!tmstrcmp(run_mode,_TMC("3"))) { input (create_rpt, TM_NLS_Get("0022","CREATE ENHANCED REPORT [Y]: "),1, ALPHA); if (*create_rpt) { tmstrcpy(create_rpt, str2uc(create_rpt)); if (!inlist(create_rpt,ALPHA,_TMC("Y"),_TMC("N")) ) { tmprintf (&tmBundle, TM_NLS_Get("0023","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } else tmstrcpy(create_rpt, _TMC("Y")); } else tmstrcpy(create_rpt, _TMC("Y")); if (*ofile_name2 ) /* .txt file */ { ofile2=tmfopen(&tmBundle, ofile_name2, _TMC("w")); } else { tmstrcpy(ofile_name2,_TMC("sfrnslc.txt")); ofile2=tmfopen(&tmBundle, ofile_name2, _TMC("w")); } } else tmstrcpy(create_rpt, _TMC("N")); /* Prompt for student exclude attributes */ tmstrcpy(studex_ind,_TMC("N")); while (1) { input (ask_studex, TM_NLS_Get("0024","STUDENT EXCLUDE ATTRIBUTES: "),4,ALPHA); if ( *ask_studex ) { tmstrcpy(studex,ask_studex); inscolrstudex(); } else { break; } } EXEC SQL COMMIT; POSTORA; /* Prompt for report flag */ input (ask_report_flag, TM_NLS_Get("0025","REPORT FLAG [Y/N]: "),1,ALPHA); if (!inlist(ask_report_flag,ALPHA,_TMC("Y"),_TMC("N"),_TMC("y"),_TMC("n")) ) { tmprintf (&tmBundle, TM_NLS_Get("0026","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } if (*ask_report_flag ) { tmstrcpy(report_flag,str2uc(ask_report_flag)); } else { tmstrcpy(parm_no,_TMC("03")); sel_optional_ind(FIRST_ROW); if ( !compare(rpt_optional_ind,_TMC("O"),EQS) ) { tmprintf (&tmBundle, TM_NLS_Get("0027","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } askdate: ; /* Prompt for report date */ input(ask_sel_date,TM_NLS_Get("0028","REPORT DATE [DD-MON-YYYY]: "),11,ALPHA); if ( *ask_sel_date ) { tmstrcpy(sel_date,str2uc(ask_sel_date)); EXEC SQL EXECUTE BEGIN gdatevalid(:sel_date,:cenpivot,:errflag,:errmsg,''); END; END-EXEC; if (tmstrcmp(errflag,_TMC("")) != 0) { tmprintf(&tmBundle, _TMC("{0}\n"),errmsg); goto askdate; } } else { tmstrcpy(parm_no,_TMC("05")); sel_optional_ind(FIRST_ROW); if ( compare(rpt_optional_ind,_TMC("O"),EQS) ) { tmstrcpy(sel_date,date); } else { tmprintf (&tmBundle, TM_NLS_Get("0029","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } /* Prompt for address heirarchy */ tmstrcpy(atyp_ind,_TMC("N")); while (1) { input(ask_atyp_code,TM_NLS_Get("0030","ADDRESS HIERARCHY (e.g. 1MA): "),3,ALPHA); if ( *ask_atyp_code ) { tmstrcpy(atyp_code,ask_atyp_code); inscolratyp(); } else { if ( !tmstrcmp(atyp_ind,_TMC("Y")) ) { EXEC SQL COMMIT; POSTORA; break; } else { tmstrcpy(parm_no,_TMC("04")); sel_optional_ind(FIRST_ROW); if ( compare(rpt_optional_ind,_TMC("O"),EQS) ) { EXEC SQL COMMIT; POSTORA; break; } else { tmprintf (&tmBundle, TM_NLS_Get("0031","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } } } /* while */ /* Prompt for graduate level codes */ if ( tmstrcmp(run_mode,_TMC("1")) ) { tmstrcpy(glvl_ind,_TMC("N")); while (1) { input(ask_glvl_code,TM_NLS_Get("0032","GRAD LEVEL CODE (OPTIONAL): "),2,ALPHA); if ( *ask_glvl_code ) { if ( check_grad_levl(FIRST_ROW) ) { tmstrcpy(glvl_code,ask_glvl_code); inscolrglvl(); } else tmprintf(&tmBundle, TM_NLS_Get("0033","Invalid Level Code. Please re-enter.\n")); } else { if ( !tmstrcmp(glvl_ind,_TMC("Y")) ) { EXEC SQL COMMIT; POSTORA; break; } else tmstrcpy(parm_no,_TMC("07")); sel_optional_ind(FIRST_ROW); if ( compare(rpt_optional_ind,_TMC("O"),EQS) ) { EXEC SQL COMMIT; POSTORA; break; } else { tmprintf(&tmBundle, TM_NLS_Get("0034","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } } /* while */ } /* if */ /* Prompt for line count */ input(linelimit, TM_NLS_Get("0035","NUMBER OF LINES PRINTED PER PAGE [55]: "), 26, NUM); if (!*linelimit) tmstrcpy(linelimit,_TMC("55")); /* NSC additional optional ind in output starts here*/ if (!tmstrcmp(run_mode,_TMC("2"))||!tmstrcmp(run_mode,_TMC("3"))) { input (emailind, TM_NLS_Get("0036","EMAIL ADDRESS OPTIONAL DATA [Y]: "),1,ALPHA); if (*emailind) { if (!inlist(emailind,ALPHA,_TMC("Y"),_TMC("y")) ) { tmprintf (&tmBundle, TM_NLS_Get("0037","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } else { tmstrcpy(emailind,_TMC("Y")); } } input (genderind, TM_NLS_Get("0038","GENDER OPTIONAL DATA [Y]: "),1,ALPHA); if (*genderind) { if (!inlist(genderind,ALPHA,_TMC("Y"),_TMC("y")) ) { tmprintf (&tmBundle, TM_NLS_Get("0039","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } else { tmstrcpy(genderind,_TMC("Y")); } } input (raceind, TM_NLS_Get("0040","RACE OPTIONAL DATA [Y]: "),1,ALPHA); if (*raceind) { if (!inlist(raceind,ALPHA,_TMC("Y"),_TMC("y")) ) { tmprintf (&tmBundle, TM_NLS_Get("0041","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } else { tmstrcpy(raceind,_TMC("Y")); } } input (classlvlind, TM_NLS_Get("0042","CLASS LEVEL OPTIONAL DATA [Y]: "),1,ALPHA); if (*classlvlind) { if (!inlist(classlvlind,ALPHA,_TMC("Y"),_TMC("y")) ) { tmprintf (&tmBundle, TM_NLS_Get("0043","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } else { tmstrcpy(classlvlind,_TMC("Y")); } } input (banneridind, TM_NLS_Get("0044","BANNER ID OPTIONAL DATA [Y]: "),1,ALPHA); if (*banneridind) { if (!inlist(banneridind,ALPHA,_TMC("Y"),_TMC("y")) ) { tmprintf (&tmBundle, TM_NLS_Get("0045","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } else { tmstrcpy(banneridind,_TMC("Y")); } } input (ssnind, TM_NLS_Get("0046","SSN OPTIONAL DATA [Y]: "),1,ALPHA); if (*ssnind) { if (!inlist(ssnind,ALPHA,_TMC("Y"),_TMC("y")) ) { tmprintf (&tmBundle, TM_NLS_Get("0047","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } else { tmstrcpy(ssnind,_TMC("Y")); } } input (partoftermdateind, TM_NLS_Get("0048","REPORT START AND END DATES [Y]: "),1,ALPHA); if (*partoftermdateind) { if (!inlist(partoftermdateind,ALPHA,_TMC("Y"),_TMC("y")) ) { tmprintf (&tmBundle, TM_NLS_Get("0049","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } else { tmstrcpy(partoftermdateind,_TMC("Y")); } } } /* NSC additional optional ind in output ends here*/ input(scp_process,TM_NLS_Get("0050","PROCESS BY STUDENT CENTRIC PERIOD Y OR N: "),1,ALPHA); if ( compare(scp_process,_TMC("Y"),EQS) ) { EXEC SQL SELECT COALESCE(gokeacc.f_getgtvsdaxextcode ('PROCESSSCP', 'CENTRICPERIODS'),'N') INTO :print_process_scp:Ind_10 FROM DUAL; POSTORA; if ( compare(print_process_scp,_TMC("Y"),NES) ) { tmprintf(&tmBundle, TM_NLS_Get("0051","Process by Student Period must be N when GTVSDAX PROCESSSCP does not = Y\n")); /*Terminate the process if GTVSDAX Student centric period is not implemented by displaying the above message*/ exit2os(EXIT_FAILURE); return EXIT_FAILURE; } else { fetchscp(FIRST_ROW); fetchscp(CLOSE_CURSOR); if (*scps_code) { countscpterms(FIRST_ROW); countscpterms(CLOSE_CURSOR); } } } else { tmstrcpy(scp_process,_TMC("N")); tmstrcpy(term_to_process,term);/*Initialize the term to process with parm term*/ tmstrcpy(scps_reg_all_terms,_TMC("N")); tmstrcpy(check_scpreg_flag,_TMC("N")); } /* Prompt for OPEID */ input (ask_opeid, TM_NLS_Get("0052","OPEID: "),8, ALPHA); if (*ask_opeid ) { tmstrcpy(opeid, str2uc(ask_opeid)); if(tmstrlen(opeid) == 6) { tmstrcat(opeid,_TMC("00")); } else if(tmstrlen(opeid) < 8) { tmprintf(&tmBundle, TM_NLS_Get("0053","OPEID is invalid.")); exit2os(EXIT_FAILURE); } } else { tmstrcpy(parm_no, _TMC("26")); sel_optional_ind(FIRST_ROW); if ( !compare(rpt_optional_ind, _TMC("O"), EQS) ) { tmprintf (&tmBundle, TM_NLS_Get("0054","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } /* Prompt for Citizenship Indicator */ input (citizenship_ind, TM_NLS_Get("0055","CITIZENSHIP OPTIONAL DATA [Y]: "),1,ALPHA); if (*citizenship_ind) { if (!inlist(citizenship_ind,ALPHA,_TMC("Y"),_TMC("y")) ) { tmprintf (&tmBundle, TM_NLS_Get("0056","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } else { tmstrcpy(citizenship_ind,_TMC("Y")); } } /* Prompt for Nation Code */ while (1) { input (ask_nation_code, TM_NLS_Get("0057","Nation Code: "),5, ALPHA); if (*ask_nation_code ) { if (validate_nation(ask_nation_code)) { tmstrcpy(nation_code, str2uc(ask_nation_code)); break; } else tmprintf(&tmBundle, TM_NLS_Get("0058","Invalid Nation Code. Please re-enter.\n")); } else { tmstrcpy(parm_no, _TMC("28")); sel_optional_ind(FIRST_ROW); if (compare(rpt_optional_ind, _TMC("O"), EQS) ) { break; } else { tmprintf(&tmBundle, TM_NLS_Get("0059","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } } /* Prompt for continuing education level codes */ tmstrcpy(clvl_ind,_TMC("N")); while (1) { input(ask_clvl_code,TM_NLS_Get("0060","CONTINUING EDUCATION LEVEL CODE (OPTIONAL): "),2,ALPHA); if ( *ask_clvl_code ) { if ( check_ceu_levl(FIRST_ROW) ) { tmstrcpy(clvl_code,ask_clvl_code); inscolrclvl(); } else tmprintf(&tmBundle, TM_NLS_Get("0061","Invalid Level Code. Please re-enter.\n")); } else { if ( !tmstrcmp(clvl_ind,_TMC("Y")) ) { EXEC SQL COMMIT; POSTORA; break; } else tmstrcpy(parm_no,_TMC("30")); sel_optional_ind(FIRST_ROW); if ( compare(rpt_optional_ind,_TMC("O"),EQS) ) { EXEC SQL COMMIT; POSTORA; break; } else { tmprintf(&tmBundle, TM_NLS_Get("0062","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } } /* Prompt for remedial attribute codes */ tmstrcpy(attr_ind,_TMC("N")); while (1) { input(ask_attr_code,TM_NLS_Get("0063","REMEDIAL COURSE ATTRIBUTE CODE (OPTIONAL): "),4,ALPHA); if ( *ask_attr_code ) { if ( check_attr_code(FIRST_ROW) ) { tmstrcpy(attr_code,ask_attr_code); inscolrattr(); } else tmprintf(&tmBundle, TM_NLS_Get("0064","Invalid Attribute Code. Please re-enter.\n")); } else { if ( !tmstrcmp(attr_ind,_TMC("Y")) ) { EXEC SQL COMMIT; POSTORA; break; } else tmstrcpy(parm_no,_TMC("31")); sel_optional_ind(FIRST_ROW); if ( compare(rpt_optional_ind,_TMC("O"),EQS) ) { EXEC SQL COMMIT; POSTORA; break; } else { tmprintf(&tmBundle, TM_NLS_Get("0065","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } } /* Prompt for detail codes */ tmstrcpy(detl_ind,_TMC("N")); while (1) { input(ask_detl_code,TM_NLS_Get("0066","PELL DETAIL CODE (OPTIONAL): "),4,ALPHA); if ( *ask_detl_code ) { if ( check_detail(FIRST_ROW) ) { tmstrcpy(detl_code,ask_detl_code); inscolrdetl(); } else tmprintf(&tmBundle, TM_NLS_Get("0067","Invalid Detail Code. Please re-enter.\n")); } else { if ( !tmstrcmp(detl_ind,_TMC("Y")) ) { EXEC SQL COMMIT; POSTORA; break; } else tmstrcpy(parm_no,_TMC("32")); sel_optional_ind(FIRST_ROW); if ( compare(rpt_optional_ind,_TMC("O"),EQS) ) { EXEC SQL COMMIT; POSTORA; break; } else { tmprintf(&tmBundle, TM_NLS_Get("0068","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } } /*Prompt for Use Finals Date Flag.*/ tmstrcpy(usefinaldateflag,_TMC("N")); input (usefinaldateflag, TM_NLS_Get("0069","USE FINALS DATE [Y/N]: "),1,ALPHA); if (*usefinaldateflag) { if ( ( compare(usefinaldateflag,_TMC("Y"),EQS) ) || ( compare(usefinaldateflag,_TMC("y"),EQS) ) ) { tmstrcpy(usefinaldateflag,_TMC("Y")); } else if ( ( compare(usefinaldateflag,_TMC("N"),EQS) ) || ( compare(usefinaldateflag,_TMC("n"),EQS) ) ) { tmstrcpy(usefinaldateflag,_TMC("N")); } else { tmprintf(&tmBundle, TM_NLS_Get("0070","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } else { tmstrcpy(usefinaldateflag,_TMC("N")); } /*Prompt for Use Curriculum Start/End Dates Flag.*/ tmstrcpy(usecurrstartenddatesflag,_TMC("N")); input (usecurrstartenddatesflag, TM_NLS_Get("0071","USE CURRICULUM START/END DATES [Y/N]: "),1,ALPHA); if (*usecurrstartenddatesflag) { if ( ( compare(usecurrstartenddatesflag,_TMC("Y"),EQS) ) || ( compare(usecurrstartenddatesflag,_TMC("y"),EQS) ) ) { tmstrcpy(usecurrstartenddatesflag,_TMC("Y")); } else if ( ( compare(usecurrstartenddatesflag,_TMC("N"),EQS) ) || ( compare(usecurrstartenddatesflag,_TMC("n"),EQS) ) ) { tmstrcpy(usecurrstartenddatesflag,_TMC("N")); } else { tmprintf(&tmBundle, TM_NLS_Get("0072","Required parameter is missing, aborting job\n")); exit2os(EXIT_FAILURE); return EXIT_FAILURE; } } else { tmstrcpy(usecurrstartenddatesflag,_TMC("N")); } getdata(); tmfclose(ofile2); ofile2=NULL; delcolr(); /* delete this session recs from general table */ EXEC SQL COMMIT; POSTORA; exit2os(EXIT_SUCCESS); return EXIT_SUCCESS; } /* main */ /* *** Job submission alteration */ /* Check for valid job sequence number */ static int validate_one_up_no(int mode) { EXEC SQL DECLARE cursor_001 CURSOR FOR SELECT 'Y' FROM GJBPRUN WHERE GJBPRUN_JOB = :rptname AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_001; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_001; POSTORA; } EXEC SQL FETCH cursor_001 INTO :valid_ind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *valid_ind='\0'; return FALSE; } return TRUE; } /* Retrieve mandatory/optional indicator for parameter */ static int sel_optional_ind(int mode) { EXEC SQL DECLARE cursor_011 CURSOR FOR SELECT GJBPDEF_OPTIONAL_IND FROM GJBPDEF WHERE GJBPDEF_JOB = :rptname AND GJBPDEF_NUMBER = :parm_no; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_011; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_011; POSTORA; } EXEC SQL FETCH cursor_011 INTO :rpt_optional_ind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *rpt_optional_ind='\0'; return FALSE; } return TRUE; } /*****************************************************/ /* initalize variables for the runmode 2,3 report */ /*****************************************************/ static void initialize_report_variables(void) { tmstrcpy(report_id, _TMC("\0")); tmstrcpy(report_ssn, _TMC("\0")); tmstrcpy(report_fullname, _TMC("\0")); tmstrcpy(report_birth_date, _TMC("\0")); tmstrcpy(report_edi_translate, _TMC("\0")); tmstrcpy(report_stud_status, _TMC("\0")); tmstrcpy(report_eb_status_date, _TMC("\0")); tmstrcpy(report_enroll_start_date, _TMC("\0")); tmstrcpy(report_enroll_end_date, _TMC("\0")); tmstrcpy(report_grad_date, _TMC("\0")); } /*****************************************************/ /* copy variables for the runmode 2,3 report */ /*****************************************************/ static void copy_report_variables(void) { if (*student_id) tmstrcpy(report_id, student_id); else tmstrcpy(report_id, _TMC("")); if (*student_ssn) tmstrcpy(report_ssn, student_ssn); else tmstrcpy(report_ssn, _TMC("")); if (*student_fullname) substr(report_fullname, student_fullname, 0,31); else tmstrcpy(report_fullname, _TMC("")); if (*student_birth_date) tmstrcpy(report_birth_date, student_birth_date); else tmstrcpy(report_birth_date, _TMC("")); if (!*report_edi_translate) tmstrcpy(report_edi_translate, _TMC("")); if (*stud_status) tmstrcpy(report_stud_status, stud_status); else tmstrcpy(report_stud_status, _TMC("")); if (*eb_status_date) tmstrcpy(report_eb_status_date, eb_status_date); else tmstrcpy(report_eb_status_date, _TMC("")); if (*enroll_start_date) tmstrcpy(report_enroll_start_date, enroll_start_date); else tmstrcpy(report_enroll_start_date, _TMC("")); if (*enroll_end_date) tmstrcpy(report_enroll_end_date, enroll_end_date); else tmstrcpy(report_enroll_start_date, _TMC("")); if (*enroll_end_date) tmstrcpy(report_enroll_end_date, enroll_end_date); else tmstrcpy(report_enroll_start_date, _TMC("")); if (*date_tmp) tmstrcpy(report_grad_date, date_tmp); else { if (*grad_date_g) tmstrcpy(report_grad_date, grad_date_g); else tmstrcpy(report_grad_date, _TMC("")); } } /************************************************************************/ /* Determine if an ETRM record exists for the student for the term */ /************************************************************************/ static int found_no_etrm(TMCHAR pidm_in[10]) { static BANNUMSTR(temp_pidm)={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR found[2]={0}/*TMCI18N MOVED STRING INIT*/; /*TMCI18N INITIALIZE LOCAL VARIABLES*/ TMCHARRAY_LOCAL_INIT(found,2,_TMC("N")); tonum(temp_pidm, pidm_in); EXEC SQL SELECT 'Y' INTO :found:Ind_01 from dual where exists ( select 1 FROM SFBETRM X WHERE SFBETRM_PIDM = :temp_pidm /*If process by student period is Y and if scps code is not null use terms from scps code */ AND ((:scps_code IS NOT NULL AND SFBETRM_TERM_CODE IN (SELECT SORSCPT_TERM_CODE FROM SORSCPT WHERE SORSCPT_SCPS_CODE=:scps_code)) /*If process by student period is Y or N and if scps code is null then use parm term */ OR (:scps_code IS NULL AND SFBETRM_TERM_CODE = :term)) ); POSTORA; if (NO_ROWS_FOUND || (!tmstrcmp(found,_TMC("N"))) ) { *found = '\0'; return TRUE; /* There is an error to print */ } tmfflush(tmstdout); *found = '\0'; return FALSE; /* There is no error to print */ } /****************************************************************/ /* validate the popsel */ /****************************************************************/ static int validate_popsel(void) { static TMCHAR found[2]={0}/*TMCI18N MOVED STRING INIT*/; EXEC SQL DECLARE valid_popsel CURSOR FOR SELECT 'Y' FROM GLBSLCT WHERE GLBSLCT_APPLICATION = :parm_popsel_appl AND GLBSLCT_SELECTION = :parm_popsel_sel AND GLBSLCT_CREATOR_ID = COALESCE(:parm_popsel_crID, GLBSLCT_CREATOR_ID) ; POSTORA; EXEC SQL OPEN valid_popsel; POSTORA; EXEC SQL FETCH valid_popsel INTO :found:Ind_01; POSTORA; /*TMCI18N INITIALIZE LOCAL VARIABLES*/ TMCHARRAY_LOCAL_INIT(found,2,_TMC("N")); if ( NO_ROWS_FOUND ) { EXEC SQL CLOSE valid_popsel; POSTORA; *found='\0'; return TRUE; /* Invalid popsel - stop report */ } else { EXEC SQL CLOSE valid_popsel; POSTORA; *found='\0'; return FALSE; /* Valid popsel */ } } /************************************************/ /** verify population selection **/ /***********************************************/ static int verify_population(void) { static TMCHAR found[2]={0}/*TMCI18N MOVED STRING INIT*/; EXEC SQL SELECT 'Y' into :found:Ind_01 from glbextr where glbextr_application = :parm_popsel_appl and glbextr_selection = :parm_popsel_sel and glbextr_creator_id = COALESCE(:parm_popsel_crID, glbextr_creator_id) and glbextr_user_id = COALESCE(:parm_popsel_usID, glbextr_user_id); POSTORA; /*TMCI18N INITIALIZE LOCAL VARIABLES*/ TMCHARRAY_LOCAL_INIT(found,2,_TMC("N")); if (NO_ROWS_FOUND) { *found='\0'; return TRUE; /* Invalid popsel - stop report */ } else { *found='\0'; return FALSE; /* Valid popsel */ } } /***********************************************/ /* Parameter Read macros for job submission */ /***********************************************/ /* Obtain the number of lines to be printed per page */ static int read_line_count(void) { EXEC SQL SELECT GJBPRUN_VALUE INTO :linelimit:Ind_01 FROM GJBPRUN WHERE GJBPRUN_NUMBER = '99' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); POSTORA; if (NO_ROWS_FOUND) tmstrcpy(linelimit,_TMC("55")); return TRUE; } static int validate_nation(TMCHAR nation_code[6]) { TMCHAR found[2]={0}; EXEC SQL DECLARE valid_nation CURSOR FOR SELECT 'Y' FROM STVNATN WHERE STVNATN_CODE = :nation_code; POSTORA; EXEC SQL OPEN valid_nation; POSTORA; EXEC SQL FETCH valid_nation INTO :found:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { EXEC SQL CLOSE valid_nation; POSTORA; *found='\0'; return FALSE; } else { EXEC SQL CLOSE valid_nation; POSTORA; *found='\0'; return TRUE; } } /****************************************************************/ /* validate the SSN */ /****************************************************************/ static int validate_ssn(TMCHAR ssn_in[15]) { static TMCHAR found[2]={0}/*TMCI18N MOVED STRING INIT*/; /*TMCI18N INITIALIZE LOCAL VARIABLES*/ TMCHARRAY_LOCAL_INIT(found,2,_TMC("N")); if (( tmstrlen(ssn_in) > 9 ) || (tmstrlen(ssn_in) < 9 )) return FALSE; EXEC SQL DECLARE valid_ssn CURSOR FOR SELECT 'Y' FROM dual WHERE SUBSTR(:ssn_in,1,1) NOT IN ('1','2','3','4','5','6','7','8','9','0') OR SUBSTR(:ssn_in,2,1) NOT IN ('1','2','3','4','5','6','7','8','9','0') OR SUBSTR(:ssn_in,3,1) NOT IN ('1','2','3','4','5','6','7','8','9','0') OR SUBSTR(:ssn_in,4,1) NOT IN ('1','2','3','4','5','6','7','8','9','0') OR SUBSTR(:ssn_in,5,1) NOT IN ('1','2','3','4','5','6','7','8','9','0') OR SUBSTR(:ssn_in,6,1) NOT IN ('1','2','3','4','5','6','7','8','9','0') OR SUBSTR(:ssn_in,7,1) NOT IN ('1','2','3','4','5','6','7','8','9','0') OR SUBSTR(:ssn_in,8,1) NOT IN ('1','2','3','4','5','6','7','8','9','0') OR SUBSTR(:ssn_in,9,1) NOT IN ('1','2','3','4','5','6','7','8','9','0'); POSTORA; EXEC SQL OPEN valid_ssn; POSTORA; EXEC SQL FETCH valid_ssn INTO :found:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { EXEC SQL CLOSE valid_ssn; POSTORA; *found='\0'; return TRUE; } else { tmstrcpy(ssn_in,_TMC("")); EXEC SQL CLOSE valid_ssn; POSTORA; *found='\0'; return FALSE; } } /****************************************************************/ /* validate the BRANCH CODE */ /****************************************************************/ static int validate_branch(TMCHAR branch_in[5]) { static TMCHAR found[2]={0}/*TMCI18N MOVED STRING INIT*/; /*TMCI18N INITIALIZE LOCAL VARIABLES*/ TMCHARRAY_LOCAL_INIT(found,2,_TMC("N")); if (( tmstrlen(branch_in) > 2 ) || (tmstrlen(branch_in) < 2 )) { tmstrcpy(branch_code, _TMC("00")); return FALSE; } EXEC SQL DECLARE valid_branch CURSOR FOR SELECT 'Y' FROM dual WHERE SUBSTR(:branch_in,1,1) NOT IN ('1','2','3','4','5','6','7','8','9','0') OR SUBSTR(:branch_in,2,1) NOT IN ('1','2','3','4','5','6','7','8','9','0'); POSTORA; EXEC SQL OPEN valid_branch; POSTORA; EXEC SQL FETCH valid_branch INTO :found:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { EXEC SQL CLOSE valid_branch; POSTORA; *found='\0'; return TRUE; } else { tmstrcpy(branch_in,_TMC("00")); EXEC SQL CLOSE valid_branch; POSTORA; *found='\0'; return FALSE; } } /*****************************************************************/ /* This function takes "/a/b/c/d/sfrnslc_##.lis " and returns */ /* "/a/b/c/d/sfrnslc_##.txt" */ /*****************************************************************/ static void find_name_for(TMCHAR *fullname) { static TMCHAR outfile[200]={0}/*TMCI18N CHANGED FROM ""*/; int len = 0; len = tmstrlen(ofile_name); substr(outfile,ofile_name,0,len-3); tmstrcat(outfile,_TMC("txt")); tmstrcpy(ofile_name2,outfile); } /* Obtain the student TERM */ static int readterm(int mode) { EXEC SQL DECLARE cursor_002 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '01' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_002; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_002; POSTORA; } EXEC SQL FETCH cursor_002 INTO :term:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *term='\0'; return FALSE; } return TRUE; } /* Obtain the STUDENT EXCLUDE code */ static int readstudex(int mode) { EXEC SQL DECLARE cursor_003 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '02' AND GJBPRUN_VALUE IS NOT NULL AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_003; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_003; POSTORA; } EXEC SQL FETCH cursor_003 INTO :studex:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) { *studex='\0'; return FALSE; } return TRUE; } /* Obtain the REPORT FLAG code */ static int readreport_flag(int mode) { EXEC SQL DECLARE cursor_004 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '03' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_004; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_004; POSTORA; } EXEC SQL FETCH cursor_004 INTO :report_flag:Ind_03; POSTORA; if ( NO_ROWS_FOUND ) { *report_flag='\0'; return FALSE; } return TRUE; } /* Obtain the ADDRESS TYPE code */ static int readatyp(int mode) { EXEC SQL DECLARE cursor_005 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '04' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_005; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_005; POSTORA; } EXEC SQL FETCH cursor_005 INTO :atyp_code:Ind_04; POSTORA; if ( NO_ROWS_FOUND ) { *atyp_code='\0'; return FALSE; } return TRUE; } /* Obtain the REPORT DATE code */ static int readdate(int mode) { EXEC SQL DECLARE cursor_006 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '05' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_006; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_006; POSTORA; } EXEC SQL FETCH cursor_006 INTO :sel_date:Ind_05; POSTORA; if ( NO_ROWS_FOUND ) { *sel_date='\0'; return FALSE; } return TRUE; } /* Obtain the RUN MODE code */ static int readrun_mode(int mode) { EXEC SQL DECLARE cursor_007 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '06' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_007; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_007; POSTORA; } EXEC SQL FETCH cursor_007 INTO :run_mode:Ind_06; POSTORA; if ( NO_ROWS_FOUND ) { *run_mode='\0'; return FALSE; } return TRUE; } /* Obtain the GRAD LEVEL code */ static int readglvl(int mode) { EXEC SQL DECLARE cursor_008 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '07' AND GJBPRUN_VALUE IS NOT NULL AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_008; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_008; POSTORA; } EXEC SQL FETCH cursor_008 INTO :glvl_code:Ind_07; POSTORA; if ( NO_ROWS_FOUND ) { *glvl_code='\0'; return FALSE; } return TRUE; } /* Obtain the CEU LEVEL code */ static int readclvl(int mode) { EXEC SQL DECLARE cursor_908 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '30' AND GJBPRUN_VALUE IS NOT NULL AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_908; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_908; POSTORA; } EXEC SQL FETCH cursor_908 INTO :clvl_code:Ind_07; POSTORA; if ( NO_ROWS_FOUND ) { *clvl_code='\0'; return FALSE; } return TRUE; } /* Obtain the remedial attribute code */ static int readattr(int mode) { EXEC SQL DECLARE cursor_557 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '31' AND GJBPRUN_VALUE IS NOT NULL AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_557; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_557; POSTORA; } EXEC SQL FETCH cursor_557 INTO :attr_code:Ind_07; POSTORA; if ( NO_ROWS_FOUND ) { *attr_code='\0'; return FALSE; } return TRUE; } /* Obtain the detail code */ static int readdetl(int mode) { EXEC SQL DECLARE cursor_587 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '32' AND GJBPRUN_VALUE IS NOT NULL AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_587; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_587; POSTORA; } EXEC SQL FETCH cursor_587 INTO :detl_code:Ind_07; POSTORA; if ( NO_ROWS_FOUND ) { *detl_code='\0'; return FALSE; } return TRUE; } /* Obtain the Use Final Dates Parameter Value */ static int readusefinaldate(int mode) { EXEC SQL DECLARE cursor_588 CURSOR FOR SELECT COALESCE(GJBPRUN_VALUE,'N') FROM GJBPRUN WHERE GJBPRUN_NUMBER = '33' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_588; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_588; POSTORA; } EXEC SQL FETCH cursor_588 INTO :usefinaldateflag:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { tmstrcpy(usefinaldateflag,_TMC("N")); return FALSE; } return TRUE; } /* Obtain the Use Curriculum Start/End Dates Parameter Value */ static int readusecurrstartenddates(int mode) { EXEC SQL DECLARE cursor_589 CURSOR FOR SELECT COALESCE(GJBPRUN_VALUE,'N') FROM GJBPRUN WHERE GJBPRUN_NUMBER = '34' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_589; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_589; POSTORA; } EXEC SQL FETCH cursor_589 INTO :usecurrstartenddatesflag:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { tmstrcpy(usecurrstartenddatesflag,_TMC("N")); return FALSE; } return TRUE; } /* Obtain the parm_popsel_appl */ static int readpopselappl(int mode) { EXEC SQL DECLARE cursor_101 CURSOR FOR SELECT UPPER(GJBPRUN_VALUE) FROM GJBPRUN WHERE GJBPRUN_NUMBER = '08' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_101; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_101; POSTORA; } EXEC SQL FETCH cursor_101 INTO :parm_popsel_appl:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *parm_popsel_appl ='\0'; return FALSE; } return TRUE; } /* Obtain the parm_popsel_sel */ static int readpopselsel(int mode) { EXEC SQL DECLARE cursor_102 CURSOR FOR SELECT UPPER(GJBPRUN_VALUE) FROM GJBPRUN WHERE GJBPRUN_NUMBER = '09' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_102; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_102; POSTORA; } EXEC SQL FETCH cursor_102 INTO :parm_popsel_sel:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *parm_popsel_sel ='\0'; return FALSE; } return TRUE; } /* Obtain the parm_popsel_crID */ static int readpopselcrID(int mode) { EXEC SQL DECLARE cursor_103 CURSOR FOR SELECT UPPER(GJBPRUN_VALUE) FROM GJBPRUN WHERE GJBPRUN_NUMBER = '10' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_103; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_103; POSTORA; } EXEC SQL FETCH cursor_103 INTO :parm_popsel_crID:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *parm_popsel_crID ='\0'; return FALSE; } return TRUE; } /* Obtain the parm_popsel_usID */ static int readpopselusID(int mode) { EXEC SQL DECLARE cursor_104 CURSOR FOR SELECT UPPER(GJBPRUN_VALUE) FROM GJBPRUN WHERE GJBPRUN_NUMBER = '11' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_104; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_104; POSTORA; } EXEC SQL FETCH cursor_104 INTO :parm_popsel_usID:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *parm_popsel_usID ='\0'; return FALSE; } return TRUE; } /* Obtain the eff_wdrl_ind */ static int readeffwdrldate(int mode) { EXEC SQL DECLARE cursor_105 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '12' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_105; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_105; POSTORA; } EXEC SQL FETCH cursor_105 INTO :eff_wdrl_ind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *eff_wdrl_ind ='\0'; return FALSE; } return TRUE; } /* Obtain the branch_code */ static int readbranchcode(int mode) { EXEC SQL DECLARE cursor_106 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '13' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_106; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_106; POSTORA; } EXEC SQL FETCH cursor_106 INTO :branch_code:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { tmstrcpy(branch_code,_TMC("00")); return FALSE; } else { if (!validate_branch(branch_code)) ; /* '00' will be defaulted if invalid code */ } return TRUE; } /* Obtain fice_code_in from job parameter */ static int readficecodein(int mode) { EXEC SQL DECLARE cursor_207 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '15' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_207; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_207; POSTORA; } EXEC SQL FETCH cursor_207 INTO :fice_code_in:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { return FALSE; } return TRUE; } /* Include new job sub parameters for NSC additional fields in output Starts here*/ static int readprefemail_flag(int mode) { EXEC SQL DECLARE cursor_302 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '18' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_302; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_302; POSTORA; } EXEC SQL FETCH cursor_302 INTO :emailind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *emailind='\0'; return FALSE; } return TRUE; } static int readgender_flag(int mode) { EXEC SQL DECLARE cursor_303 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '19' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_303; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_303; POSTORA; } EXEC SQL FETCH cursor_303 INTO :genderind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *genderind='\0'; return FALSE; } return TRUE; } static int readrace_flag(int mode) { EXEC SQL DECLARE cursor_304 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '20' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_304; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_304; POSTORA; } EXEC SQL FETCH cursor_304 INTO :raceind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *raceind='\0'; return FALSE; } return TRUE; } static int readclasslevel_flag(int mode) { EXEC SQL DECLARE cursor_305 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '21' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_305; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_305; POSTORA; } EXEC SQL FETCH cursor_305 INTO :classlvlind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *classlvlind='\0'; return FALSE; } return TRUE; } static int readbannerid_flag(int mode) { EXEC SQL DECLARE cursor_306 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '22' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_306; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_306; POSTORA; } EXEC SQL FETCH cursor_306 INTO :banneridind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *banneridind='\0'; return FALSE; } return TRUE; } static int readssn_flag(int mode) { EXEC SQL DECLARE cursor_307 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '23' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_307; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_307; POSTORA; } EXEC SQL FETCH cursor_307 INTO :ssnind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *ssnind='\0'; return FALSE; } return TRUE; } static int readactenroldates_flag(int mode) { EXEC SQL DECLARE cursor_308 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '24' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_308; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_308; POSTORA; } EXEC SQL FETCH cursor_308 INTO :partoftermdateind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *partoftermdateind='\0'; return FALSE; } return TRUE; } /* Include new job sub parameters for NSC additional fields in output ends here*/ /* Obtain the Process by student period flag */ static int readscpprocess(int mode) { EXEC SQL DECLARE cursor_009 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '25' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_009; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_009; POSTORA; } EXEC SQL FETCH cursor_009 INTO :scp_process:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { tmstrcpy(scp_process,_TMC("N")); return FALSE; } return TRUE; } static void process_scp_settings(void) { /*If parm 25 Process by student period is Y and if GTVSDAX Student centric period is not implemented then, */ /*Process by student period Parm 25 cannot by Y. */ if ( compare(scp_process,_TMC("Y"),EQS) ) { EXEC SQL SELECT COALESCE(gokeacc.f_getgtvsdaxextcode ('PROCESSSCP', 'CENTRICPERIODS'),'N') INTO :print_process_scp:Ind_11 FROM DUAL; POSTORA; if ( compare(print_process_scp,_TMC("Y"),NES) ) { tmprintf(&tmBundle, TM_NLS_Get("0073","sfrnslc terminated with error\n")); prtmsg(LINSOUT, count,ofile_name); tmprintf(&tmBundle, TM_NLS_Get("0074","Process by Student Period must be N when GTVSDAX PROCESSSCP does not = Y\n")); /*Terminate the process if GTVSDAX Student centric period is not implemented by displaying the above message*/ del_parms(); delcolr(); EXEC SQL COMMIT; POSTORA; exit2os(EXIT_FAILURE); } } } /* Obtain the OPEID */ static int readopeid(int mode) { int opeid_length = 0; EXEC SQL DECLARE cursor_026 CURSOR FOR SELECT GJBPRUN_VALUE,length(GJBPRUN_VALUE) FROM GJBPRUN WHERE GJBPRUN_NUMBER = '26' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no) AND GJBPRUN_VALUE IS NOT NULL; /*8.14.1*/ if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_026; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_026; POSTORA; } EXEC SQL FETCH cursor_026 INTO :opeid:Ind_01, :opeid_length:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) { *opeid='\0'; return FALSE; } else { if( opeid_length==6) { tmstrcat(opeid,_TMC("00")); } else if(opeid_length < 8) { tmprintf(&tmBundle, TM_NLS_Get("0075","OPEID is invalid.")); exit2os(EXIT_FAILURE); } } return TRUE; } static int readcitizenship_flag(int mode) { EXEC SQL DECLARE cursor_745 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '27' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_745; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_745; POSTORA; } EXEC SQL FETCH cursor_745 INTO :citizenship_ind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *citizenship_ind='\0'; return FALSE; } return TRUE; } static int readnationcode(int mode) { EXEC SQL DECLARE cursor_035 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '28' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_035; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_035; POSTORA; } EXEC SQL FETCH cursor_035 INTO :nation_code :Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *nation_code='\0'; return FALSE; } return TRUE; } static int fetchscp(int mode) { EXEC SQL DECLARE cursor_010 CURSOR FOR /*Fetch the SCP and cycle where the term code is the last term in that scp code*/ SELECT SOBSCPS_CODE, SOBSCPS_SCPC_CODE FROM SORSCPT A,SOBSCPS WHERE A.SORSCPT_TERM_CODE=:term /*Fetch the SCP and cycle where the term code is the last term in that scp code*/ AND A.SORSCPT_TERM_CODE = (SELECT MAX(B.SORSCPT_TERM_CODE) FROM SORSCPT B WHERE A.SORSCPT_SCPS_CODE=B.SORSCPT_SCPS_CODE) AND A.SORSCPT_SCPS_CODE=SOBSCPS_CODE group by SOBSCPS_CODE, SOBSCPS_SCPC_CODE ORDER BY 1; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_010; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_010; POSTORA; } EXEC SQL FETCH cursor_010 INTO :scps_code:Ind_01, :cycle_code:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) { EXEC SQL CLOSE cursor_010; POSTORA; *scps_code='\0'; *cycle_code='\0'; return FALSE; } EXEC SQL CLOSE cursor_010; POSTORA; return TRUE; } static int countscpterms(int mode) { EXEC SQL DECLARE cursor_114 CURSOR FOR SELECT COUNT(SORSCPT_TERM_CODE) /*Count the number of term codes in this table*/ FROM SORSCPT WHERE SORSCPT_SCPS_CODE=:scps_code; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_114; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_114; POSTORA; } EXEC SQL FETCH cursor_114 INTO :count_scp_terms:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { EXEC SQL CLOSE cursor_114; POSTORA; *count_scp_terms='\0'; return FALSE; } EXEC SQL CLOSE cursor_114; POSTORA; return TRUE; } /* locate the start date of the first term and the end date of the last term of the scp */ static int select_scpterm_dates(int mode) { EXEC SQL DECLARE cursor_555 CURSOR FOR SELECT MIN(TO_CHAR(STVTERM_START_DATE, 'YYYYMMDD')), MAX(TO_CHAR(STVTERM_END_DATE, 'YYYYMMDD')) FROM STVTERM WHERE STVTERM_CODE IN (SELECT SORSCPT_TERM_CODE FROM SORSCPT WHERE SORSCPT_SCPS_CODE=:scps_code); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_555; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_555; POSTORA; } EXEC SQL FETCH cursor_555 INTO :scp_term_start:Ind_01, :scp_term_end:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) { EXEC SQL CLOSE cursor_555; POSTORA; *scp_term_start='\0'; *scp_term_end='\0'; *scp_term_end_orig='\0'; return FALSE; } tmstrcpy(scp_term_end_orig,scp_term_end); EXEC SQL CLOSE cursor_555; POSTORA; return TRUE; } static int countregterms(int mode) { EXEC SQL DECLARE cursor_115 CURSOR FOR SELECT COUNT(DISTINCT SFRSTCR_TERM_CODE) /*Count the number of distinct term codes in this table*/ FROM SFRSTCR, STVRSTS WHERE STVRSTS_INCL_SECT_ENRL = 'Y' AND SFRSTCR_RSTS_CODE = STVRSTS_CODE AND SFRSTCR_TERM_CODE IN (SELECT SORSCPT_TERM_CODE FROM SORSCPT WHERE SORSCPT_SCPS_CODE=:scps_code) AND SFRSTCR_PIDM = :pidm; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_115; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_115; POSTORA; } EXEC SQL FETCH cursor_115 INTO :count_reg_terms:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { EXEC SQL CLOSE cursor_115; POSTORA; *count_reg_terms='\0'; return FALSE; } EXEC SQL CLOSE cursor_115; POSTORA; return TRUE; } static int fetch_enrl_cycle(int mode) { EXEC SQL DECLARE cursor_116 CURSOR FOR SELECT DISTINCT X.SGBSTDN_SCPC_CODE /*fetch the cycle code for those enrolled in terms for scp and matches the cycle code with scps cycle code*/ FROM SGBSTDN X,SFBETRM Y WHERE X.SGBSTDN_TERM_CODE_EFF = ( SELECT MAX(Z.SGBSTDN_TERM_CODE_EFF) FROM SGBSTDN Z WHERE Z.SGBSTDN_TERM_CODE_EFF <= Y.SFBETRM_TERM_CODE AND Z.SGBSTDN_PIDM = Y.SFBETRM_PIDM ) AND X.SGBSTDN_PIDM = Y.SFBETRM_PIDM AND X.SGBSTDN_SCPC_CODE =:cycle_code AND Y.SFBETRM_PIDM= :pidm AND Y.SFBETRM_TERM_CODE IN (SELECT SORSCPT_TERM_CODE FROM SORSCPT WHERE SORSCPT_SCPS_CODE=:scps_code); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_116; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_116; POSTORA; } EXEC SQL FETCH cursor_116 INTO :enrl_cycle_code:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { EXEC SQL CLOSE cursor_116; POSTORA; *enrl_cycle_code='\0'; return FALSE; } EXEC SQL CLOSE cursor_116; POSTORA; return TRUE; } static int fetch_first_reg_scp(int mode) { EXEC SQL DECLARE cursor_117 CURSOR FOR SELECT SFRSTCR_TERM_CODE /*Check if is registered only in first term of scp and use that term code for processing*/ FROM SFRSTCR, STVRSTS WHERE STVRSTS_INCL_SECT_ENRL = 'Y' AND SFRSTCR_RSTS_CODE = STVRSTS_CODE AND SFRSTCR_TERM_CODE IN (SELECT MIN(SORSCPT_TERM_CODE) FROM SORSCPT WHERE SORSCPT_SCPS_CODE=:scps_code) AND SFRSTCR_PIDM = :pidm group by sfrstcr_term_code; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_117; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_117; POSTORA; } EXEC SQL FETCH cursor_117 INTO :term_to_process:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { EXEC SQL CLOSE cursor_117; POSTORA; tmstrcpy(term_to_process,term); /*Use the parm term for processing*/ return FALSE; } EXEC SQL CLOSE cursor_117; POSTORA; return TRUE; } /* Obtain the create enhanced report ind */ static int readcreatereport(int mode) { EXEC SQL DECLARE cursor_107 CURSOR FOR SELECT GJBPRUN_VALUE FROM GJBPRUN WHERE GJBPRUN_NUMBER = '14' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_107; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_107; POSTORA; } EXEC SQL FETCH cursor_107 INTO :create_rpt:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { tmstrcpy(create_rpt,_TMC("Y")); return FALSE; } return TRUE; } /* Read collector records. */ static void readcolr(UFILE *file_in) { EXEC SQL DECLARE crs_collector CURSOR FOR SELECT SPRCOLR_VALUE_ATYP FROM SPRCOLR WHERE SPRCOLR_SESSIONID = :sessionid AND SPRCOLR_TYPE = :colr_type ORDER BY SPRCOLR_VALUE_ATYP; EXEC SQL OPEN crs_collector; POSTORA; while (1) { EXEC SQL FETCH crs_collector INTO :colr_value:Ind_01; POSTORA; if (NO_ROWS_FOUND) { *colr_value = '\0'; break; } tmfprintf (&tmBundle, file_in,_TMC("{0} "),colr_value); } } /* Delete parameter table records */ static void del_parms(void) { EXEC SQL DELETE FROM GJBPRUN WHERE GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); POSTORA; } /* Standard select macros */ /* */ /* Get current date */ static int seldate(int mode) { EXEC SQL DECLARE cursor_027 CURSOR FOR SELECT SYSDATE FROM DUAL; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_027; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_027; POSTORA; } EXEC SQL FETCH cursor_027 INTO :date:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *date='\0'; return FALSE; } return TRUE; } static void seltime(void) { EXEC SQL DECLARE cursor_070 CURSOR FOR SELECT MAX(TO_CHAR(sfrthst_tmst_date,'HH24:MI:SS') ) FROM sfrthst WHERE TRUNC(sfrthst_tmst_date) = TO_DATE(:sel_date,G$_DATE.GET_NLS_DATE_FORMAT) AND sfrthst_term_code = :term; EXEC SQL OPEN cursor_070; POSTORA; EXEC SQL FETCH cursor_070 INTO :sel_time:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *sel_time='\0'; } EXEC SQL CLOSE cursor_070; POSTORA; } /* Get institution name from institution table */ static int selinst(int mode) { EXEC SQL DECLARE cursor_028 CURSOR FOR SELECT LTRIM(RTRIM(GUBINST_NAME,' '),' '), LENGTH(LTRIM(RTRIM(GUBINST_NAME,' '),' ')) FROM GUBINST; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_028; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_028; POSTORA; } EXEC SQL FETCH cursor_028 INTO :institution:Ind_01, :inst_len:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) { *institution='\0'; return FALSE; } inst_pos = ((rptwid/2) + (inst_len/2) - datetimelen); page_pos = (rptwid - datetimelen - inst_pos - pagenumlen); return TRUE; } /* Get Email address, */ static void selprefemail(void) { checkemailcount(); EXEC SQL DECLARE cursor_400 CURSOR FOR SELECT GOREMAL_EMAIL_ADDRESS FROM GOREMAL WHERE GOREMAL_PIDM=:pidm AND (( COALESCE(TO_NUMBER(:emailcount),0)>1 AND GOREMAL_PREFERRED_IND='Y') /*If multiple email exists then check for preferred ind or else if single email then fetch that*/ OR (COALESCE(TO_NUMBER(:emailcount),0)<=1)) AND GOREMAL_STATUS_IND='A'; EXEC SQL OPEN cursor_400; POSTORA; EXEC SQL FETCH cursor_400 INTO :stud_prefemail:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *stud_prefemail='\0'; *emailcount='\0'; } EXEC SQL CLOSE cursor_400; POSTORA; } static void checkemailcount(void) { *emailcount='\0'; EXEC SQL DECLARE cursor_405 CURSOR FOR /*Check for no. of email entries for pidm*/ SELECT count(*) FROM GOREMAL WHERE GOREMAL_PIDM=:pidm AND GOREMAL_STATUS_IND='A'; EXEC SQL OPEN cursor_405; POSTORA; EXEC SQL FETCH cursor_405 INTO :emailcount:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *emailcount='\0'; } EXEC SQL CLOSE cursor_405; POSTORA; } static void get_alien(void)/* check for non-resident alien*/ { tmstrcpy(alien,_TMC("N")); EXEC SQL SELECT 'Y' INTO :alien:Ind_01 FROM DUAL WHERE gokintl.f_check_nonresident_status(:pidm, TO_DATE(:resid_date,G$_DATE.GET_NLS_DATE_FORMAT) ) = 'Y'; POSTORA; if ( NO_ROWS_FOUND ) tmstrcpy(alien,_TMC("N")); } /* Get race */ static void selrace(void) { get_alien(); if (compare(alien,_TMC("Y"),EQS)) /* check for non-resident alien*/ { tmstrcpy(stud_race,_TMC("8")); } else { if ( compare(stud_ethn_cde,_TMC("2"),EQS)) /*If hispanic then display appropriate EDI value*/ { tmstrcpy(stud_race,_TMC("R")); } else { /*If non hispanic then display appropriate EDI value for pidm if only single race is defined for the person*/ EXEC SQL DECLARE cursor_401 CURSOR FOR SELECT DISTINCT DECODE(gorrace_rrac_code,'1','T','2','U','3','Q','4','V','5','S','7') FROM gorprac,gorrace /* This query is to select Single races if any and display its EDI value*/ WHERE gorprac_pidm=:pidm AND gorrace_race_cde=gorprac_race_cde AND gorrace_rrac_code IS NOT NULL HAVING COUNT(DISTINCT gorrace_rrac_code ) = (SELECT COUNT(DISTINCT(gorrace_rrac_code)) /*To check is it single race or not*/ FROM gorrace,gorprac WHERE gorprac_pidm=:pidm AND gorrace_race_cde=gorprac_race_cde AND gorrace_rrac_code IS NOT NULL HAVING COUNT(DISTINCT(gorrace_rrac_code)) =1) GROUP BY gorrace_rrac_code UNION ALL SELECT 'Z' /*If pidm has multiple race then report EDI Values as Z*/ FROM gorprac,gorrace WHERE gorprac_pidm=:pidm AND gorrace_race_cde=gorprac_race_cde AND gorrace_rrac_code IS NOT NULL HAVING COUNT(DISTINCT(gorrace_rrac_code)) >1; EXEC SQL OPEN cursor_401; POSTORA; EXEC SQL FETCH cursor_401 INTO :stud_race:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { tmstrcpy(stud_race,_TMC("7"));/*If pidm has no race or ethnicity*/ } EXEC SQL CLOSE cursor_401; POSTORA; } } } /* Get Class Levl */ static void selclasslevel(void) { *stud_classlevel_code='\0'; *stud_classlevel='\0'; EXEC SQL SELECT COALESCE(SGKCLAS.F_CLASS_CODE(:pidm, :stud_levl_code, :term_to_process),'ZZ') /* to fetch class level code*/ INTO :stud_classlevel_code:Ind_12 FROM DUAL; POSTORA; /*for the class level code selected fetch the NSC class and corresponding EDI in decode from STVCLAS table*/ EXEC SQL DECLARE cursor_403 CURSOR FOR SELECT DECODE(stvclas_nsc_class_cde,'F','21','S','22','J','23','R','24','C','20','N','20','M','28','D','29','P','30','L','27','G','26', 'T','25','A','AS','B','BD','UN') FROM stvclas WHERE stvclas_code=:stud_classlevel_code; EXEC SQL OPEN cursor_403; POSTORA; EXEC SQL FETCH cursor_403 INTO :stud_classlevel:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *stud_classlevel_code='\0'; tmstrcpy(stud_classlevel,_TMC("UN")); } EXEC SQL CLOSE cursor_403; POSTORA; } /* Get Start and End date */ static void selstartenddates(TMCHAR p_term_code[7]) { *partofterm_mindate='\0'; *partofterm_maxdate='\0'; if (!*p_term_code) /* p_term_code IS NULL */ { tmstrcpy(p_term_code,term); } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0076"," Debug: selstartenddates() Starts. pidm {0} check_scpreg_flag {1} scps_code {2} p_term_code {3} usefinaldateflag {4} term {5}\n"), pidm,check_scpreg_flag,scps_code,p_term_code,usefinaldateflag,term ); #endif EXEC SQL DECLARE cursor_404 CURSOR FOR SELECT to_char(min(a.SFRAREG_START_DATE),'YYYYMMDD'), to_char(max(b.SFRAREG_COMPLETION_DATE),'YYYYMMDD') FROM SFRAREG a, SFRAREG b, STVRSTS s1, STVRSTS s2 WHERE a.SFRAREG_PIDM = :pidm AND ((:check_scpreg_flag='Y' AND a.SFRAREG_TERM_CODE IN (SELECT SORSCPT_TERM_CODE FROM SORSCPT WHERE SORSCPT_SCPS_CODE=:scps_code)) OR (:check_scpreg_flag='N' AND a.SFRAREG_TERM_CODE = :p_term_code)) AND a.SFRAREG_EXTENSION_NUMBER = 0 AND a.SFRAREG_RSTS_CODE = s1.STVRSTS_CODE AND ( s1.STVRSTS_INCL_SECT_ENRL = 'Y' OR 'Y' = :usefinaldateflag ) AND b.SFRAREG_PIDM = :pidm AND ((:check_scpreg_flag='Y' AND b.SFRAREG_TERM_CODE IN (SELECT SORSCPT_TERM_CODE FROM SORSCPT WHERE SORSCPT_SCPS_CODE=:scps_code)) OR (:check_scpreg_flag='N' AND b.SFRAREG_TERM_CODE = :p_term_code)) AND b.SFRAREG_EXTENSION_NUMBER = (SELECT MAX(c.SFRAREG_EXTENSION_NUMBER) FROM SFRAREG c, STVRSTS s3 WHERE c.SFRAREG_PIDM = :pidm AND ((:check_scpreg_flag='Y' AND c.SFRAREG_TERM_CODE IN (SELECT SORSCPT_TERM_CODE FROM SORSCPT WHERE SORSCPT_SCPS_CODE=:scps_code)) OR (:check_scpreg_flag='N' AND c.SFRAREG_TERM_CODE = :p_term_code)) AND c.SFRAREG_RSTS_CODE = s3.STVRSTS_CODE AND ( s3.STVRSTS_INCL_SECT_ENRL = 'Y' OR 'Y' = :usefinaldateflag ) ) AND b.SFRAREG_RSTS_CODE = s2.STVRSTS_CODE AND s2.STVRSTS_INCL_SECT_ENRL = 'Y'; EXEC SQL OPEN cursor_404; POSTORA; EXEC SQL FETCH cursor_404 INTO :partofterm_mindate:Ind_01, :partofterm_maxdate:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) { *partofterm_mindate='\0'; *partofterm_maxdate='\0'; } if (!*partofterm_mindate) /* partofterm_mindate IS NULL */ { if (( compare(scp_process,_TMC("Y"),EQS) ) && ( compare(cycle_code,enrl_cycle_code,EQS) )) { tmstrcpy(partofterm_mindate,scp_term_start); tmstrcpy(partofterm_maxdate,scp_term_end); } else { tmstrcpy(partofterm_mindate,enroll_start_date); tmstrcpy(partofterm_maxdate,enroll_end_date); } } if ( compare(usefinaldateflag,_TMC("Y"),EQS) ) { if (*final_end_dates) { if ( (tmstrcmp(final_end_dates,partofterm_maxdate) > 0) && (*partofterm_maxdate) ) { tmstrcpy(partofterm_maxdate,final_end_dates); } } } EXEC SQL CLOSE cursor_404; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0077"," Debug: selstartenddates() Ends. partofterm_mindate {0} partofterm_maxdate {1} final_end_dates {2} enroll_start_date {3} enroll_end_date {4}\n"), partofterm_mindate,partofterm_maxdate,final_end_dates,enroll_start_date,enroll_end_date ); #endif } /* Get Final End dates. */ static void selfinaldates(void) { *final_end_dates='\0'; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0078"," Debug: selfinaldates() Starts. pidm {0} check_scpreg_flag {1} scps_code {2} term {3} usefinaldateflag {4}\n"), pidm,check_scpreg_flag,scps_code,term,usefinaldateflag ); #endif EXEC SQL DECLARE cursor_final_date CURSOR FOR SELECT to_char(max(final_date_tbl.final_date),'YYYYMMDD') FROM ( SELECT max(fncr.SORFNCR_END_DATE) final_date FROM STVRSTS rsts, SORFNCR fncr, SSBSECT sect, SFRSTCR stcr WHERE stcr.SFRSTCR_PIDM = :pidm AND ((:check_scpreg_flag='Y' AND stcr.SFRSTCR_TERM_CODE IN (SELECT SORSCPT_TERM_CODE FROM SORSCPT WHERE SORSCPT_SCPS_CODE=:scps_code)) OR (:check_scpreg_flag='N' AND stcr.SFRSTCR_TERM_CODE = :term)) AND sect.SSBSECT_TERM_CODE = stcr.SFRSTCR_TERM_CODE AND sect.SSBSECT_CRN = stcr.SFRSTCR_CRN AND stcr.SFRSTCR_RSTS_CODE = rsts.STVRSTS_CODE AND ( rsts.STVRSTS_INCL_SECT_ENRL = 'Y' OR 'Y' = :usefinaldateflag ) AND fncr.SORFNCR_TERM_CODE = sect.SSBSECT_TERM_CODE AND fncr.SORFNCR_CRN = sect.SSBSECT_CRN UNION ALL SELECT max(fnpt.SORFNPT_END_DATE) final_date FROM STVRSTS rsts, SORFNPT fnpt, SSBSECT sect, SFRSTCR stcr WHERE stcr.SFRSTCR_PIDM = :pidm AND ((:check_scpreg_flag='Y' AND stcr.SFRSTCR_TERM_CODE IN (SELECT SORSCPT_TERM_CODE FROM SORSCPT WHERE SORSCPT_SCPS_CODE=:scps_code)) OR (:check_scpreg_flag='N' AND stcr.SFRSTCR_TERM_CODE = :term)) AND sect.SSBSECT_TERM_CODE = stcr.SFRSTCR_TERM_CODE AND sect.SSBSECT_CRN = stcr.SFRSTCR_CRN AND stcr.SFRSTCR_RSTS_CODE = rsts.STVRSTS_CODE AND ( rsts.STVRSTS_INCL_SECT_ENRL = 'Y' OR 'Y' = :usefinaldateflag ) AND fnpt.SORFNPT_TERM_CODE = sect.SSBSECT_TERM_CODE AND fnpt.SORFNPT_PTRM_CODE = sect.SSBSECT_PTRM_CODE )final_date_tbl; EXEC SQL OPEN cursor_final_date; POSTORA; EXEC SQL FETCH cursor_final_date INTO :final_end_dates:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *final_end_dates='\0'; } EXEC SQL CLOSE cursor_final_date; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0079"," Debug: selfinaldates() Ends. final_end_dates {0} \n"),final_end_dates ); #endif } /* Get title of the report */ static void seltitle(void) { EXEC SQL SELECT LTRIM(RTRIM(GJBJOBS_TITLE,' '),' '), LENGTH(LTRIM(RTRIM(GJBJOBS_TITLE,' '),' ')) INTO :title_var:Ind_01, :title_len:Ind_02 FROM GJBJOBS WHERE GJBJOBS_NAME = UPPER(:rptname); POSTORA; if (NO_ROWS_FOUND) { *title_var = '\0'; } title_pos = ((rptwid/2) + (title_len/2) - termlen); rpt_pos = (rptwid - title_pos - termlen); } static void student_centric_period(void) { *count_reg_terms='\0'; tmstrcpy(scps_reg_all_terms,_TMC("N")); tmstrcpy(check_scpreg_flag,_TMC("N")); if (*scps_code) /*if scps code is not null*/ { tmstrcpy(check_scpreg_flag,_TMC("Y")); fetch_enrl_cycle(FIRST_ROW); fetch_enrl_cycle(CLOSE_CURSOR); countregterms(FIRST_ROW); countregterms(CLOSE_CURSOR); if ( compare(cycle_code,enrl_cycle_code,EQS) )/*if scps cycle code matches with enrollmen record cycle code*/ { if ( compare(count_scp_terms,count_reg_terms,EQS) ) { tmstrcpy(scps_reg_all_terms,_TMC("Y")); /*If registered in all terms of scp then set to Y else to N*/ tmstrcpy(term_to_process,term); /*Use the parm term for processing*/ } else { tmstrcpy(scps_reg_all_terms,_TMC("N")); if ( compare(count_reg_terms,_TMC("1"),EQS)) /*if registered only in one term then check if is registered in first term of scp*/ { fetch_first_reg_scp(FIRST_ROW);/*Check if is registered only in first term of scp and use that term code for processing*/ fetch_first_reg_scp(CLOSE_CURSOR); } else /*if not registerd in first term of scp then use the parm term for processing*/ { tmstrcpy(term_to_process,term); /*Use the parm term for processing*/ } } } else /*if scps cycle code doesnot matches with enrollment record cycle code then process by parm term*/ { tmstrcpy(scps_reg_all_terms,_TMC("N")); if ( compare(count_scp_terms,count_reg_terms,EQS) ) { tmstrcpy(term_to_process,term); /*Use the parm term for processing*/ } else { if ( compare(count_reg_terms,_TMC("1"),EQS)) /*if registered only in one term then check if is registered in first term of scp*/ { fetch_first_reg_scp(FIRST_ROW);/*Check if is registered only in first term of scp and use that term code for processing*/ fetch_first_reg_scp(CLOSE_CURSOR); } else /*if not registerd in first term of scp then use the parm term for processing*/ { tmstrcpy(term_to_process,term); /*Use the parm term for processing*/ } } } } else /*if scps code is null then process by parm term*/ { tmstrcpy(scps_reg_all_terms,_TMC("N")); tmstrcpy(check_scpreg_flag,_TMC("N")); tmstrcpy(term_to_process,term); /*Use the parm term for processing*/ } } static void get_status(void) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0080"," Debug: get status pidm {0} \n"),pidm ); #endif EXEC SQL EXECUTE DECLARE cursor cnt_lcur_c is select COALESCE(count(*),0) from sovlcur a where a.sovlcur_pidm = :pidm and a.sovlcur_lmod_code = sb_curriculum_str.f_learner and a.sovlcur_active_ind = 'Y' and a.sovlcur_current_ind = 'Y' and ( ( a.sovlcur_levl_code not in (select sprcolr_value_atyp from sprcolr where sprcolr_job = 'SFRNSLC' and sprcolr_sessionid = :sessionid and sprcolr_type = 'C')) and (a.sovlcur_levl_code = (select stvlevl_code from stvlevl where stvlevl_code = a.sovlcur_levl_code and stvlevl_ceu_ind = 'N'))); lv_cnt Integer; BEGIN open cnt_lcur_c; fetch cnt_lcur_c into lv_cnt; close cnt_lcur_c; IF lv_cnt > 0 then :prog_active_exist:Ind_01 := 'Y'; ELSE :prog_active_exist:Ind_01 := 'N'; end if; END; END-EXEC; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0081"," Debug: after get status pidm {0} prog_active_exist {1} \n"),pidm,prog_active_exist ); #endif } /* Get session id */ static void getsession(void) { EXEC SQL SELECT USERENV('SESSIONID') INTO :sessionid:Ind_13 FROM DUAL; POSTORA; } /* Delete collector records */ static void delcolr(void) { EXEC SQL DELETE FROM SPRCOLR WHERE SPRCOLR_JOB = :rptname AND SPRCOLR_SESSIONID = :sessionid; POSTORA; } /* Procedural macros */ /* *** Job submission control macro */ /* */ static void retrieve_parms(void) { readterm(FIRST_ROW); readterm(CLOSE_CURSOR); enrollment_period(FIRST_ROW); /* Obtain term start and end date */ enrollment_period(CLOSE_CURSOR); readpopselappl(FIRST_ROW); /* Obtain optional popsel parameters */ readpopselappl(CLOSE_CURSOR); readpopselsel(FIRST_ROW); readpopselsel(CLOSE_CURSOR); readpopselcrID(FIRST_ROW); readpopselcrID(CLOSE_CURSOR); readpopselusID(FIRST_ROW); readpopselusID(CLOSE_CURSOR); readeffwdrldate(FIRST_ROW); readeffwdrldate(CLOSE_CURSOR); readbranchcode(FIRST_ROW); readbranchcode(CLOSE_CURSOR); readcreatereport(FIRST_ROW); readcreatereport(CLOSE_CURSOR); tmstrcpy(term_to_process,term);/*Initialize the term to process with parm term*/ tmstrcpy(check_scpreg_flag,_TMC("N")); readscpprocess(FIRST_ROW); readscpprocess(CLOSE_CURSOR); if ( compare(scp_process,_TMC("Y"),EQS) ) { fetchscp(FIRST_ROW); fetchscp(CLOSE_CURSOR); if (*scps_code) { countscpterms(FIRST_ROW); countscpterms(CLOSE_CURSOR); select_scpterm_dates(FIRST_ROW); select_scpterm_dates(CLOSE_CURSOR); } } /*If parm 25 Process by student period is Y and if GTVSDAX Student centric period is not implemented then, */ /*Process by student period Parm 25 cannot by Y. */ process_scp_settings(); readstudex(FIRST_ROW); /* Insert studnt exclsn critera into table */ if (*studex) inscolrstudex(); while (*studex) { readstudex(NEXT_ROW); /* Insert studnt exclsn critera into table */ if (!*studex) break; inscolrstudex(); } EXEC SQL COMMIT; POSTORA; readstudex(CLOSE_CURSOR); readopeid(FIRST_ROW); readopeid(CLOSE_CURSOR); readcitizenship_flag(FIRST_ROW); readcitizenship_flag(CLOSE_CURSOR); readnationcode(FIRST_ROW); readnationcode(CLOSE_CURSOR); readreport_flag(FIRST_ROW); readreport_flag(CLOSE_CURSOR); readdate(FIRST_ROW); readdate(CLOSE_CURSOR); dateconv(sel_date); readatyp(FIRST_ROW); /* Insert address hierarchy into table */ inscolratyp(); while (1) { readatyp(NEXT_ROW); if (!*atyp_code) break; inscolratyp(); } EXEC SQL COMMIT; POSTORA; readatyp(CLOSE_CURSOR); readrun_mode(FIRST_ROW); readrun_mode(CLOSE_CURSOR); readficecodein(FIRST_ROW); readficecodein(CLOSE_CURSOR); if ( !*fice_code_in ) { sel_fice(FIRST_ROW); /* Check for institution FICE code */ sel_fice(CLOSE_CURSOR); } else { tmstrcpy(fice,fice_code_in); } if ( !tmstrcmp(fice,_TMC("000000"))) { if ( (!tmstrcmp(run_mode,_TMC("2"))) || (!tmstrcmp(run_mode,_TMC("3"))) ) { selinst(FIRST_ROW); /* Select institution name */ selinst(CLOSE_CURSOR); seltitle(); /* Select title of report */ EXEC SQL SELECT TO_CHAR(SYSDATE,'DD-MON-YYYY') INTO :print_sel_date4:Ind_14 FROM DUAL; print_footer(ofile); tmprintf(&tmBundle, TM_NLS_Get("0082","\n***ERROR*** Cannot generate .txt file with FICE Code = 000000.")); tmprintf(&tmBundle, TM_NLS_Get("0083"," Please resubmit with valid FICE Code.\n\n")); exit2os(EXIT_FAILURE); } } read_line_count(); /* this used to be only done for runmode 1 */ if (!tmstrcmp(run_mode,_TMC("1"))) tmstrcpy(create_rpt,_TMC("N")); else { if (*ofile_name2 ) /* .txt file */ { ofile2=tmfopen(&tmBundle, ofile_name2, _TMC("w")); } else { tmstrcpy(ofile_name2,_TMC("sfrnslc.txt")); ofile2=tmfopen(&tmBundle, ofile_name2, _TMC("w")); } } readglvl(FIRST_ROW); /* Insert grad level codes into table */ if (*glvl_code) inscolrglvl(); while (*glvl_code) { readglvl(NEXT_ROW); if (!*glvl_code) break; inscolrglvl(); } EXEC SQL COMMIT; POSTORA; readglvl(CLOSE_CURSOR); /* NSC optional indicator flags starts here*/ readprefemail_flag(FIRST_ROW); readprefemail_flag(CLOSE_CURSOR); readgender_flag(FIRST_ROW); readgender_flag(CLOSE_CURSOR); readrace_flag(FIRST_ROW); readrace_flag(CLOSE_CURSOR); readclasslevel_flag(FIRST_ROW); readclasslevel_flag(CLOSE_CURSOR); readbannerid_flag(FIRST_ROW); readbannerid_flag(CLOSE_CURSOR); readssn_flag(FIRST_ROW); readssn_flag(CLOSE_CURSOR); readactenroldates_flag(FIRST_ROW); readactenroldates_flag(CLOSE_CURSOR); readclvl(FIRST_ROW); if (*clvl_code) inscolrclvl(); while (*clvl_code) { readclvl(NEXT_ROW); if (!*clvl_code) break; inscolrclvl(); } readclvl(CLOSE_CURSOR); EXEC SQL COMMIT; POSTORA; readattr(FIRST_ROW); if (*attr_code) inscolrattr(); while (*attr_code) { readattr(NEXT_ROW); if (!*attr_code) break; inscolrattr(); } readattr(CLOSE_CURSOR); readdetl(FIRST_ROW); if (*detl_code) inscolrdetl(); while (*detl_code) { readdetl(NEXT_ROW); if (!*detl_code) break; inscolrdetl(); } readdetl(CLOSE_CURSOR); tmstrcpy(usefinaldateflag,_TMC("N")); readusefinaldate(FIRST_ROW); readusefinaldate(CLOSE_CURSOR); tmstrcpy(usecurrstartenddatesflag,_TMC("N")); readusecurrstartenddates(FIRST_ROW); readusecurrstartenddates(CLOSE_CURSOR); EXEC SQL COMMIT; POSTORA; EXEC SQL COMMIT; POSTORA; readglvl(CLOSE_CURSOR); EXEC SQL COMMIT; POSTORA; readterm(CLOSE_CURSOR); /* NSC optional indicator flags ends here*/ getdata(); del_parms(); delcolr(); EXEC SQL COMMIT; POSTORA; exit2os(EXIT_SUCCESS); } /* Lock collector table */ static void lockcolr(void) { EXEC SQL LOCK TABLE SPRCOLR IN SHARE UPDATE MODE; POSTORA; } /* Lock National Student Loan Clearinghouse time status control table */ static void locktctl(void) { EXEC SQL LOCK TABLE SFRTCTL IN SHARE UPDATE MODE; POSTORA; } /* Insert address type collector record */ static void inscolratyp(void) { tmstrcpy(atyp_ind,_TMC("Y")); EXEC SQL INSERT INTO SPRCOLR (SPRCOLR_SESSIONID, SPRCOLR_TYPE, SPRCOLR_VALUE_DATE, SPRCOLR_VALUE_ATYP, SPRCOLR_ACTIVITY_DATE, SPRCOLR_JOB, SPRCOLR_PARM_NUMBER) VALUES (:sessionid,'A',TO_DATE(:sel_date,G$_DATE.GET_NLS_DATE_FORMAT), UPPER(:atyp_code),SYSDATE,:rptname,''); POSTORA; } /* Insert graduate level collector record */ static void inscolrglvl(void) { tmstrcpy(glvl_ind,_TMC("Y")); EXEC SQL INSERT INTO SPRCOLR (SPRCOLR_SESSIONID, SPRCOLR_TYPE, SPRCOLR_VALUE_DATE, SPRCOLR_VALUE_ATYP, SPRCOLR_ACTIVITY_DATE, SPRCOLR_JOB, SPRCOLR_PARM_NUMBER) VALUES (:sessionid,'G',TO_DATE(:sel_date,G$_DATE.GET_NLS_DATE_FORMAT), UPPER(:glvl_code),SYSDATE,:rptname,''); POSTORA; } /* Insert continuing education level collector record */ static void inscolrclvl(void) { tmstrcpy(clvl_ind,_TMC("Y")); EXEC SQL INSERT INTO SPRCOLR (SPRCOLR_SESSIONID, SPRCOLR_TYPE, SPRCOLR_VALUE_DATE, SPRCOLR_VALUE_ATYP, SPRCOLR_ACTIVITY_DATE, SPRCOLR_JOB, SPRCOLR_PARM_NUMBER) VALUES (:sessionid,'C',TO_DATE(:sel_date,G$_DATE.GET_NLS_DATE_FORMAT), UPPER(:clvl_code),SYSDATE,:rptname,''); POSTORA; } /* Insert remedial attribute collector record */ static void inscolrattr(void) { tmstrcpy(attr_ind,_TMC("Y")); EXEC SQL INSERT INTO SPRCOLR (SPRCOLR_SESSIONID, SPRCOLR_TYPE, SPRCOLR_VALUE_DATE, SPRCOLR_VALUE_ATYP, SPRCOLR_ACTIVITY_DATE, SPRCOLR_JOB, SPRCOLR_PARM_NUMBER) VALUES (:sessionid,'R',TO_DATE(:sel_date,G$_DATE.GET_NLS_DATE_FORMAT), UPPER(:attr_code),SYSDATE,:rptname,''); POSTORA; } /* Insert detail code collector record */ static void inscolrdetl(void) { tmstrcpy(detl_ind,_TMC("Y")); EXEC SQL INSERT INTO SPRCOLR (SPRCOLR_SESSIONID, SPRCOLR_TYPE, SPRCOLR_VALUE_DATE, SPRCOLR_VALUE_ATYP, SPRCOLR_ACTIVITY_DATE, SPRCOLR_JOB, SPRCOLR_PARM_NUMBER) VALUES (:sessionid,'D',TO_DATE(:sel_date,G$_DATE.GET_NLS_DATE_FORMAT), UPPER(:detl_code),SYSDATE,:rptname,''); POSTORA; } /* Insert STUDENT EXCLUDE CRITERIA collector record */ static void inscolrstudex(void) { tmstrcpy(studex_ind,_TMC("Y")); EXEC SQL INSERT INTO SPRCOLR (SPRCOLR_SESSIONID, SPRCOLR_TYPE, SPRCOLR_VALUE_DATE, SPRCOLR_VALUE_ATYP, SPRCOLR_ACTIVITY_DATE, SPRCOLR_JOB, SPRCOLR_PARM_NUMBER) VALUES (:sessionid,'S',TO_DATE(:sel_date,G$_DATE.GET_NLS_DATE_FORMAT), UPPER(:studex),SYSDATE,:rptname,''); POSTORA; } /* Application related functions */ static void getdata(void) /* process data */ { static TMCHAR *s_name; TMCHAR *edi_translate=_TMC(""); TMCHAR *edi_translate_crdlvl=_TMC(""); TMCHAR *edi_translate_progstat=_TMC(""); TMCHAR num_char[11]={0}; int drop_in_status=0; TMCHAR8 select_statement_c[2000]={0}; int i = 0; /* Macros which need to be executed one time per program execution */ if (!*parm_popsel_appl||!*parm_popsel_sel) { tmstrcpy(use_popsel,_TMC("N")); tmstrcpy(select_statement, SELSTMT1); /* Use term select only */ } else { tmstrcpy(use_popsel,_TMC("Y")); tmstrcpy(select_statement, SELSTMT2); /* Use popsel select */ } tmstrcpy8(select_statement_c, tmtochar8(select_statement)); EXEC SQL PREPARE sql_stmt FROM :select_statement_c; POSTORA; EXEC SQL DECLARE cursor_100 CURSOR FOR sql_stmt; /* Get MAX timestamp for SFRTHST_TMST_DATE = Report Date, so that all Time */ /* Status codes set on Report Date will be reported. Fixed for Defect 84014. */ if ( compare(scp_process,_TMC("Y"),EQS) ) { tmstrcpy(sel_time,time_var); } else { seltime(); if ( !*sel_time ) tmstrcpy(sel_time,time_var); } selinst(FIRST_ROW); /* Select institution name */ selinst(CLOSE_CURSOR); seltitle(); /* Select title of report */ /* Convert the number of lines per page to type int */ EXEC SQL SELECT TO_NUMBER(:linelimit) INTO :numlines:Ind_10 FROM DUAL; /* Convert the entered Report Date to the printing format */ EXEC SQL SELECT TO_CHAR(SYSDATE,G$_DATE.GET_NLS_DATE_FORMAT) INTO :print_sel_date4:Ind_14 FROM DUAL; lineno = 0; pageno = 0; count = 0; if ((!tmstrcmp(run_mode,_TMC("1")))||(!tmstrcmp(create_rpt, _TMC("Y")))) { pageno++; print_heading(ofile); } switch (*run_mode) { case '1': tmstrcpy(pers_type_index, _TMC("0")); tmstrcpy(pers_err_cntr, _TMC("0")); if ( !tmstrcmp(fice,_TMC("000000")) ) { tmfprintf(&tmBundle, ofile,_TMC("{0,%-87s} {1}\n"),_TMC(" "), TM_NLS_Get("0084","--- No Institution FICE Code on SHACTRL ---")); lineno++; count++; chk_for_heading(ofile); } break; case '2': tmstrcpy(pers_type_index, _TMC("0")); tmstrcpy(pers_type_index2, _TMC("0")); tmstrcpy(pers_type_index3, _TMC("0")); tmstrcpy(pers_reported_cntr, _TMC("0")); /* Convert the entered Report Date to the printing format */ EXEC SQL SELECT TO_CHAR(TO_DATE(:sel_date,G$_DATE.GET_NLS_DATE_FORMAT),'YYYYMMDD') INTO :print_sel_date:Ind_15 FROM DUAL; /* Convert the entered Report Date to the printing format */ EXEC SQL SELECT TO_CHAR(SYSDATE,'YYYYMMDD') INTO :print_sel_date2:Ind_16 FROM DUAL; EXEC SQL SELECT TO_CHAR(SYSDATE,'YYMMDD') INTO :print_sel_date5:Ind_17 FROM DUAL; /* Convert the entered Report Date to the printing format */ EXEC SQL SELECT TO_CHAR(SYSDATE,'HH24MI') INTO :print_sel_date3:Ind_18 FROM DUAL; /* Search the CONTROL table for previous records to determine whether previous execution of an EDI report occured; update with new information if an EDI report is run */ control_table(FIRST_ROW); control_table(CLOSE_CURSOR); /* Print ISA statement */ tmfprintf(&tmBundle, ofile2,_TMC("ISA|00| |00| |ZZ|SCT{0,%-6s}{1}0000|ZZ|CLEARINGHOUSE00|{2}|{3}|U|00300|000000000|0|P|:\n"), fice, branch_code, print_sel_date5, print_sel_date3); /* Print GS statement */ tmfprintf(&tmBundle, ofile2, _TMC("GS|SV|SCT{0,%-6s}{1}0000|CLEARINGHOUSE00|{2}|{3}|000000000|X|005010\n"), fice, branch_code, print_sel_date2, print_sel_date3); break; case '3': tmstrcpy(pers_type_index, _TMC("0")); tmstrcpy(pers_reported_cntr, _TMC("0")); /* Convert the entered Report Date to the printing format */ EXEC SQL SELECT TO_CHAR(TO_DATE(:sel_date,G$_DATE.GET_NLS_DATE_FORMAT),'YYYYMMDD') INTO :print_sel_date:Ind_15 FROM DUAL; EXEC SQL SELECT TO_CHAR(SYSDATE,'YYYYMMDD') INTO :print_sel_date2:Ind_16 FROM DUAL; /* Search the CONTROL table for previous records to determine whether previous execution of an EDI report occured; update with new information if an EDI report is run */ /* returns control_rpt_date */ control_table(FIRST_ROW); control_table(CLOSE_CURSOR); break; default: break; } if (!tmstrcmp(use_popsel,_TMC("N"))) /* Open the main select cursor */ { EXEC SQL OPEN cursor_100 USING :term, :sessionid, :scps_code; POSTORA; } else { EXEC SQL OPEN cursor_100 USING :term, :sessionid, :parm_popsel_appl, :parm_popsel_sel, :parm_popsel_crID, :parm_popsel_usID; POSTORA; } fill_status_order(); while (1) { EXEC SQL FETCH cursor_100 INTO :pidm:Ind_01, :student_ssn:Ind_02, :student_name_suffix:Ind_03, :student_confid_ind:Ind_04, :student_fname:Ind_05, :student_lname:Ind_06, :student_mi:Ind_07, :student_id:Ind_08, :student_birth_date:Ind_09, :stud_gender:Ind_11, :stud_ethn_cde:Ind_12, :stud_citz_cde:Ind_13; POSTORA; if (NO_ROWS_FOUND) { *pidm='\0'; *student_ssn='\0'; *student_name_suffix='\0'; *student_confid_ind='\0'; *student_fname='\0'; *student_lname='\0'; *student_mi='\0'; *student_id='\0'; *student_birth_date='\0'; *stud_gender='\0'; *stud_ethn_cde='\0'; *stud_citz_cde='\0'; break; } else { if ( compare(scp_process,_TMC("Y"),EQS) ) { student_centric_period(); } else { tmstrcpy(scps_reg_all_terms,_TMC("N")); tmstrcpy(check_scpreg_flag,_TMC("N")); tmstrcpy(term_to_process,term); /*Use the parm term for processing*/ } initialize_report_variables(); EXEC SQL SELECT TO_CHAR(stvterm_start_date,'YYYYMMDD'), TO_CHAR(stvterm_end_date,'YYYYMMDD') into :withdraw_start_date:Ind_01, :withdraw_end_date:Ind_02 FROM STVTERM WHERE STVTERM_CODE = :term_to_process; POSTORA; tmstrcpy(reported_csts_code,_TMC("NSCREPORT")); *tmst_code = '\0'; *fhl_code = '\0'; *nslc_fhl_code = '\0'; *fhl_date = '\0'; *fhl_tmst_term = '\0'; *student_fullname='\0'; *eb_status_date='\0'; err_scp_tmst_code = 0; err_scp_tmst_code = 0; err_tmst_code = 0; err_nslc_fhl_code = 0; err_scp_tmst_99 = 0; err_tmst_99 = 0; err_no_match = 0; tmstrcpy(student_fullname, student_lname); tmstrcat(student_fullname, _TMC(", ")); tmstrcat(student_fullname, student_fname); tmstrcat(student_fullname, _TMC(" ")); tmstrcat(student_fullname, student_mi); if (*student_name_suffix) { tmstrcat(student_fullname, _TMC(", ")); tmstrcat(student_fullname, student_name_suffix); } tmstrcpy(confid_ind,_TMC("N")); if (*student_confid_ind) tmstrcpy(confid_ind,student_confid_ind); findcpltseqno(); /* return cplt_seqno */ #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0085"," Debug getdata(): after findcplt, pidm {0} cplt_seqno {1} Student ID {2} Full Name {3} \n"),pidm,cplt_seqno,student_id,student_fullname ); #endif find_gap(); get_last_enrollment(); if ((!tmstrcmp(run_mode,_TMC("2")))|| (!tmstrcmp(run_mode,_TMC("3")))) { if (!tmstrcmp(partoftermdateind,_TMC("Y"))) { selstartenddates(term); } } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0086"," Debug getdata(): before get_enr_data(), prog_enr_stat_eff_date {0} fhl_date {1} partofterm_mindate {2} partofterm_maxdate {3}\n"), prog_enr_stat_eff_date,fhl_date,partofterm_mindate,partofterm_maxdate); #endif get_enr_data(); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0087"," Debug getdata(): after get_enr_data(), err_nslc_fhl_code {0,%1d} nslc_nomatch_tmst {1} prog_enr_stat_eff_date {2} \n"), err_nslc_fhl_code,nslc_nomatch_tmst, prog_enr_stat_eff_date); #endif if ( compare(usefinaldateflag,_TMC("Y"),EQS) ) { tmstrcpy(enroll_end_date,enroll_end_date_orig); tmstrcpy(scp_term_end,scp_term_end_orig); selfinaldates(); if (*final_end_dates) { if ( (tmstrcmp(final_end_dates,scp_term_end) > 0) && (*scp_term_end) ) { tmstrcpy(scp_term_end,final_end_dates); } if ( (tmstrcmp(final_end_dates,enroll_end_date) > 0) && (*enroll_end_date) ) { tmstrcpy(enroll_end_date,final_end_dates); } } } /* if ( (!*stud_status) ) { goto next_pidm; } */ if (!tmstrcmp(run_mode,_TMC("1"))) { /* Combine last and first name */ tmstrcat(student_lname, _TMC(", ")); s_name = tmstrcat(student_lname, student_fname); if ((!*student_ssn) || (student_ssn == _TMC(" "))) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2}\n"),student_id,s_name, TM_NLS_Get("0088","--- No SSN on SPAPERS ---")); lineno++; count++; chk_for_heading(ofile); } if (*student_ssn) { if(!validate_ssn(student_ssn)) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2}\n"),student_id,s_name, TM_NLS_Get("0089","--- SSN Not Numeric on SPAPERS ---")); lineno++; count++; chk_for_heading(ofile); } } if ( (!*student_birth_date) || ( student_birth_date == _TMC(" "))) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2}\n"),student_id, s_name, TM_NLS_Get("0090","--- No Birth Date on SPAPERS ---")); lineno++; count++; chk_for_heading(ofile); } if (!tmstrcmp(use_popsel,_TMC("Y")) && found_no_etrm(pidm)) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2}\n"),student_id, s_name, TM_NLS_Get("0091","--- No Term Record on SFBETRM ---")); lineno++; count++; chk_for_heading(ofile); } seladdr(FIRST_ROW); /* Obtain address data */ seladdr(CLOSE_CURSOR); if ( !*pers_atyp_code ) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2}\n"),student_id, s_name, TM_NLS_Get("0092","--- No Address on SPAIDEN ---")); lineno++; count++; chk_for_heading(ofile); } if (*state) { if ( tmstrlen(zip) > 9 ) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,TM_NLS_Get("0093","{0,%9s} {1,%-77s} {2}\n"),student_id, s_name, TM_NLS_Get("0094","--- Zipcode length exceeds 9 characters ---")); lineno++; count++; chk_for_heading(ofile); } if (( tmstrlen(zip) < 5)) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,TM_NLS_Get("0095","{0,%9s} {1,%-77s} {2}\n"),student_id, s_name, TM_NLS_Get("0096","--- Zipcode length is less than 5 characters ---")); lineno++; count++; chk_for_heading(ofile); } } if (*state) { if(*natn_edi_equiv) { if ( (!tmstrcmp(natn_edi_equiv,_TMC("US"))) || (!tmstrcmp(natn_edi_equiv,_TMC("CA"))) ) { if (( tmstrlen(state) > 2)) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,TM_NLS_Get("0097","{0,%9s} {1,%-77s} {2}\n"),student_id, s_name, TM_NLS_Get("0098","--- State code length is greater than 2 characters ---")); lineno++; count++; chk_for_heading(ofile); } } } /* end natn_edi_equiv if */ else { *edi_equiv_nation ='\0'; EXEC SQL SELECT STVNATN_EDI_EQUIV INTO :edi_equiv_nation:Ind_01 FROM STVNATN WHERE STVNATN_CODE = :nation_code; POSTORA; if(*edi_equiv_nation) /* parameter nation code */ { if ( (!tmstrcmp(edi_equiv_nation,_TMC("US"))) || (!tmstrcmp(edi_equiv_nation,_TMC("CA"))) ) { if (( tmstrlen(state) > 2)) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,TM_NLS_Get("0099","{0,%9s} {1,%-77s} {2}\n"),student_id, s_name, TM_NLS_Get("0100","--- State code length is greater than 2 characters ---")); lineno++; count++; chk_for_heading(ofile); } } /*natn if */ } /* not null if */ } /* end else */ } /* end state if */ /* end new code */ /* Obtain the level code from the student curriculum record */ if (err_scp_tmst_code == 1 ) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2}\n"),student_id,s_name, TM_NLS_Get("0101","--- No Time Status on SFASCPR ---")); lineno++; count++; chk_for_heading(ofile); } if(err_tmst_code == 1) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2}\n"),student_id,s_name, TM_NLS_Get("0102","--- No Time Status on SFAREGS ---")); lineno++; count++; chk_for_heading(ofile); } if (err_scp_tmst_99 == 1) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2}\n"),student_id,s_name, TM_NLS_Get("0103","--- Time Status Calc Error on SFASCPR ---")); lineno++; count++; chk_for_heading(ofile); } if (err_tmst_99 ==1) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2}\n"),student_id,s_name, TM_NLS_Get("0104","--- Time Status Calc Error on SFAREGS ---")); lineno++; count++; chk_for_heading(ofile); } if (err_nslc_fhl_code==1 ) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} --- No NSC Equiv for {2} on STVTMST ---\n"),student_id,s_name,nslc_nomatch_tmst); lineno++; count++; chk_for_heading(ofile); } if ( (!tmstrcmp(stud_status,_TMC("F"))) || (!tmstrcmp(stud_status,_TMC("H"))) ||(!tmstrcmp(stud_status,_TMC("A"))) || (!tmstrcmp(stud_status,_TMC("L"))) || (!tmstrcmp(stud_status,_TMC("Q"))) ) { sel_grad_date_fha(); if (!*grad_date_fha) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2}\n"),student_id, s_name, TM_NLS_Get("0105","--- No Expected Grad Date on SGASTDN ---")); lineno++; count++; chk_for_heading(ofile); } else { if (tmstrcmp(grad_date_fha,enroll_end_date) < 0) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2}\n"),student_id,s_name,TM_NLS_Get("0106","--- SGASTDN Grad Date precedes term end ---")); lineno++; count++; chk_for_heading(ofile); } } } else if (!tmstrcmp(stud_status, _TMC("G")) ) /* Status: G */ { if(*stud_grad_term) { if(!*stud_status_date) { sel_grad_date_g(); if (!*grad_date_g) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2}\n"),student_id,s_name, TM_NLS_Get("0107","--- No Graduation Date on SHADEGR ---")); lineno++; count++; chk_for_heading(ofile); } } } else { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2}\n"),student_id,s_name, TM_NLS_Get("0108","--- No Graduation Term on SHADEGR ---")); lineno++; count++; chk_for_heading(ofile); } } if (err_no_match ==1) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2}\n"),student_id,s_name, TM_NLS_Get("0109","--- No Matching Rule found on SFACPLR ---")); lineno++; count++; chk_for_heading(ofile); } fetch_major_data(); if (*err_majr1) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2} {3}\n"),student_id,s_name,TM_NLS_Get("0110","--- No CIP code on Major ---"), err_majr1); lineno++; count++; chk_for_heading(ofile); } if (*err_majr2) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2} {3} \n"),student_id,s_name,TM_NLS_Get("0111","--- No CIP code on Major ---"), err_majr2); lineno++; count++; chk_for_heading(ofile); } for(c = 0; (c < lfos_cnt); c++) { if ( (*arr_missingcipc[c].missingcipc_majr_code) && ( compare(arr_missingcipc[c].missingcipc_majr_code,err_majr1,NES) ) || ( compare(arr_missingcipc[c].missingcipc_majr_code,err_majr2,NES) ) ) { add(pers_err_cntr,pers_err_cntr, _TMC("1")); tmfprintf(&tmBundle, ofile,_TMC("{0,%9s} {1,%-77s} {2} {3} \n"),student_id,s_name,TM_NLS_Get("0112","--- No CIP code on Major ---"),arr_missingcipc[c].missingcipc_majr_code); lineno++; count++; chk_for_heading(ofile); } } add(pers_type_index,pers_type_index, _TMC("1")); } if ((!tmstrcmp(run_mode,_TMC("2")))|| (!tmstrcmp(run_mode,_TMC("3")))) { if (!tmstrcmp(use_popsel,_TMC("Y")) && found_no_etrm(pidm)) {goto next_pidm; } } if (!tmstrcmp(run_mode,_TMC("2"))) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0113"," Debug start of mode 2\n") ); #endif /* Obtain email address*/ if (!tmstrcmp(emailind,_TMC("Y"))) { selprefemail(); } /* Obtain Race*/ if (!tmstrcmp(raceind,_TMC("Y"))) { selrace(); } if (!tmstrcmp(classlvlind,_TMC("Y"))) { selclasslevel(); } else { *stud_classlevel = '\0'; } if (!tmstrcmp(partoftermdateind,_TMC("Y"))) { selstartenddates(term); } else { *partofterm_mindate = '\0'; *partofterm_maxdate = '\0'; } fetch_major_data(); tmstrcpy(pers_type_index2, _TMC("0")); add(pers_type_index,pers_type_index, _TMC("1")); /* Print ST statement */ tmfprintf(&tmBundle, ofile2,_TMC("ST|190|{0}\n"), ltrim(tochar(num_char, pers_type_index, _TMC("000000000")),NULL) ); add(pers_type_index2,pers_type_index2, _TMC("1")); /* Print out BGN records */ tmfprintf(&tmBundle, ofile2,_TMC("BGN|11|{0,%.9s}|{1}|{2}|LT\n"),ltrim(tochar(num_char, pers_type_index, _TMC("000000000")),NULL),print_sel_date2, print_sel_date3); add(pers_type_index2,pers_type_index2, _TMC("1")); edi_translate=_TMC(""); switch(*stud_status) { /* EB1= 'D', EB3='W', EB4= 'G', = 'F', EB7= 'H', EB8='L', EB9='A' , EBO='Q' */ case 'D': edi_translate=_TMC("EB1"); break; case 'W': edi_translate=_TMC("EB3"); break; case 'G': edi_translate=_TMC("EB4"); break; case 'F': edi_translate=_TMC("EB6"); break; case 'Q': edi_translate=_TMC("EBO"); break; case 'H': edi_translate=_TMC("EB7"); break; case 'L': edi_translate=_TMC("EB8"); break; case 'A': edi_translate=_TMC("EB9"); break; default: break; } /* switch */ *date_tmp = '\0'; *grad_date_g = '\0'; EXEC SQL SELECT TO_CHAR(stvterm_start_date,'YYYYMMDD'), TO_CHAR(stvterm_end_date,'YYYYMMDD') into :term_start_date:Ind_01, :term_end_date:Ind_02 FROM STVTERM WHERE STVTERM_CODE = :term_to_process; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0114"," Debug before edi translate 1 of mode 2 {0} end {1}\n") , term_start_date, term_end_date); #endif if ( (tmstrcmp(edi_translate,_TMC("EBO")) == 0) || (tmstrcmp(edi_translate,_TMC("EB1")) == 0) || (tmstrcmp(edi_translate,_TMC("EB3")) == 0) || (tmstrcmp(edi_translate,_TMC("EB4")) == 0) || (tmstrcmp(edi_translate,_TMC("EB6")) == 0) || (tmstrcmp(edi_translate,_TMC("EB7")) == 0) || (tmstrcmp(edi_translate,_TMC("EB8")) == 0) || (tmstrcmp(edi_translate,_TMC("EB9")) == 0) ) { sel_grad_date_fha(); /* this is sgbstdn */ if ( (*grad_date_fha) && (tmstrcmp(term_start_date,grad_date_fha) > 0) ) { (tmstrcpy(grad_date_fha,term_start_date)); } tmstrcpy(date_tmp, grad_date_fha); } /* Print ENR statement */ /* If user didn't enter any GRAD LEVL codes, set reg_levl = 'UN' */ if ( !tmstrcmp(glvl_ind,_TMC("N")) ) tmstrcpy(reg_levl,_TMC("UN")); else if ( check_reg(FIRST_ROW) ) check_reg_levl(); else tmstrcpy(reg_levl,_TMC("UN")); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0115"," Debug: report 2 before edi translate for sel {0} \n"), edi_translate); #endif if ( (tmstrcmp(edi_translate,_TMC("EB6")) == 0) || (tmstrcmp(edi_translate,_TMC("EB7")) == 0) || (tmstrcmp(edi_translate,_TMC("EB8")) == 0) || (tmstrcmp(edi_translate,_TMC("EBO")) == 0) || (tmstrcmp(edi_translate,_TMC("EB9")) == 0) ) { if(*print_sel_date) { tmfprintf(&tmBundle, ofile2,_TMC("ENR|{0}|{1}|D8|{2}||||||{3}|{4}|D8|{5}\n"), edi_translate,reg_levl,date_tmp,confid_ind,report_flag,print_sel_date); } else { tmfprintf(&tmBundle, ofile2,_TMC("ENR|{0}|{1}|D8|{2}||||||{3}|{4}|D8\n"), edi_translate,reg_levl,date_tmp,confid_ind,report_flag); } } else { if(*print_sel_date) { tmfprintf(&tmBundle, ofile2,_TMC("ENR|{0}|{1}||||||||{2}|{3}|D8|{4}\n"), edi_translate,reg_levl,confid_ind,report_flag,print_sel_date); } else { tmfprintf(&tmBundle, ofile2,_TMC("ENR|{0}|{1}||||||||{2}|{3}|D8\n"), edi_translate,reg_levl,confid_ind,report_flag); } } add(pers_type_index2,pers_type_index2, _TMC("1")); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0116"," Debug: report 2, edi translate x {0} \n"), edi_translate); #endif if ( (tmstrcmp(edi_translate,_TMC("EBO")) == 0) || (tmstrcmp(edi_translate,_TMC("EB6")) == 0) || (tmstrcmp(edi_translate,_TMC("EB7")) == 0) || (tmstrcmp(edi_translate,_TMC("EB8")) == 0)) { if (*control_rpt_date) { drop_in_status = 0; tmstrcpy(date_type,_TMC("C")); tmstrcpy(use_date, control_rpt_date); tmstrcpy(use_time, control_rpt_time); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0117"," Debug: report 2, sel fulltime1 use date {0} \n"), use_date); #endif sel_last_full_half_status(FIRST_ROW); /* 1st full/half code */ sel_last_full_half_status(CLOSE_CURSOR); tmstrcpy(old_nslc_fhl_code, nslc_fhl_code); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0118"," Debug after sel_last_full_half_status: pidm {0} old nslc fhl {1} nslc fhl {2}\n"), pidm,old_nslc_fhl_code,nslc_fhl_code); #endif tmstrcpy(date_type,_TMC("S")); tmstrcpy(use_date, sel_date); tmstrcpy(use_time, sel_time); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0119"," Debug: report 2, sel fulltime2 use date {0} \n"), use_date); #endif sel_full_half_status(); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0120"," Debug after sel_full_half_status: pidm {0} old nslc fhl {1} nslc fhl {2}\n"), pidm,old_nslc_fhl_code,nslc_fhl_code); #endif /* Determine if Student has dropped to a lower status */ #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0121"," Debug: report 2, old nslc fhl code {0} new nslc fhl code {1} \n"), old_nslc_fhl_code, nslc_fhl_code); #endif if ((!tmstrcmp(old_nslc_fhl_code,_TMC("F")))&& (!tmstrcmp(nslc_fhl_code,_TMC("H")))) { drop_in_status = 1; } else if ((!tmstrcmp(old_nslc_fhl_code,_TMC("F")))&& (!tmstrcmp(nslc_fhl_code,_TMC("Q")))) { drop_in_status = 1; } else if ((!tmstrcmp(old_nslc_fhl_code,_TMC("Q")))&& (!tmstrcmp(nslc_fhl_code,_TMC("L")))) { drop_in_status = 1; } else if ((!tmstrcmp(old_nslc_fhl_code,_TMC("Q")))&& (!tmstrcmp(nslc_fhl_code,_TMC("H")))) { drop_in_status = 1; } else if ((!tmstrcmp(old_nslc_fhl_code,_TMC("H")))&& (!tmstrcmp(nslc_fhl_code,_TMC("L")))) { drop_in_status = 1; } else if ((!tmstrcmp(old_nslc_fhl_code,_TMC("F")))&& (!tmstrcmp(nslc_fhl_code,_TMC("L")))) { drop_in_status = 1; } } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0122"," Debug: report 2, old nslc {0} new {1} drop in status {2,%1d} \n"), old_nslc_fhl_code, nslc_fhl_code, drop_in_status); #endif } /* Print DTP statement */ if (!tmstrcmp(partoftermdateind,_TMC("Y"))) /*report part of term dates if selected or else display enroll start and end date */ { *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,partofterm_mindate); if(*partofterm_maxdate) { tmstrcat(temp_str,_TMC("-")); tmstrcat(temp_str,partofterm_maxdate); } rtrim(temp_str,_TMC("|")); tmfprintf(&tmBundle, ofile2,_TMC("DTP|382|RD8{0}\n"),temp_str); add(pers_type_index2,pers_type_index2, _TMC("1")); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0123"," Debug: getdata(): Printing DTP statement. Place 1: partofterm_mindate {0} partofterm_maxdate {1}\n"), partofterm_mindate,partofterm_maxdate); #endif } else { if (( compare(scp_process,_TMC("Y"),EQS) ) && ( compare(cycle_code,enrl_cycle_code,EQS) )) { *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,scp_term_start); if(*scp_term_end) { tmstrcat(temp_str,_TMC("-")); tmstrcat(temp_str,scp_term_end); } rtrim(temp_str,_TMC("|")); tmfprintf(&tmBundle, ofile2,_TMC("DTP|382|RD8{0}\n"),temp_str); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0124"," Debug: getdata(): Printing DTP statement. Place 2: scp_term_start {0} scp_term_end {1}\n"), scp_term_start,scp_term_end); #endif } else { *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,enroll_start_date); if(*enroll_end_date) { tmstrcat(temp_str,_TMC("-")); tmstrcat(temp_str,enroll_end_date); } rtrim(temp_str,_TMC("|")); tmfprintf(&tmBundle, ofile2,_TMC("DTP|382|RD8|{0}-{1}\n"),enroll_start_date,enroll_end_date); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0125"," Debug: getdata(): Printing DTP statement. Place 3: enroll_start_date {0} enroll_end_date {1}\n"), enroll_start_date,enroll_end_date); #endif } add(pers_type_index2,pers_type_index2, _TMC("1")); } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0126"," Debug getdata(): check fhl date, pidm {0} fhl_date {1}\n"),pidm,fhl_date); #endif /* Replacing the fhl date i.e. Program Status effectie Date if its lesser then the Start Date being Reported for DTP|382|.... line */ /* that is partoftermdateind */ /* if ( (!tmstrcmp(partoftermdateind,_TMC("Y"))) && (tmstrcmp(fhl_date,partoftermdateind) < 0) ) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0126"," Debug getdata(): Copying partofterm_mindate {0} to the fhl date {1}, because its lesser then the Start Date being Reported for DTP|382|.... line \n"),partofterm_mindate, fhl_date); #endif tmstrcpy(fhl_date,partofterm_mindate); tmstrcpy(prog_enr_stat_eff_date,fhl_date); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0127"," Debug getdata(): New fhl date {0} New prog_enr_stat_eff_date {1} \n"),fhl_date, prog_enr_stat_eff_date); #endif } */ if ( (*fhl_date) && (tmstrcmp(term_start_date,fhl_date) > 0) ) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0127"," Debug getdata(): report 2, copy term start {0} to fhl date {1} \n"), term_start_date, fhl_date); #endif tmstrcpy(fhl_date, term_start_date); } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0128"," Debug: report 2, stud_status {0} \n"),stud_status); #endif if (!tmstrcmp(stud_status,_TMC("A"))) { drop_in_status = 0; } if (!tmstrcmp(stud_status,_TMC("D"))) { drop_in_status = 0; } if (!tmstrcmp(stud_status,_TMC("W"))) { drop_in_status = 0; } if (!tmstrcmp(stud_status,_TMC("G"))) { drop_in_status = 0; } #ifdef SCT_DEBUG printf( " Debug: report 2, check at drop in status for dtp %i \n" , drop_in_status); #endif if (drop_in_status == 1) /* print 2nd rec if drop in status */ { tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8|{0}\n"), fhl_date); tmstrcpy(eb_status_date,fhl_date); add(pers_type_index2,pers_type_index2, _TMC("1")); } else { switch(*stud_status) { case 'A': #ifdef SCT_DEBUG printf( " Debug: report 2, leave pidm {0} leave date {1} scp start {2} term start {3} \n" , pidm,leave_date,scp_term_start,term_start_date); #endif tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8|{0}\n"), leave_date); tmstrcpy(eb_status_date,leave_date); add(pers_type_index2,pers_type_index2, _TMC("1")); break; case 'D': if (*dead_date) { tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8|{0}\n"), dead_date); tmstrcpy(eb_status_date,dead_date); } else { if (( compare(scp_process,_TMC("Y"),EQS) ) && ( compare(cycle_code,enrl_cycle_code,EQS) )) { if(*scp_term_start) { tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8|{0}\n"), scp_term_start); tmstrcpy(eb_status_date,scp_term_start); } else { tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8\n")); tmstrcpy(eb_status_date,scp_term_start); } } else { if(*enroll_start_date) { tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8|{0}\n"), enroll_start_date); tmstrcpy(eb_status_date,enroll_start_date); } else { tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8\n")); tmstrcpy(eb_status_date,enroll_start_date); } } } add(pers_type_index2,pers_type_index2, _TMC("1")); break; case 'W': /*8.10.7.1 if ( (*withdraw_date) && (( compare(scp_process,_TMC("Y"),EQS) ) && ( compare(cycle_code,enrl_cycle_code,EQS) ) && (tmstrcmp(scp_term_start,withdraw_date) > 0) ) ) { (tmstrcpy(withdraw_date,scp_term_start)); } else { if ( (*withdraw_date) && ( compare(scp_process,_TMC("N"),EQS) ) && (tmstrcmp(term_start_date,withdraw_date) > 0) ) { (tmstrcpy(withdraw_date,term_start_date)); } }*/ tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8|{0}\n"), withdraw_date); tmstrcpy(eb_status_date,withdraw_date); add(pers_type_index2,pers_type_index2, _TMC("1")); break; case 'G': sel_grad_date_g(); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0129"," Debug report mode 2 after sel_grad_date_g: pidm {0} grad_date_g {1}\n"),pidm,grad_date_g); #endif if (!*grad_date_g) { tmstrcpy(grad_date_g,term_end_date); } /*8.14.1 if ( (*grad_date_g) && (tmstrcmp(term_end_date,grad_date_g) < 0) ) { (tmstrcpy(grad_date_g,term_end_date)); } */ if (*grad_date_g) { tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8|{0}\n"), grad_date_g); tmstrcpy(eb_status_date,grad_date_g); add(pers_type_index2,pers_type_index2, _TMC("1")); } break; default: break; } /* switch */ } /*Print SUM Information */ get_status(); chk_withdrawl_degree_seek_exists(); /*8.13*/ #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0130"," Debug report mode 2 after get pgm status: pgm active {0} major cipc {1} majr 2 cipc {2}\n"),prog_active_exist,stud_majr1_cipc,stud_majr2_cipc); #endif *remedial_attr_flag ='\0'; tmstrcpy(remedial_attr_flag,_TMC("")); *detl_flag ='\0'; tmstrcpy(detl_flag,_TMC("")); EXEC SQL EXECUTE DECLARE pkg_attr_flag varchar2(1); pkg_detail_flag varchar2(1); BEGIN if :scp_process = 'Y' then if :cycle_code = :enrl_cycle_code then pkg_attr_flag := sfkenrl.f_find_attribute (:pidm,:term_to_process,:scps_code,:rptname,:sessionid); else pkg_attr_flag := sfkenrl.f_find_attribute (:pidm,:term_to_process,'',:rptname,:sessionid); end if; else pkg_attr_flag := sfkenrl.f_find_attribute (:pidm,:term_to_process,'',:rptname,:sessionid); end if; if pkg_attr_flag = 'R' then :remedial_attr_flag:Ind_05 := pkg_attr_flag; else :remedial_attr_flag:Ind_05 := ''; end if; if :detl_ind = 'Y' then if :scp_process = 'Y' then if :cycle_code = :enrl_cycle_code then pkg_detail_flag := sfkenrl.f_find_pell (:pidm,:term_to_process,:scps_code,:rptname,:sessionid); :detl_flag:Ind_06 := pkg_detail_flag; else pkg_detail_flag := sfkenrl.f_find_pell (:pidm,:term_to_process,'',:rptname,:sessionid); :detl_flag:Ind_06 := pkg_detail_flag; end if; else pkg_detail_flag := sfkenrl.f_find_pell (:pidm,:term_to_process,'',:rptname,:sessionid); :detl_flag:Ind_06 := pkg_detail_flag; end if; else :detl_flag:Ind_06 := NULL; end if; END; END-EXEC; POSTORA; if (!tmstrcmp(prog_active_exist,_TMC("Y")) && ( (*stud_majr1_cipc) || (*stud_majr2_cipc) ) ) { if (!tmstrcmp(detl_ind,_TMC("Y")) ) { tmfprintf(&tmBundle, ofile2,_TMC("SUM||{0}|{1}|||||||{2}\n"), remedial_attr_flag, prog_active_exist,detl_flag); } else { tmfprintf(&tmBundle, ofile2,_TMC("SUM||{0}|{1}\n"), remedial_attr_flag, prog_active_exist); } add(pers_type_index2,pers_type_index2, _TMC("1")); } else { if(!tmstrcmp(degree_seek_withdr_exist,_TMC("Y"))) { tmstrcpy(prog_active_exist,_TMC("Y")); } else { tmstrcpy(prog_active_exist,_TMC("N")); } if (!tmstrcmp(detl_ind,_TMC("Y")) ) { tmfprintf(&tmBundle, ofile2,_TMC("SUM||{0}|{1}|||||||{2}\n"), remedial_attr_flag, prog_active_exist,detl_flag); } else { tmfprintf(&tmBundle, ofile2,_TMC("SUM||{0}|{1}\n"), remedial_attr_flag, prog_active_exist); } add(pers_type_index2,pers_type_index2, _TMC("1")); } /*Print N1 Information */ tmfprintf(&tmBundle, ofile2,_TMC("N1|ZZ|SB\n")); add(pers_type_index2,pers_type_index2, _TMC("1")); /*Print PER EM Email Address */ if (!tmstrcmp(emailind,_TMC("Y"))) { if (*stud_prefemail) { tmfprintf(&tmBundle, ofile2,_TMC("PER|SB||EM|{0}\n"), stud_prefemail); add(pers_type_index2,pers_type_index2, _TMC("1")); } } /* Print ENT 01 statement */ if (!tmstrcmp(ssnind,_TMC("Y"))) { if(*student_ssn) { tmfprintf(&tmBundle, ofile2,_TMC("ENT|01|S2|34|{0}\n"), student_ssn); add(pers_type_index2,pers_type_index2, _TMC("1")); } else { tmfprintf(&tmBundle, ofile2,_TMC("ENT|01|S2|34|NO SSN\n")); add(pers_type_index2,pers_type_index2, _TMC("1")); } } else { if(*student_id) { tmfprintf(&tmBundle, ofile2,_TMC("ENT|03|S2|93|{0}\n"),student_id); add(pers_type_index2,pers_type_index2, _TMC("1")); } else { tmfprintf(&tmBundle, ofile2,_TMC("ENT|03|S2|93\n")); add(pers_type_index2,pers_type_index2, _TMC("1")); } } /* Print IN2 statement */ if(*student_fname) { tmfprintf(&tmBundle, ofile2,_TMC("IN2|02|{0}\n"), student_fname); add(pers_type_index2,pers_type_index2, _TMC("1")); } else { tmfprintf(&tmBundle, ofile2,_TMC("IN2|02\n")); add(pers_type_index2,pers_type_index2, _TMC("1")); } if (*student_mi) { tmfprintf(&tmBundle, ofile2,_TMC("IN2|03|{0,%.35s}\n"), student_mi);/*display middle name*/ add(pers_type_index2,pers_type_index2, _TMC("1")); } if(*student_lname) { tmfprintf(&tmBundle, ofile2,_TMC("IN2|05|{0,%.35s}\n"), student_lname); add(pers_type_index2,pers_type_index2, _TMC("1")); } else { tmfprintf(&tmBundle, ofile2,_TMC("IN2|05\n")); add(pers_type_index2,pers_type_index2, _TMC("1")); } if (*student_name_suffix) { tmfprintf(&tmBundle, ofile2,_TMC("IN2|09|{0,%1s}\n"), student_name_suffix); add(pers_type_index2,pers_type_index2, _TMC("1")); } if ( !*genderind ) { *stud_gender = '\0'; } if ( !*raceind ) { *stud_race = '\0'; } if ( !*citizenship_ind ) { *stud_citz_cde = '\0'; } else { EXEC SQL SELECT STVCITZ_EDI_EQUIV INTO :edi_equiv_citz:Ind_01 FROM STVCITZ WHERE STVCITZ_CODE = :stud_citz_cde; POSTORA; if (NO_ROWS_FOUND) { *edi_equiv_citz = '\0'; } } /* Print DMG statement */ *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,stud_gender); tmstrcat(temp_str,_TMC("||")); tmstrcat(temp_str,stud_race); tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,edi_equiv_citz); rtrim(temp_str,_TMC("|")); if (*student_birth_date) { tmfprintf(&tmBundle, ofile2,_TMC("DMG|D8|{0}{1}\n"), student_birth_date,temp_str); add(pers_type_index2,pers_type_index2, _TMC("1")); } else { if ((*stud_citz_cde)||(*stud_gender)||(*stud_race)) { tmfprintf(&tmBundle, ofile2,_TMC("DMG||{0}\n"), temp_str); add(pers_type_index2,pers_type_index2, _TMC("1")); } } /* Print N3 statement */ seladdr(FIRST_ROW); if (*temp_street_line1) { tmfprintf(&tmBundle, ofile2,_TMC("N3|{0}"), temp_street_line1); add(pers_type_index2,pers_type_index2, _TMC("1")); tmfprintf(&tmBundle, ofile2,_TMC("\n")); } else { if (*pers_atyp_code) { if (*street_line1) { tmfprintf(&tmBundle, ofile2,_TMC("N3|{0}"), street_line1); add(pers_type_index2,pers_type_index2, _TMC("1")); if (*street_line2) tmfprintf(&tmBundle, ofile2,_TMC("|{0}"), street_line2); tmfprintf(&tmBundle, ofile2,_TMC("\n")); } else if (*street_line2) { tmfprintf(&tmBundle, ofile2,_TMC("N3|{0}"), street_line2); add(pers_type_index2,pers_type_index2, _TMC("1")); tmfprintf(&tmBundle, ofile2,_TMC("\n")); } if(!*state) { tmstrcpy(state,_TMC("FO")); } if(*natn_edi_equiv) { if ( (!tmstrcmp(natn_edi_equiv,_TMC("US"))) || (!tmstrcmp(natn_edi_equiv,_TMC("CA"))) ) { tmfprintf(&tmBundle, ofile2,_TMC("N4|{0}|{1}|{2}|{3}\n"), rtrim(city_var,_TMC(",")),state,zip,natn_edi_equiv); add(pers_type_index2,pers_type_index2, _TMC("1")); } else { tmstrcpy(state,_TMC("FO")); tmfprintf(&tmBundle, ofile2,_TMC("N4|{0}|{1}|{2}|{3}\n"), rtrim(city_var,_TMC(",")),state,zip,natn_edi_equiv); add(pers_type_index2,pers_type_index2, _TMC("1")); } } else /* no edi equiv for spraddr nation */ { *edi_equiv_nation ='\0'; EXEC SQL SELECT STVNATN_EDI_EQUIV INTO :edi_equiv_nation:Ind_01 FROM STVNATN WHERE STVNATN_CODE = :nation_code; POSTORA; if(*edi_equiv_nation) /* parameter nation code */ { if ( (!tmstrcmp(edi_equiv_nation,_TMC("US"))) || (!tmstrcmp(edi_equiv_nation,_TMC("CA"))) ) { tmfprintf(&tmBundle, ofile2,_TMC("N4|{0}|{1}|{2}|{3}\n"), rtrim(city_var,_TMC(",")),state,zip,edi_equiv_nation); } else { tmstrcpy(state,_TMC("FO")); tmfprintf(&tmBundle, ofile2,_TMC("N4|{0}|{1}|{2}|{3}\n"), rtrim(city_var,_TMC(",")),state,zip,edi_equiv_nation); } } else /* no edi equiv for parameter nation */ { if(*zip) { tmfprintf(&tmBundle, ofile2,_TMC("N4|{0}|{1}|{2}\n"), rtrim(city_var,_TMC(",")),state,zip); } else { tmfprintf(&tmBundle, ofile2,_TMC("N4|{0}|{1}\n"), rtrim(city_var,_TMC(",")),state); } } add(pers_type_index2,pers_type_index2, _TMC("1")); } } } /* end of check for UK */ /* Print ENT 02 statement */ if(*(rtrim(term_desc,NULL))) { tmfprintf(&tmBundle, ofile2,_TMC("ENT|02|M8|DS|{0}{1}||||U2|{2}\n"), fice, branch_code,rtrim(term_desc,NULL) ); } else { tmfprintf(&tmBundle, ofile2,_TMC("ENT|02|M8|DS|{0}{1}||||U2\n"), fice, branch_code); } add(pers_type_index2,pers_type_index2, _TMC("1")); if (!tmstrcmp(ssnind,_TMC("Y"))) { if (!tmstrcmp(banneridind,_TMC("Y"))) { if (*student_id) { tmfprintf(&tmBundle, ofile2,_TMC("ENT|03|S2|93|{0}\n"),student_id); add(pers_type_index2,pers_type_index2, _TMC("1")); } } } /* Print ENT 05 statement */ if (*opeid) /*8.14.1*/ { tmfprintf(&tmBundle, ofile2,_TMC("ENT|05|M8|DS|{0}\n"),opeid); add(pers_type_index2,pers_type_index2, _TMC("1")); } /* Print SES Information */ edi_translate_crdlvl =_TMC(""); if (!tmstrcmp(stud_credential_level, _TMC("01")) ) edi_translate_crdlvl =_TMC("UG"); if (!tmstrcmp(stud_credential_level, _TMC("02")) ) edi_translate_crdlvl=_TMC("AS"); if (!tmstrcmp(stud_credential_level, _TMC("03")) ) edi_translate_crdlvl=_TMC("BD"); if (!tmstrcmp(stud_credential_level, _TMC("04")) ) edi_translate_crdlvl=_TMC("25"); if (!tmstrcmp(stud_credential_level, _TMC("05")) ) edi_translate_crdlvl=_TMC("MD"); if (!tmstrcmp(stud_credential_level, _TMC("06")) ) edi_translate_crdlvl=_TMC("DD"); if (!tmstrcmp(stud_credential_level, _TMC("07")) ) edi_translate_crdlvl=_TMC("FP"); if (!tmstrcmp(stud_credential_level, _TMC("08")) ) edi_translate_crdlvl=_TMC("GR"); if (!tmstrcmp(stud_credential_level, _TMC("99")) ) edi_translate_crdlvl=_TMC("PC"); if (!tmstrcmp(classlvlind,_TMC("Y"))) { *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,term_yearmm); tmstrcat(temp_str,_TMC("|||||||||")); tmstrcat(temp_str,stud_classlevel); rtrim(temp_str,_TMC("|")); } if (!tmstrcmp(classlvlind,_TMC("Y"))) { tmfprintf(&tmBundle, ofile2,_TMC("SES{0}\n"),temp_str); add(pers_type_index2,pers_type_index2, _TMC("1")); } else { tmfprintf(&tmBundle, ofile2,_TMC("SES|{0}\n"),term_yearmm); add(pers_type_index2,pers_type_index2, _TMC("1")); } if ( (lcur_cnt == ceu_cnt) && ( ceu_cnt > 0 ) ) { goto skip_major_reporting; } if (!tmstrcmp(prog_active_exist,_TMC("N")) ) { goto skip_major_reporting; } /*Print FOS information for student major's */ if(*stud_majr1_cipc) { *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,stud_majr1_cipc); tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,stud_majr1); rtrim(temp_str,_TMC("|")); tmfprintf(&tmBundle, ofile2,_TMC("FOS|M|81{0}\n"),temp_str); add(pers_type_index2,pers_type_index2, _TMC("1")); } if(*stud_majr2_cipc) { *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,stud_majr2_cipc); tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,stud_majr2); rtrim(temp_str,_TMC("|")); tmfprintf(&tmBundle, ofile2,_TMC("FOS|M|81{0}\n"),temp_str); add(pers_type_index2,pers_type_index2, _TMC("1")); } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0131"," Debug report mode 2 lfos loop starts lfos_cnt {0,%1d}\n"), lfos_cnt); #endif for(i = 0; ((i < lfos_cnt) && (i < 6)); i++) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0132"," Debug report mode 2 lfos loop value of i {0,%1d} prog ceu ind {1}\n"), i,arr_enrdata[i].prog_ceu_ind); #endif if (!tmstrcmp(arr_enrdata[i].prog_ceu_ind, _TMC("N")) ) { if (!tmstrcmp(arr_enrdata[i].prog_nondgr_ind, _TMC("N")) ) { edi_translate_crdlvl =_TMC(""); edi_translate_progstat =_TMC(""); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("01")) ) edi_translate_crdlvl =_TMC("UG"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("02")) ) edi_translate_crdlvl=_TMC("AS"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("03")) ) edi_translate_crdlvl=_TMC("BD"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("04")) ) edi_translate_crdlvl=_TMC("25"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("05")) ) edi_translate_crdlvl=_TMC("MD"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("06")) ) edi_translate_crdlvl=_TMC("DD"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("07")) ) edi_translate_crdlvl=_TMC("FP"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("08")) ) edi_translate_crdlvl=_TMC("GR"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("99")) ) edi_translate_crdlvl=_TMC("PC"); if(*edi_translate_crdlvl) { tmfprintf(&tmBundle, ofile2,_TMC("SES|{0}|||||||||{1}\n"),print_sel_date2, edi_translate_crdlvl); } else { tmfprintf(&tmBundle, ofile2,_TMC("SES|{0}\n"),print_sel_date2); } add(pers_type_index2,pers_type_index2, _TMC("1")); /* Print New ENR Information */ switch(*arr_enrdata[i].prog_status) { /* EB1= 'D', EB3='W', EB4= 'G', EB6= 'F', EB7= 'H', EB8='L', EB9='A' */ case 'D': edi_translate_progstat=_TMC("EB1"); break; case 'W': edi_translate_progstat=_TMC("EB3"); break; case 'G': edi_translate_progstat=_TMC("EB4"); break; case 'F': edi_translate_progstat=_TMC("EB6"); break; case 'Q': edi_translate_progstat=_TMC("EBO"); break; case 'H': edi_translate_progstat=_TMC("EB7"); break; case 'L': edi_translate_progstat=_TMC("EB8"); break; case 'A': edi_translate_progstat=_TMC("EB9"); break; default: break; } /* switch */ if (!tmstrcmp(arr_enrdata[i].prog_status,_TMC("D"))) { goto skip_copy; } if (!tmstrcmp(arr_enrdata[i].prog_status,_TMC("W"))) { goto skip_copy; } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0133"," Debug report mode 2: major {0} copy to enrl psed date {1} end start date {2} status {3}\n"), arr_enrdata[i].prog_majr_code, arr_enrdata[i].prog_enr_stat_eff_date,arr_enrdata[i].end_start_date,arr_enrdata[i].prog_status); #endif if (*arr_enrdata[i].end_start_date) { tmstrcpy(arr_enrdata[i].prog_enr_stat_eff_date, arr_enrdata[i].end_start_date); } skip_copy: if ((tmstrcmp(arr_enrdata[i].prog_status,_TMC("D"))) && (tmstrcmp(arr_enrdata[i].prog_begin_date,arr_enrdata[i].prog_enr_stat_eff_date) > 0) ) { savei = i; check_start_date(); } if(*arr_enrdata[i].prog_enr_stat_eff_date) { tmfprintf(&tmBundle, ofile2,_TMC("ENR|{0}||D8|{1}||||||||D8|{2}\n"),edi_translate_progstat,arr_enrdata[i].prog_begin_date,arr_enrdata[i].prog_enr_stat_eff_date); } else { tmfprintf(&tmBundle, ofile2,_TMC("ENR|{0}||D8|{1}||||||||D8\n"),edi_translate_progstat,arr_enrdata[i].prog_begin_date); } add(pers_type_index2,pers_type_index2, _TMC("1")); *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,arr_enrdata[i].stud_majr1_cipc); tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,arr_enrdata[i].prog_cipc_pub_year); tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,arr_enrdata[i].prog_length_type); tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,arr_enrdata[i].prog_length); tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,arr_enrdata[i].prog_weeks_yr); rtrim(temp_str,_TMC("|")); tmfprintf(&tmBundle, ofile2,_TMC("FOS|P|81{0}\n"),temp_str); add(pers_type_index2,pers_type_index2, _TMC("1")); if(*arr_enrdata[i].special_prog_ind) { tmfprintf(&tmBundle, ofile2,_TMC("NTE||{0}\n"),arr_enrdata[i].special_prog_ind); add(pers_type_index2,pers_type_index2, _TMC("1")); } else { tmfprintf(&tmBundle, ofile2,_TMC("NTE||N\n")); add(pers_type_index2,pers_type_index2, _TMC("1")); } } /* end nondgr if */ } /* end ceu if */ } /* end for loop */ create_reported_majors(); skip_major_reporting: /*add(pers_type_index2,pers_type_index2, _TMC("8")); /*Count sgmts per stdt */ add(pers_type_index2,pers_type_index2, _TMC("1")); /* Print SE statement */ tmfprintf(&tmBundle, ofile2, _TMC("SE|{0,number,integer}|{1}\n"), tmatoi(pers_type_index2), ltrim(tochar(num_char, pers_type_index, _TMC("000000000")),NULL) ); /*add(pers_type_index,pers_type_index, _TMC("1")); /* Count number of studt*/ add(pers_type_index3,pers_type_index3, pers_type_index2); /*Count total sgmts */ } if (!tmstrcmp(run_mode,_TMC("3"))) { /*Obtain email address*/ if (!tmstrcmp(emailind,_TMC("Y"))) { selprefemail(); } /*Obtain Race*/ if (!tmstrcmp(raceind,_TMC("Y"))) { selrace(); } if (!tmstrcmp(classlvlind,_TMC("Y"))) { selclasslevel(); } else { *stud_classlevel = '\0'; } if (!tmstrcmp(partoftermdateind,_TMC("Y"))) { selstartenddates(term); } else { *partofterm_mindate = '\0'; *partofterm_maxdate = '\0'; } fetch_major_data(); drop_in_status = 0; /* Print out EDI records */ tmfprintf(&tmBundle, ofile2,_TMC("BGN\n")); edi_translate=_TMC(""); switch(*stud_status) { /* EB1= 'D', EB3='W', EB4= 'G', EB6= 'F', EB7= 'H', EB8='L', EB9='A' , EBO='Q' */ case 'D': edi_translate=_TMC("EB1"); break; case 'W': edi_translate=_TMC("EB3"); break; case 'G': edi_translate=_TMC("EB4"); break; case 'F': edi_translate=_TMC("EB6"); break; case 'Q': edi_translate=_TMC("EBO"); break; case 'H': edi_translate=_TMC("EB7"); break; case 'L': edi_translate=_TMC("EB8"); break; case 'A': edi_translate=_TMC("EB9"); break; default: break; } /* switch */ *date_tmp = '\0'; *grad_date_g = '\0'; EXEC SQL SELECT TO_CHAR(stvterm_start_date,'YYYYMMDD'), TO_CHAR(stvterm_end_date,'YYYYMMDD') into :term_start_date:Ind_01, :term_end_date:Ind_02 FROM STVTERM WHERE STVTERM_CODE = :term_to_process; POSTORA; if ( (tmstrcmp(edi_translate,_TMC("EBO")) == 0) || (tmstrcmp(edi_translate,_TMC("EB6")) == 0) || (tmstrcmp(edi_translate,_TMC("EB7")) == 0) || (tmstrcmp(edi_translate,_TMC("EB8")) == 0) || (tmstrcmp(edi_translate,_TMC("EB9")) == 0) ) { sel_grad_date_fha(); if ( (*grad_date_fha) && (tmstrcmp(term_start_date,grad_date_fha) > 0) ) { (tmstrcpy(grad_date_fha,term_start_date)); } tmstrcpy(date_tmp, grad_date_fha); } /* Print ENR statement */ /* If user didn't enter any GRAD LEVL codes, set reg_levl = 'UN' */ if ( !tmstrcmp(glvl_ind,_TMC("N")) ) tmstrcpy(reg_levl,_TMC("UN")); else if ( check_reg(FIRST_ROW) ) check_reg_levl(); else tmstrcpy(reg_levl,_TMC("UN")); if ( (tmstrcmp(edi_translate,_TMC("EB6")) == 0) || (tmstrcmp(edi_translate,_TMC("EB7")) == 0) || (tmstrcmp(edi_translate,_TMC("EB8")) == 0) || (tmstrcmp(edi_translate,_TMC("EBO")) == 0) || (tmstrcmp(edi_translate,_TMC("EB9")) == 0) ) { if(*print_sel_date) { tmfprintf(&tmBundle, ofile2,_TMC("ENR|{0}|{1}|D8|{2}||||||{3}|{4}|D8|{5}\n"), edi_translate,reg_levl,date_tmp,confid_ind,report_flag,print_sel_date); } else { tmfprintf(&tmBundle, ofile2,_TMC("ENR|{0}|{1}|D8|{2}||||||{3}|{4}|D8\n"), edi_translate,reg_levl,date_tmp,confid_ind,report_flag); } } else { if(*print_sel_date) { tmfprintf(&tmBundle, ofile2,_TMC("ENR|{0}|{1}||||||||{2}|{3}|D8|{4}\n"), edi_translate,reg_levl,confid_ind,report_flag,print_sel_date); } else { tmfprintf(&tmBundle, ofile2,_TMC("ENR|{0}|{1}||||||||{2}|{3}|D8\n"), edi_translate,reg_levl,confid_ind,report_flag); } } if ((tmstrcmp(edi_translate,_TMC("EBO")) == 0) || (tmstrcmp(edi_translate,_TMC("EB6")) == 0) || (tmstrcmp(edi_translate,_TMC("EB7")) == 0) || (tmstrcmp(edi_translate,_TMC("EB8")) == 0)) { if (*control_rpt_date) { drop_in_status = 0; tmstrcpy(date_type,_TMC("C")); tmstrcpy(use_date, control_rpt_date); tmstrcpy(use_time, control_rpt_time); sel_last_full_half_status(FIRST_ROW); /* 1st full/half code */ sel_last_full_half_status(CLOSE_CURSOR); tmstrcpy(old_nslc_fhl_code, nslc_fhl_code); tmstrcpy(date_type,_TMC("S")); tmstrcpy(use_date, sel_date); tmstrcpy(use_time, sel_time); sel_full_half_status(); /* Determine if Student has dropped to a lower status */ if ((!tmstrcmp(old_nslc_fhl_code,_TMC("F")))&& (!tmstrcmp(nslc_fhl_code,_TMC("H")))) { drop_in_status = 1; } else if ((!tmstrcmp(old_nslc_fhl_code,_TMC("F")))&& (!tmstrcmp(nslc_fhl_code,_TMC("Q")))) { drop_in_status = 1; } else if ((!tmstrcmp(old_nslc_fhl_code,_TMC("Q")))&& (!tmstrcmp(nslc_fhl_code,_TMC("L")))) { drop_in_status = 1; } else if ((!tmstrcmp(old_nslc_fhl_code,_TMC("Q")))&& (!tmstrcmp(nslc_fhl_code,_TMC("H")))) { drop_in_status = 1; } else if ((!tmstrcmp(old_nslc_fhl_code,_TMC("H")))&& (!tmstrcmp(nslc_fhl_code,_TMC("L")))) { drop_in_status = 1; } else if ((!tmstrcmp(old_nslc_fhl_code,_TMC("F")))&& (!tmstrcmp(nslc_fhl_code,_TMC("L")))) { drop_in_status = 1; } } } /* Print DTP statement */ if (!tmstrcmp(partoftermdateind,_TMC("Y"))) /*report part of term dates if selected or else display enroll start and end date */ { *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,partofterm_mindate); if(*partofterm_maxdate) { tmstrcat(temp_str,_TMC("-")); tmstrcat(temp_str,partofterm_maxdate); } rtrim(temp_str,_TMC("|")); tmfprintf(&tmBundle, ofile2,_TMC("DTP|382|RD8{0}\n"),temp_str); } else { if (( compare(scp_process,_TMC("Y"),EQS) ) && ( compare(cycle_code,enrl_cycle_code,EQS) )) { *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,scp_term_start); if(*scp_term_end) { tmstrcat(temp_str,_TMC("-")); tmstrcat(temp_str,scp_term_end); } rtrim(temp_str,_TMC("|")); tmfprintf(&tmBundle, ofile2,_TMC("DTP|382|RD8{0}\n"),temp_str); } else { *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,enroll_start_date); if(*enroll_end_date) { tmstrcat(temp_str,_TMC("-")); tmstrcat(temp_str,enroll_end_date); } rtrim(temp_str,_TMC("|")); tmfprintf(&tmBundle, ofile2,_TMC("DTP|382|RD8|{0}-{1}\n"),enroll_start_date,enroll_end_date); } } if (!tmstrcmp(stud_status,_TMC("A"))) { drop_in_status = 0; } if (!tmstrcmp(stud_status,_TMC("D"))) { drop_in_status = 0; } if (!tmstrcmp(stud_status,_TMC("W"))) { drop_in_status = 0; } if (!tmstrcmp(stud_status,_TMC("G"))) { drop_in_status = 0; } if (drop_in_status == 1) /* print 2nd rec if drop in status */ { if ( (*fhl_date) && (tmstrcmp(term_start_date,fhl_date) > 0) ) { tmstrcpy(fhl_date,term_start_date); goto skip_time2; } tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8|{0}\n"), fhl_date); tmstrcpy(eb_status_date,fhl_date); } else { skip_time2: switch(*stud_status) { case 'A': tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8|{0}\n"), leave_date); tmstrcpy(eb_status_date,leave_date); break; case 'D': if(*dead_date) { tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8|{0}\n"), dead_date); tmstrcpy(eb_status_date,dead_date); } else { if (( compare(scp_process,_TMC("Y"),EQS) ) && ( compare(cycle_code,enrl_cycle_code,EQS) )) { if(*scp_term_start) { tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8|{0}\n"), scp_term_start); tmstrcpy(eb_status_date,scp_term_start); } else { tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8\n")); tmstrcpy(eb_status_date,scp_term_start); } } else { if(*enroll_start_date) { tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8|{0}\n"), enroll_start_date); tmstrcpy(eb_status_date,enroll_start_date); } else { tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8\n")); tmstrcpy(eb_status_date,enroll_start_date); } } } break; case 'W': /*8.10.7.1 if ( (*withdraw_date) && (( compare(scp_process,_TMC("Y"),EQS) ) && ( compare(cycle_code,enrl_cycle_code,EQS) ) && (tmstrcmp(scp_term_start,withdraw_date) > 0) ) ) { (tmstrcpy(withdraw_date,scp_term_start)); } else { if ( (*withdraw_date) && ( compare(scp_process,_TMC("N"),EQS) ) && (tmstrcmp(term_start_date,withdraw_date) > 0) ) { (tmstrcpy(withdraw_date,term_start_date)); } }*/ tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8|{0}\n"), withdraw_date); tmstrcpy(eb_status_date,withdraw_date); break; case 'G': sel_grad_date_g(); if (!*grad_date_g) { tmstrcpy(grad_date_g,term_end_date); } /*8.14.1 if ( (*grad_date_g) && (tmstrcmp(term_end_date,grad_date_g) < 0) ) { (tmstrcpy(grad_date_g,term_end_date)); } */ if (*grad_date_g) { tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8|{0}\n"), grad_date_g); tmstrcpy(eb_status_date,grad_date_g); add(pers_type_index2,pers_type_index2, _TMC("1")); } /*8.14.1 if(*grad_date_g) { tmfprintf(&tmBundle, ofile2,_TMC("DTP|007|D8|{0}\n"), grad_date_g); tmstrcpy(eb_status_date,grad_date_g); } */ break; default: break; } /* switch */ } /*Print SUM Information */ get_status(); chk_withdrawl_degree_seek_exists(); /*8.13*/ *remedial_attr_flag ='\0'; tmstrcpy(remedial_attr_flag,_TMC("")); *detl_flag ='\0'; tmstrcpy(detl_flag,_TMC("")); EXEC SQL EXECUTE DECLARE pkg_attr_flag varchar2(1); pkg_detail_flag varchar2(1); BEGIN if :scp_process = 'Y' then if :cycle_code = :enrl_cycle_code then pkg_attr_flag := sfkenrl.f_find_attribute (:pidm,:term_to_process,:scps_code,:rptname,:sessionid); else pkg_attr_flag := sfkenrl.f_find_attribute (:pidm,:term_to_process,'',:rptname,:sessionid); end if; else pkg_attr_flag := sfkenrl.f_find_attribute (:pidm,:term_to_process,'',:rptname,:sessionid); end if; if pkg_attr_flag = 'R' then :remedial_attr_flag:Ind_05 := pkg_attr_flag; else :remedial_attr_flag:Ind_05 := ''; end if; if :detl_ind = 'Y' then pkg_detail_flag := sfkenrl.f_find_pell (:pidm,:term_to_process,'',:rptname,:sessionid); :detl_flag:Ind_06 := pkg_detail_flag; else :detl_flag:Ind_06 := NULL; end if; END; END-EXEC; POSTORA; if (!tmstrcmp(prog_active_exist,_TMC("Y")) && (*stud_majr1_cipc) ) { if (!tmstrcmp(detl_ind,_TMC("Y")) ) { tmfprintf(&tmBundle, ofile2,_TMC("SUM|||{0}|{1}||||||{2}\n"), remedial_attr_flag, prog_active_exist,detl_flag); } else { tmfprintf(&tmBundle, ofile2,_TMC("SUM|||{0}|{1}\n"), remedial_attr_flag, prog_active_exist); } } else { if(!tmstrcmp(degree_seek_withdr_exist,_TMC("Y"))) { tmstrcpy(prog_active_exist,_TMC("Y")); } else { tmstrcpy(prog_active_exist,_TMC("N")); } if (!tmstrcmp(detl_ind,_TMC("Y")) ) { tmfprintf(&tmBundle, ofile2,_TMC("SUM|||{0}|{1}||||||{2}\n"), remedial_attr_flag, prog_active_exist,detl_flag); } else { tmfprintf(&tmBundle, ofile2,_TMC("SUM|||{0}|{1}\n"), remedial_attr_flag, prog_active_exist); } tmfprintf(&tmBundle, ofile2,_TMC("N1|41|{0}\n"), fice); } /*Print PER EM Email Address */ if (!tmstrcmp(emailind,_TMC("Y"))) { if (*stud_prefemail) { tmfprintf(&tmBundle, ofile2,_TMC("PER|SB||EM|{0}\n"), stud_prefemail); } } /* Print ENT 01 statement */ if (!tmstrcmp(ssnind,_TMC("Y"))) { if(*student_ssn) { tmfprintf(&tmBundle, ofile2,_TMC("ENT|01|S2|34|{0}\n"), student_ssn); } else { tmfprintf(&tmBundle, ofile2,_TMC("ENT|01|S2|34|NO SSN\n")); } } else { if(*student_id) { tmfprintf(&tmBundle, ofile2,_TMC("ENT|03|S2|93|{0}\n"),student_id); } else { tmfprintf(&tmBundle, ofile2,_TMC("ENT|03|S2|93\n")); } } /* Print IN2 statement */ if(*student_fname) { tmfprintf(&tmBundle, ofile2,_TMC("IN2|02|{0}\n"), student_fname); } else { tmfprintf(&tmBundle, ofile2,_TMC("IN2|02\n")); } if (*student_mi) { tmfprintf(&tmBundle, ofile2,_TMC("IN2|03|{0,%.35s}\n"), student_mi);/*display middle name*/ } if(*student_lname) { tmfprintf(&tmBundle, ofile2,_TMC("IN2|05|{0,%.35s}\n"), student_lname); } else { tmfprintf(&tmBundle, ofile2,_TMC("IN2|05\n")); } if (*student_name_suffix) { tmfprintf(&tmBundle, ofile2,_TMC("IN2|09|{0,%1s}\n"), student_name_suffix); } if ( !*genderind ) { *stud_gender = '\0'; } if ( !*raceind ) { *stud_race = '\0'; } if ( !*citizenship_ind ) { *stud_citz_cde = '\0'; } else { EXEC SQL SELECT STVCITZ_EDI_EQUIV INTO :edi_equiv_citz:Ind_01 FROM STVCITZ WHERE STVCITZ_CODE = :stud_citz_cde; POSTORA; if (NO_ROWS_FOUND) { *edi_equiv_citz = '\0'; } } /* Print DMG statement */ *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,stud_gender); tmstrcat(temp_str,_TMC("||")); tmstrcat(temp_str,stud_race); tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,edi_equiv_citz); rtrim(temp_str,_TMC("|")); if (*student_birth_date) { tmfprintf(&tmBundle, ofile2,_TMC("DMG|D8|{0}{1}\n"), student_birth_date,temp_str); } else { if ((*stud_citz_cde)||(*stud_gender)||(*stud_race)) { tmfprintf(&tmBundle, ofile2,_TMC("DMG||{0}\n"), temp_str); } } /* Print N3 statement */ seladdr(FIRST_ROW); if (*temp_street_line1) { tmfprintf(&tmBundle, ofile2,_TMC("N3|{0}"), temp_street_line1); tmfprintf(&tmBundle, ofile2,_TMC("\n")); } else { if (*pers_atyp_code) { if (*street_line1) { tmfprintf(&tmBundle, ofile2,_TMC("N3|{0}"), street_line1); if (*street_line2) tmfprintf(&tmBundle, ofile2,_TMC("|{0}"), street_line2); tmfprintf(&tmBundle, ofile2,_TMC("\n")); } else if (*street_line2) { tmfprintf(&tmBundle, ofile2,_TMC("N3|{0}"), street_line2); tmfprintf(&tmBundle, ofile2,_TMC("\n")); } if(!*state) { tmstrcpy(state,_TMC("FO")); } if(*natn_edi_equiv) { if ( (!tmstrcmp(natn_edi_equiv,_TMC("US"))) || (!tmstrcmp(natn_edi_equiv,_TMC("CA"))) ) { tmfprintf(&tmBundle, ofile2,_TMC("N4|{0}|{1}|{2}|{3}\n"), rtrim(city_var,_TMC(",")),state,zip,natn_edi_equiv); } else { tmstrcpy(state,_TMC("FO")); tmfprintf(&tmBundle, ofile2,_TMC("N4|{0}|{1}|{2}|{3}\n"), rtrim(city_var,_TMC(",")),state,zip,natn_edi_equiv); } } else /* no edi equiv for spraddr nation */ { *edi_equiv_nation ='\0'; EXEC SQL SELECT STVNATN_EDI_EQUIV INTO :edi_equiv_nation:Ind_01 FROM STVNATN WHERE STVNATN_CODE = :nation_code; POSTORA; if(*edi_equiv_nation) /* parameter nation code */ { if ( (!tmstrcmp(edi_equiv_nation,_TMC("US"))) || (!tmstrcmp(edi_equiv_nation,_TMC("CA"))) ) { tmfprintf(&tmBundle, ofile2,_TMC("N4|{0}|{1}|{2}|{3}\n"), rtrim(city_var,_TMC(",")),state,zip,edi_equiv_nation); } else { tmstrcpy(state,_TMC("FO")); tmfprintf(&tmBundle, ofile2,_TMC("N4|{0}|{1}|{2}|{3}\n"), rtrim(city_var,_TMC(",")),state,zip,edi_equiv_nation); } } else /* no edi equiv for parameter nation */ { if(*zip) { tmfprintf(&tmBundle, ofile2,_TMC("N4|{0}|{1}|{2}\n"), rtrim(city_var,_TMC(",")),state,zip); } else { tmfprintf(&tmBundle, ofile2,_TMC("N4|{0}|{1}\n"), rtrim(city_var,_TMC(",")),state); } } } } } /* Print ENT 02 statement */ if(*(rtrim(term_desc,NULL))) { tmfprintf(&tmBundle, ofile2,_TMC("ENT|02|M8|DS|{0}{1}||||U2|{2}\n"), fice, branch_code,rtrim(term_desc,NULL) ); } else { tmfprintf(&tmBundle, ofile2,_TMC("ENT|02|M8|DS|{0}{1}||||U2\n"), fice, branch_code); } if (!tmstrcmp(ssnind,_TMC("Y"))) { if (!tmstrcmp(banneridind,_TMC("Y"))) { if (*student_id) { tmfprintf(&tmBundle, ofile2,_TMC("ENT|03|S2|93|{0}\n"),student_id); } } } /* Print ENT 05 statement */ if (*opeid) /*8.14.1*/ { tmfprintf(&tmBundle, ofile2,_TMC("ENT|05|M8|DS|{0}\n"),opeid); } /* Print SES Information */ edi_translate_crdlvl =_TMC(""); if (!tmstrcmp(stud_credential_level, _TMC("01")) ) edi_translate_crdlvl =_TMC("UG"); if (!tmstrcmp(stud_credential_level, _TMC("02")) ) edi_translate_crdlvl=_TMC("AS"); if (!tmstrcmp(stud_credential_level, _TMC("03")) ) edi_translate_crdlvl=_TMC("BD"); if (!tmstrcmp(stud_credential_level, _TMC("04")) ) edi_translate_crdlvl=_TMC("25"); if (!tmstrcmp(stud_credential_level, _TMC("05")) ) edi_translate_crdlvl=_TMC("MD"); if (!tmstrcmp(stud_credential_level, _TMC("06")) ) edi_translate_crdlvl=_TMC("DD"); if (!tmstrcmp(stud_credential_level, _TMC("07")) ) edi_translate_crdlvl=_TMC("FP"); if (!tmstrcmp(stud_credential_level, _TMC("08")) ) edi_translate_crdlvl=_TMC("GR"); if (!tmstrcmp(stud_credential_level, _TMC("99")) ) edi_translate_crdlvl=_TMC("PC"); if (!tmstrcmp(classlvlind,_TMC("Y"))) { *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,term_yearmm); tmstrcat(temp_str,_TMC("|||||||||")); tmstrcat(temp_str,stud_classlevel); rtrim(temp_str,_TMC("|")); } if (!tmstrcmp(classlvlind,_TMC("Y"))) { tmfprintf(&tmBundle, ofile2,_TMC("SES{0}\n"),temp_str); } else { tmfprintf(&tmBundle, ofile2,_TMC("SES|{0}\n"),term_yearmm); } if ( (lcur_cnt == ceu_cnt) && ( ceu_cnt > 0 ) ) { goto skip_major_reporting3; } if (!tmstrcmp(prog_active_exist,_TMC("N")) ) { goto skip_major_reporting3; } /*Print FOS information for student major's */ if(*stud_majr1_cipc) { *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,stud_majr1_cipc); tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,stud_majr1); rtrim(temp_str,_TMC("|")); tmfprintf(&tmBundle, ofile2,_TMC("FOS|M|81{0}\n"),temp_str); } if(*stud_majr2_cipc) { *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,stud_majr2_cipc); tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,stud_majr2); rtrim(temp_str,_TMC("|")); tmfprintf(&tmBundle, ofile2,_TMC("FOS|M|81{0}\n"),temp_str); } for(i = 0; ((i < lfos_cnt) && (i < 6)); i++) { if (!tmstrcmp(arr_enrdata[i].prog_ceu_ind, _TMC("N")) ) { if (!tmstrcmp(arr_enrdata[i].prog_nondgr_ind, _TMC("N")) ) { edi_translate_crdlvl =_TMC(""); edi_translate_progstat =_TMC(""); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("01")) ) edi_translate_crdlvl =_TMC("UG"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("02")) ) edi_translate_crdlvl=_TMC("AS"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("03")) ) edi_translate_crdlvl=_TMC("BD"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("04")) ) edi_translate_crdlvl=_TMC("25"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("05")) ) edi_translate_crdlvl=_TMC("MD"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("06")) ) edi_translate_crdlvl=_TMC("DD"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("07")) ) edi_translate_crdlvl=_TMC("FP"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("08")) ) edi_translate_crdlvl=_TMC("GR"); if (!tmstrcmp(arr_enrdata[i].prog_credential_level, _TMC("99")) ) edi_translate_crdlvl=_TMC("PC"); if(*edi_translate_crdlvl) { tmfprintf(&tmBundle, ofile2,_TMC("SES|{0}|||||||||{1}\n"),print_sel_date2, edi_translate_crdlvl); } else { tmfprintf(&tmBundle, ofile2,_TMC("SES|{0}\n"),print_sel_date2); } /* Print New ENR Information */ switch(*arr_enrdata[i].prog_status) { /* EB1= 'D', EB3='W', EB4= 'G', EB6= 'F', EB7= 'H', EB8='L', EB9='A' */ case 'D': edi_translate_progstat=_TMC("EB1"); break; case 'W': edi_translate_progstat=_TMC("EB3"); break; case 'G': edi_translate_progstat=_TMC("EB4"); break; case 'F': edi_translate_progstat=_TMC("EB6"); break; case 'Q': edi_translate_progstat=_TMC("EBO"); break; case 'H': edi_translate_progstat=_TMC("EB7"); break; case 'L': edi_translate_progstat=_TMC("EB8"); break; case 'A': edi_translate_progstat=_TMC("EB9"); break; default: break; } /* switch */ if (!tmstrcmp(arr_enrdata[i].prog_status,_TMC("D"))) { goto skip_copy2; } if (!tmstrcmp(arr_enrdata[i].prog_status,_TMC("W"))) { goto skip_copy2; } if (*arr_enrdata[i].end_start_date) { tmstrcpy(arr_enrdata[i].prog_enr_stat_eff_date, arr_enrdata[i].end_start_date); } skip_copy2: if ( (*arr_enrdata[i].prog_enr_stat_eff_date) && (tmstrcmp(arr_enrdata[i].prog_begin_date,arr_enrdata[i].prog_enr_stat_eff_date) > 0) ) { savei = i; check_start_date(); } if(*arr_enrdata[i].prog_enr_stat_eff_date) { tmfprintf(&tmBundle, ofile2,_TMC("ENR|{0}||D8|{1}||||||||D8|{2}\n"),edi_translate_progstat,arr_enrdata[i].prog_begin_date,arr_enrdata[i].prog_enr_stat_eff_date); } else { tmfprintf(&tmBundle, ofile2,_TMC("ENR|{0}||D8|{1}||||||||D8\n"),edi_translate_progstat,arr_enrdata[i].prog_begin_date); } *temp_str = '\0'; tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,arr_enrdata[i].stud_majr1_cipc); tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,arr_enrdata[i].prog_cipc_pub_year); tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,arr_enrdata[i].prog_length_type); tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,arr_enrdata[i].prog_length); tmstrcat(temp_str,_TMC("|")); tmstrcat(temp_str,arr_enrdata[i].prog_weeks_yr); rtrim(temp_str,_TMC("|")); tmfprintf(&tmBundle, ofile2,_TMC("FOS|P|81{0}\n"),temp_str); if(*arr_enrdata[i].special_prog_ind) { tmfprintf(&tmBundle, ofile2,_TMC("NTE||{0}\n"),arr_enrdata[i].special_prog_ind); } else { tmfprintf(&tmBundle, ofile2,_TMC("NTE||N\n")); } } } /* end ceu if */ } skip_major_reporting3: add(pers_type_index,pers_type_index, _TMC("1")); } if (!tmstrcmp(run_mode,_TMC("2"))||!tmstrcmp(run_mode,_TMC("3"))) { if (!tmstrcmp(create_rpt, _TMC("Y")) ) { tmstrcpy(report_edi_translate, edi_translate); copy_report_variables(); chk_for_heading(ofile); if (!tmstrcmp(partoftermdateind,_TMC("Y"))) /*report part of term dates if selected or else display enroll start and end date */ { tmfprintf(&tmBundle, ofile,_TMC("{0,%-12s}{1,%-32s}{2,%-16s}{3,%-10s}{4,%-3s} - {5,%-8s}{6,%-16s}{7,%-8s} - {8,%-13s}{9,%-9s}\n"), report_id, report_fullname, report_ssn, report_birth_date,report_edi_translate,report_stud_status, report_eb_status_date, partofterm_mindate ,partofterm_maxdate, report_grad_date); } else { if (( compare(scp_process,_TMC("Y"),EQS) ) && ( compare(cycle_code,enrl_cycle_code,EQS) )) { tmfprintf(&tmBundle, ofile,_TMC("{0,%-12s}{1,%-32s}{2,%-16s}{3,%-10s}{4,%-3s} - {5,%-8s}{6,%-16s}{7,%-8s} - {8,%-13s}{9,%-9s}\n"), report_id, report_fullname, report_ssn, report_birth_date,report_edi_translate,report_stud_status, report_eb_status_date, scp_term_start ,scp_term_end, report_grad_date); } else { tmfprintf(&tmBundle, ofile,_TMC("{0,%-12s}{1,%-32s}{2,%-16s}{3,%-10s}{4,%-3s} - {5,%-8s}{6,%-16s}{7,%-8s} - {8,%-13s}{9,%-9s}\n"), report_id, report_fullname, report_ssn, report_birth_date,report_edi_translate,report_stud_status, report_eb_status_date, report_enroll_start_date ,report_enroll_end_date, report_grad_date); } } add(pers_reported_cntr,pers_reported_cntr, _TMC("1")); lineno++; count++; } else add(pers_reported_cntr,pers_reported_cntr, _TMC("1")); } next_pidm: ; } } /* end of no rows found on main spriden cursor */ print_footer(ofile); if (!tmstrcmp(run_mode,_TMC("1"))) { prtmsg(CMPNORM, str2lc(rptname)); prtmsg(LINSOUT, count,ofile_name); } else { if (!tmstrcmp(run_mode,_TMC("2"))) { /* Print GE statement */ tmfprintf(&tmBundleCNum, ofile2, _TMC("GE|{0,number,integer}|000000000\n"), tmatoi(pers_type_index) ); /* Print IEA statement */ tmfprintf(&tmBundle, ofile2, _TMC("IEA|1|000000000\n")); prtmsg(CMPNORM, str2lc(rptname)); prtmsg(LINSOUT, tmatoi(pers_type_index3),ofile_name2); } else if (!tmstrcmp(run_mode,_TMC("3"))) { prtmsg(CMPNORM, str2lc(rptname)); prtmsg(LINSOUT, tmatoi(pers_type_index)*10,ofile_name2); } } } static void print_footer(UFILE *file_in) { if (!tmstrcmp(run_mode,_TMC("1"))) { if (!tmstrcmp(pers_type_index,_TMC("0"))) { tmfprintf(&tmBundle, file_in, TM_NLS_Get("0134","\n\n ****** No students enrolled for the {0} term ******\n\n"), term); count = count + 4; } if (!tmstrcmp(pers_err_cntr,_TMC("0"))) { tmfprintf(&tmBundle, file_in, TM_NLS_Get("0135","\n\n ****** No invalid or missing student data found for the {0} term ******\n\n"), term); count = count + 4; } } /* Report the entered parameters */ pageno++; tmfprintf(&tmBundle, file_in,_TMC("\f")); tmfprintf(&tmBundle, file_in,_TMC("{0} {1}{2,%*s}"), print_sel_date4, time_var, inst_pos, institution); tmfprintf(&tmBundle, file_in, _TMC("{0,%*s} {1,number,integer}\n"), page_pos, TM_NLS_Get("0136","PAGE"), pageno); tmfprintf(&tmBundle, file_in, _TMC("{0}{1,%*s}{2,%*s}\n\n"), term, title_pos, title_var, rpt_pos, rptname); tmfprintf(&tmBundle, file_in,TM_NLS_Get("0137","\n\n\n\n * * * REPORT CONTROL INFORMATION - SFRNSLC - Release ")); tmfprintf(&tmBundle, file_in,RELEASE); tmfprintf(&tmBundle, file_in,_TMC(" * * *\n")); if ((!tmstrcmp(create_rpt, _TMC("N")) ) && (tmstrcmp(run_mode,_TMC("1")))) { tmfprintf(&tmBundle, file_in, _TMC("{0,%*s}\n"), title_pos, TM_NLS_Get("0138","Summary Report Not Requested")); count++; } tmfprintf(&tmBundle, file_in,_TMC("\n\n")); /* */ /* If FICE code does not exist, print warning on control report */ /* */ if ( !tmstrcmp(fice,_TMC("000000")) ) { if ( !tmstrcmp(run_mode,_TMC("2")) || !tmstrcmp(run_mode,_TMC("3")) ) { tmfprintf(&tmBundle, file_in, TM_NLS_Get("0139", "\n***ERROR*** Cannot generate .txt file with FICE Code = 000000.") ); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0140", " Please resubmit with valid FICE Code.\n\n") ); } } tmfprintf(&tmBundle, file_in, TM_NLS_Get("0141"," TERM: {0}\n"),term); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0142","STUDENT EXCLUDE ATTRIBUTES: ")); if (!tmstrcmp(studex_ind,_TMC("Y")) ) { tmstrcpy(colr_type,_TMC("S")); readcolr(file_in); } else tmfprintf(&tmBundle, file_in, TM_NLS_Get("0143","None entered.")); tmfprintf(&tmBundle, file_in, _TMC("\n")); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0144"," REPORT FLAG: {0}\n"),report_flag); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0145"," REPORT DATE: {0}\n"),sel_date); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0146"," ADDRESS HIERARCHY: ")); if (!tmstrcmp(atyp_ind,_TMC("Y")) ) { tmstrcpy(colr_type,_TMC("A")); readcolr(file_in); } tmfprintf(&tmBundle, file_in, _TMC("\n")); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0147"," RUN MODE: {0}\n"),run_mode); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0148"," CODE FOR GRAD LEVEL: ")); if (!tmstrcmp(glvl_ind,_TMC("Y")) ) { tmstrcpy(colr_type,_TMC("G")); readcolr(file_in); } tmfprintf(&tmBundle, file_in, _TMC("\n")); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0149"," APPLICATION CODE: {0}\n"),parm_popsel_appl); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0150"," SELECTION IDENTIFIER: {0}\n"),parm_popsel_sel); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0151"," CREATOR ID: {0}\n"),parm_popsel_crID); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0152"," USER ID: {0}\n"),parm_popsel_usID); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0153"," BRANCH: {0}\n"),branch_code); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0154"," FICE: {0}\n"),fice); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0155"," EFFECTIVE WITHDRAWAL DATE: {0}\n"),eff_wdrl_ind); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0156"," CREATE SUMMARY REPORT: {0}\n"),create_rpt); if (!tmstrcmp(run_mode,_TMC("2"))||!tmstrcmp(run_mode,_TMC("3"))) { tmfprintf(&tmBundle, file_in, TM_NLS_Get("0157"," EMAIL ADDRESS: {0}\n"),emailind); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0158"," GENDER: {0}\n"),genderind); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0159"," RACE: {0}\n"),raceind); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0160"," CLASS LEVEL: {0}\n"),classlvlind); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0161"," BANNER ID: {0}\n"),banneridind); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0162"," SSN: {0}\n"),ssnind); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0163","REPORT START AND END DATES: {0}\n"),partoftermdateind); } tmfprintf(&tmBundle, file_in, TM_NLS_Get("0164","PROCESS BY STUDENT CENTRIC PERIOD: {0}\n"),scp_process); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0165"," OPEID: {0}\n"),opeid); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0166"," CITIZENSHIP: {0}\n"),citizenship_ind); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0167"," NATION CODE: {0}\n"),nation_code); count = count + 19; tmfprintf(&tmBundle, file_in, TM_NLS_Get("0168","CONTINUING EDUCATION LEVEL: ")); if (!tmstrcmp(clvl_ind,_TMC("Y")) ) { tmstrcpy(colr_type,_TMC("C")); readcolr(file_in); } tmfprintf(&tmBundle, file_in, _TMC("\n")); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0169"," REMEDIAL ATTRIBUTE: ")); if (!tmstrcmp(attr_ind,_TMC("Y")) ) { tmstrcpy(colr_type,_TMC("R")); readcolr(file_in); } tmfprintf(&tmBundle, file_in, _TMC("\n")); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0170"," DETAIL CODE PELL GRANT: ")); if (!tmstrcmp(detl_ind,_TMC("Y")) ) { tmstrcpy(colr_type,_TMC("D")); readcolr(file_in); } tmfprintf(&tmBundle, file_in, _TMC("\n")); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0171"," USE FINALS DATE: {0}\n"),usefinaldateflag); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0172","USE CURRICULUM START/END DATES: {0}\n"),usecurrstartenddatesflag); if (!tmstrcmp(run_mode,_TMC("2"))||!tmstrcmp(run_mode,_TMC("3"))) { tmfprintf(&tmBundle, file_in, TM_NLS_Get("0173"," RECORD COUNT: {0,number,integer}\n"),tmatoi(pers_reported_cntr)); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0174","Please see .txt file for NSC flat file.\n")); } } static void chk_withdrawl_degree_seek_exists(void) { int i = 0; tmstrcpy(degree_seek_withdr_exist,_TMC("N")); for(i = 0; ((i < lfos_cnt) && (i < 6)); i++) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0175"," Debug inside chk_withdrawl_degree_seek_exists : arr_enrdata[i].prog_nondgr_ind {0} arr_enrdata[i].prog_status{1}\n"),arr_enrdata[i].prog_nondgr_ind,arr_enrdata[i].prog_status); #endif if ((!tmstrcmp(arr_enrdata[i].prog_nondgr_ind, _TMC("N"))) && (!tmstrcmp(arr_enrdata[i].prog_status,_TMC("W")))) { tmstrcpy(degree_seek_withdr_exist,_TMC("Y")); break; } } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0176"," Debug chk_withdrawl_degree_seek_exists: pidm {0} degree_seek_withdr_exist {1}\n"),pidm,degree_seek_withdr_exist); #endif } static void findcpltseqno(void) { *cplt_seqno = '\0'; EXEC SQL EXECUTE DECLARE p_levl sfrcplt.sfrcplt_levl_code%type; p_camp sfrcplt.sfrcplt_camp_code%type; p_coll sfrcplt.sfrcplt_coll_code%type; p_degc sfrcplt.sfrcplt_degc_code%type; p_program sfrcplt.sfrcplt_program%type; p_majr sfrcplt.sfrcplt_majr_code%type; p_atts sfrcplt.sfrcplt_atts_code%type; atts_found varchar2(1) := 'N'; CURSOR sovcltm_c IS SELECT sovcltm_levl_code,sovcltm_camp_code, sovcltm_coll_code, sovcltm_degc_code, sovcltm_program, sovcltm_majr_code FROM sovcltm WHERE sovcltm_stvterm_code = :term_to_process AND sovcltm_pidm = :pidm AND sovcltm_lmod_code = sb_curriculum_str.f_learner; CURSOR sfrcplt_c (p_levl sfrcplt.sfrcplt_levl_code%TYPE, p_coll sfrcplt.sfrcplt_coll_code%TYPE, p_camp sfrcplt.sfrcplt_camp_code%TYPE, p_degc sfrcplt.sfrcplt_degc_code%TYPE, p_program sfrcplt.sfrcplt_program%TYPE, p_majr sfrcplt.sfrcplt_majr_code%TYPE) IS select sfrcplt_seqno,sfrcplt_atts_code from sfrcplt WHERE (( sfrcplt_levl_code != '**' AND sfrcplt_levl_code = p_levl ) OR ( sfrcplt_levl_code = '**')) and (sfrcplt_camp_code = p_camp or (p_camp is null and sfrcplt_camp_code is null) or sfrcplt_camp_code is null) and (sfrcplt_coll_code = p_coll or (p_coll is null and sfrcplt_coll_code is null) or sfrcplt_coll_code is null) and (sfrcplt_degc_code = p_degc or (p_degc is null and sfrcplt_degc_code is null) or sfrcplt_degc_code is null) and (sfrcplt_program = p_program or (p_program is null and sfrcplt_program is null) or sfrcplt_program is null) and (sfrcplt_majr_code = p_majr or (p_majr is null and sfrcplt_majr_code is null) or sfrcplt_majr_code is null) order by sfrcplt_levl_code, sfrcplt_rule_weight+ DECODE(sfrcplt_camp_code,NULL, 0, 1)+ DECODE(sfrcplt_coll_code,NULL, 0, 1)+ DECODE(sfrcplt_degc_code,NULL, 0, 1)+ DECODE(sfrcplt_program,NULL, 0, 1)+ DECODE(sfrcplt_majr_code,NULL, 0, 1)+ DECODE(sfrcplt_atts_code,NULL, 0, 1) DESC; CURSOR sgrsatt_c(p_atts sfrcplt.sfrcplt_atts_code%TYPE) IS SELECT 'Y' FROM sgrsatt a WHERE a.sgrsatt_pidm = :pidm AND a.sgrsatt_atts_code = p_atts AND a.sgrsatt_term_code_eff = (select max(b.sgrsatt_term_code_eff) from sgrsatt b where b.sgrsatt_pidm = :pidm and b.sgrsatt_term_code_eff <= :term_to_process); BEGIN soklcur.p_create_sotvcur(p_pidm => :pidm, p_lmod_code => sb_curriculum_str.f_learner, p_term_code => :term_to_process); OPEN sovcltm_c; FETCH sovcltm_c INTO p_levl,p_camp,p_coll, p_degc,p_program,p_majr; OPEN sfrcplt_c(p_levl,p_coll,p_camp,p_degc, p_program,p_majr); atts_found := 'N'; LOOP FETCH sfrcplt_c INTO :cplt_seqno:Ind_05, p_atts; EXIT WHEN sfrcplt_c%NOTFOUND; IF p_atts is NULL THEN EXIT; END IF; IF p_atts is not NULL THEN OPEN sgrsatt_c(p_atts); FETCH sgrsatt_c INTO atts_found; IF sgrsatt_c%NOTFOUND THEN atts_found := 'N'; END IF; CLOSE sgrsatt_c; END IF; IF p_atts is not NULL AND atts_found = 'Y' THEN exit; END IF; END LOOP; CLOSE sfrcplt_c; CLOSE sovcltm_c; END; END-EXEC; POSTORA; } static void find_gap(void) { /* See if the student has any gap in reporting read the multiple previous reported terms and match to sfbetrm find the last missing sfbetrm for a reported term that is after they first enrolled */ #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0177"," Debug find_gap: term used {0}\n"), term_to_process); #endif *last_gap_term ='\0'; tmstrcpy(gap_exists,_TMC("N")); EXEC SQL EXECUTE DECLARE pkg_gap_term stvterm.stvterm_code%type; BEGIN sfkenrl.p_find_gap (:pidm,:term_to_process,:cplt_seqno,:rptname,:sessionid,pkg_gap_term); if pkg_gap_term is not null then :last_gap_term:Ind_05 := pkg_gap_term; else :last_gap_term:Ind_05 := ''; end if; END; END-EXEC; POSTORA; if (*last_gap_term){ tmstrcpy(gap_exists,_TMC("Y")); } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0178"," Debug find_gap: find gap, previous enrollment exists {0} gap exists {1}\n"), last_gap_term , gap_exists); #endif } /* Get the majors for the FOS|P records */ static void get_enr_data(void) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0179"," Debug get sovlcur: pidm {0} wd ind {1} wd date {2} lv ind {3} lv date {4}\n"), pidm,withdraw_ind,withdraw_date,leave_ind,leave_date); #endif *withdraw_ind = '\0'; *withdraw_date = '\0'; *leave_ind = '\0'; *leave_date = '\0'; *prog_lcur_seqno = '\0'; *lcur_current_ind = '\0'; *lcur_rolled_seqno = '\0'; *lcur_levl_code = '\0'; *lcur_coll_code = '\0'; *lcur_degc_code = '\0'; *lcur_program = '\0'; *lcur_camp_code = '\0'; *lcur_activity_date = '\0'; *stud_status = '\0'; *stud_cipc_code = '\0'; *stud_status_date = '\0'; *stud_grad_term = '\0'; *stud_levl_code = '\0'; *stud_credential_level = '\0'; *prog_enr_stat_eff_date = '\0'; *end_start_date = '\0'; *lcur_term_code_end = '\0'; *lcur_activity_date_update = '\0'; lfos_cnt = 0; lcur_cnt = 0; *lcur_levl_ceu_ind = '\0'; *lcur_prog_start_date='\0'; *lcur_prog_end_date='\0'; ceu_cnt = 0; *err_majr1 = '\0'; *err_majr2 = '\0'; c = 0; lfos_write = 0; nondgr_cnt = 0; duparray_cnt = 0; grad_cnt = 0; newcnt = 0; *lcur_acat_code = '\0'; for(m = 0; m < 6; m++) { *arr_missingcipc[m].missingcipc_majr_code = '\0'; } for(m = 0; m < 10 ; m++) { *arr_nondgrdata[m].nondgr_lcur_seqno = '\0'; *arr_nondgrdata[m].nondgr_lfos_seqno = '\0'; *arr_nondgrdata[m].nondgr_majr_code = '\0'; } for(m = 0; m < 10 ; m++) { *arr_enrdata[m].prog_status = '\0'; *arr_enrdata[m].prog_begin_date = '\0'; *arr_enrdata[m].prog_enr_stat_eff_date = '\0'; *arr_enrdata[m].stud_majr1_cipc = '\0'; *arr_enrdata[m].prog_length = '\0'; *arr_enrdata[m].prog_length_type = '\0'; *arr_enrdata[m].prog_weeks_yr = '\0'; *arr_enrdata[m].special_prog_ind = '\0'; *arr_enrdata[m].prog_credential_level = '\0'; *arr_enrdata[m].prog_grad_term = '\0'; *arr_enrdata[m].prog_cipc_pub_year = '\0'; *arr_enrdata[m].prog_levl_code = '\0'; *arr_enrdata[m].prog_term_code = '\0'; *arr_enrdata[m].end_start_date = '\0'; *arr_enrdata[m].prog_ceu_ind = '\0'; *arr_enrdata[m].prog_current_ind = '\0'; *arr_enrdata[m].prog_nondgr_ind = '\0'; *arr_enrdata[m].prog_majr_code = '\0'; *arr_enrdata[m].prog_majr_code = '\0'; *arr_enrdata[m].save_lcur_seqno = '\0'; *arr_enrdata[m].save_priority_no = '\0'; *arr_enrdata[m].save_dept_code = '\0'; *arr_enrdata[m].save_term_code_ctlg = '\0'; *arr_enrdata[m].save_lfos_rule = '\0'; *arr_enrdata[m].save_conc_attach_rule = '\0'; *arr_enrdata[m].save_start_date = '\0'; *arr_enrdata[m].save_end_date = '\0'; *arr_enrdata[m].save_term_code_end = '\0'; *arr_enrdata[m].save_tmst_code = '\0'; *arr_enrdata[m].save_majr_code_attach = '\0'; *arr_enrdata[m].save_cact_code= '\0'; *arr_enrdata[m].save_term_code = '\0'; *arr_enrdata[m].save_csts_code = '\0'; *arr_enrdata[m].save_activity_date = '\0'; *arr_enrdata[m].curr_prog_start_date = '\0'; *arr_enrdata[m].curr_prog_end_date = '\0'; *arr_enrdata[m].curr_fos_start_date = '\0'; *arr_enrdata[m].curr_fos_end_date = '\0'; } for(m = 0; m < 10 ; m++) { *arr_dupmajr[m].prog_status = '\0'; *arr_dupmajr[m].prog_begin_date = '\0'; *arr_dupmajr[m].prog_enr_stat_eff_date = '\0'; *arr_dupmajr[m].stud_majr1_cipc = '\0'; *arr_dupmajr[m].prog_length = '\0'; *arr_dupmajr[m].prog_length_type = '\0'; *arr_dupmajr[m].prog_weeks_yr = '\0'; *arr_dupmajr[m].special_prog_ind = '\0'; *arr_dupmajr[m].prog_credential_level = '\0'; *arr_dupmajr[m].prog_grad_term = '\0'; *arr_dupmajr[m].prog_cipc_pub_year = '\0'; *arr_dupmajr[m].prog_levl_code = '\0'; *arr_dupmajr[m].prog_term_code = '\0'; *arr_dupmajr[m].end_start_date = '\0'; *arr_dupmajr[m].prog_ceu_ind = '\0'; *arr_dupmajr[m].prog_current_ind = '\0'; *arr_dupmajr[m].prog_nondgr_ind = '\0'; *arr_dupmajr[m].prog_majr_code = '\0'; *arr_dupmajr[m].prog_majr_code = '\0'; *arr_dupmajr[m].save_lcur_seqno = '\0'; *arr_dupmajr[m].save_priority_no = '\0'; *arr_dupmajr[m].save_dept_code = '\0'; *arr_dupmajr[m].save_term_code_ctlg = '\0'; *arr_dupmajr[m].save_lfos_rule = '\0'; *arr_dupmajr[m].save_conc_attach_rule = '\0'; *arr_dupmajr[m].save_start_date = '\0'; *arr_dupmajr[m].save_end_date = '\0'; *arr_dupmajr[m].save_term_code_end = '\0'; *arr_dupmajr[m].save_tmst_code = '\0'; *arr_dupmajr[m].save_majr_code_attach = '\0'; *arr_dupmajr[m].save_cact_code= '\0'; *arr_dupmajr[m].save_term_code = '\0'; *arr_dupmajr[m].save_csts_code = '\0'; *arr_dupmajr[m].save_activity_date = '\0'; *arr_dupmajr[m].curr_prog_start_date = '\0'; *arr_dupmajr[m].curr_prog_end_date = '\0'; *arr_dupmajr[m].curr_fos_start_date = '\0'; *arr_dupmajr[m].curr_fos_end_date = '\0'; } for(m = 0; m < 10 ; m++) { *arr_gradmajr[m].prog_majr_code = '\0'; *arr_gradmajr[m].prog_status = '\0'; *arr_gradmajr[m].prog_cipc_code = '\0'; *arr_gradmajr[m].prog_enr_stat_eff_date = '\0'; *arr_gradmajr[m].prog_term_code = '\0'; *arr_gradmajr[m].prog_length = '\0'; *arr_gradmajr[m].prog_begin_date = '\0'; *arr_gradmajr[m].prog_credential_level = '\0'; *arr_gradmajr[m].curr_prog_start_date = '\0'; *arr_gradmajr[m].curr_prog_end_date = '\0'; *arr_gradmajr[m].curr_fos_start_date = '\0'; *arr_gradmajr[m].curr_fos_end_date = '\0'; } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0180"," Debug get sovlcur: last_enrollment_term {0}, term_to_process {1} \n"),last_enrollment_term, term_to_process); #endif if(*pidm) { EXEC SQL EXECUTE BEGIN soklcur.p_create_sotvcur(p_pidm => :pidm, p_lmod_code => sb_curriculum_str.f_learner, p_term_code => :term_to_process); END; END-EXEC; POSTORA; EXEC SQL DECLARE get_sovlcur CURSOR FOR SELECT stvlevl_ceu_ind, COALESCE(stvdegc_acat_code,'99'), sovlcur_seqno, sovlcur_current_ind, sovlcur_active_ind, sovlcur_rolled_seqno, sovlcur_levl_code, sovlcur_coll_code, sovlcur_degc_code, sovlcur_program, sovlcur_camp_code, TO_CHAR(sovlcur_activity_date_update,'YYYYMMDD'), TO_CHAR(sovlcur_activity_date,'YYYYMMDD'), sovlcur_term_code_end , TO_CHAR(sovlcur_start_date,'YYYYMMDD'), TO_CHAR(sovlcur_end_date,'YYYYMMDD') FROM stvdegc, stvlevl, sovlcur WHERE sovlcur_pidm = :pidm AND sovlcur_lmod_code = sb_curriculum_str.f_learner AND sovlcur_active_ind = 'Y' AND ((sovlcur_current_ind = 'Y') OR (sovlcur_current_ind = 'N' and sovlcur_term_code_end IS NOT NULL AND ( ( :last_enrollment_term is null and sovlcur_term_code_end = :term_to_process) OR ( :last_enrollment_term is not null AND (sovlcur_term_code_end > :last_enrollment_term OR sovlcur_term_code_end = :last_enrollment_term) AND sovlcur_term_code_end <= :term_to_process) ) ) ) AND stvlevl_code = sovlcur_levl_code AND stvdegc_code = sovlcur_degc_code ORDER BY decode(sovlcur_current_ind || sovlcur_active_ind, 'YY', 1, 2), sovlcur_seqno desc, sovlcur_priority_no ; EXEC SQL OPEN get_sovlcur; POSTORA; while ( ( lfos_cnt < 6) ) { EXEC SQL FETCH get_sovlcur INTO :lcur_levl_ceu_ind:Ind_14,:lcur_acat_code:Ind_13, :prog_lcur_seqno:Ind_01,:lcur_current_ind :Ind_02, :lcur_active_ind:Ind_12, :lcur_rolled_seqno :Ind_03,:lcur_levl_code :Ind_04, :lcur_coll_code :Ind_05,:lcur_degc_code :Ind_06, :lcur_program :Ind_07,:lcur_camp_code :Ind_08, :lcur_activity_date_update :Ind_09, :lcur_activity_date :Ind_10, :lcur_term_code_end :Ind_11, :lcur_prog_start_date :Ind_15, :lcur_prog_end_date :Ind_16; POSTORA; if (NO_ROWS_FOUND) { *lcur_levl_ceu_ind='\0'; *prog_lcur_seqno='\0'; *lcur_current_ind='\0'; *lcur_active_ind='\0'; *prog_enr_stat_eff_date='\0'; *lcur_acat_code='\0'; *lcur_current_ind='\0'; *lcur_rolled_seqno='\0'; *lcur_levl_code='\0'; *lcur_coll_code='\0'; *lcur_degc_code='\0'; *lcur_program='\0'; *lcur_camp_code='\0'; *lcur_activity_date_update='\0'; *lcur_activity_date='\0'; *lcur_term_code_end='\0'; *lcur_prog_start_date='\0'; *lcur_prog_end_date='\0'; break; } else { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0181"," Debug get sovlcur: lcur seqno {0} current ind {1} active ind {2} lcur ceu {3} lcur_activity_date_update {4} \n"), prog_lcur_seqno, lcur_current_ind,lcur_active_ind,lcur_levl_ceu_ind,lcur_activity_date_update); #endif if (!tmstrcmp(lcur_levl_ceu_ind,_TMC("N"))) { EXEC SQL DECLARE get_sovlcur_ceu_ind CURSOR FOR select 'Y' from dual where :lcur_levl_code in (select sprcolr_value_atyp from sprcolr where sprcolr_job = :rptname and sprcolr_sessionid = :sessionid and sprcolr_type = 'C'); EXEC SQL OPEN get_sovlcur_ceu_ind; POSTORA; EXEC SQL FETCH get_sovlcur_ceu_ind INTO :lcur_levl_ceu_ind:Ind_13; POSTORA; if (NO_ROWS_FOUND) { tmstrcpy(lcur_levl_ceu_ind,_TMC("N")); } EXEC SQL CLOSE get_sovlcur_ceu_ind; POSTORA; } /* end check of job submission parameter 30 */ #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0182"," Debug get sovlcur: lcur seqno {0} ceu ind {1}\n"), prog_lcur_seqno, lcur_levl_ceu_ind); #endif *end_start_date = '\0'; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0183"," Debug get sovlcur: lcur seqno {0} prog status {1} prog_enr_stat_eff_date {2} \n"), prog_lcur_seqno,prog_status,prog_enr_stat_eff_date); #endif tmstrcpy(save_prog_enr_stat_eff_date,prog_enr_stat_eff_date); if (!tmstrcmp(lcur_levl_ceu_ind,_TMC("Y"))) { ceu_cnt = ceu_cnt + 1; } *lfos_nondgr_ind = '\0'; lfos_to_lcur_cnt = 0; lfos_nondgr_cnt = 0; c = 0; get_fos_data(); skip_it: c = 0; } } review_majors(); /* look for a non current and active graduated record where a duplicate major is reported in the current term */ check_for_duplicate_graduated_status(); /* this just looks at completed lfos arr_enrdata for debugging only */ #ifdef SCT_DEBUG list_out_array(); #endif calc_overall_status(); EXEC SQL CLOSE get_sovlcur; POSTORA; } } static void check_start_date(void) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0184"," Debug check_start_date start: term {0} pgm start date {1} eff date{2}\n"), arr_enrdata[savei].prog_term_code,arr_enrdata[i].prog_begin_date,arr_enrdata[i].prog_enr_stat_eff_date); #endif EXEC SQL DECLARE s_stvterm CURSOR FOR SELECT TO_CHAR(stvterm_start_date,'YYYYMMDD') FROM stvterm WHERE stvterm_code = :arr_enrdata[savei].prog_term_code; EXEC SQL OPEN s_stvterm; POSTORA; EXEC SQL FETCH s_stvterm INTO :term_start_date:Ind_01; POSTORA; EXEC SQL CLOSE s_stvterm; POSTORA; tmstrcpy(arr_enrdata[savei].prog_enr_stat_eff_date,term_start_date); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0185"," Debug check_start_date final: term start date {0} begin term {1} PSED {2}\n"), term_start_date,arr_enrdata[savei].prog_term_code,arr_enrdata[savei].prog_enr_stat_eff_date); #endif } static void create_reported_majors(void) { i = 0; #ifdef SCT_DEBUG printf("debug create_reported_majors: lfos cnt %d\n", lfos_cnt); tmprintf(&tmBundle, TM_NLS_Get("0186"," debug create_reported_majors: begins pidm {0} term {1} \n"),pidm, term); #endif for(i = 0; ((i < lfos_cnt) && (i < 6)); i++) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0187"," Debug create_reported_majors: ceu {0} nondgr {1}\n"),arr_enrdata[i].prog_ceu_ind,arr_enrdata[i].prog_nondgr_ind); tmprintf(&tmBundle, TM_NLS_Get("0188"," Debug create_reported_majors: status {0}\n"),arr_enrdata[i].prog_status); printf("ceu ind %s nondegr %s \n",arr_enrdata[i].prog_ceu_ind, arr_enrdata[i].prog_nondgr_ind); #endif if ( (!tmstrcmp(arr_enrdata[i].prog_ceu_ind, _TMC("N")) ) && (!tmstrcmp(arr_enrdata[i].prog_nondgr_ind, _TMC("N"))) ) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0189","Debug create_reported_majors: create lfos call to api pidm{0} majr {1}\n"), pidm, arr_enrdata[i].prog_majr_code); tmprintf(&tmBundle, TM_NLS_Get("0190","Debug create_reported_majors: status {0} start date {1} eff date {2} \n"), arr_enrdata[i].prog_status, arr_enrdata[i].prog_begin_date,arr_enrdata[i].prog_enr_stat_eff_date); #endif tmstrcpy(save_majr_code, arr_enrdata[i].prog_majr_code); tmstrcpy(save_cipc_code, arr_enrdata[i].stud_majr1_cipc); tmstrcpy(save_prog_status, arr_enrdata[i].prog_status); tmstrcpy(save_prog_begin_date, arr_enrdata[i].prog_begin_date); tmstrcpy(save_prog_enr_stat_eff_date, arr_enrdata[i].prog_enr_stat_eff_date); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0191"," Debug create reported majors: save PSED {0} PSED {1} Student ID {2} Full Name {3}\n"), save_prog_enr_stat_eff_date,prog_enr_stat_eff_date,student_id,student_fullname); #endif EXEC SQL EXECUTE DECLARE seqno NUMBER; BEGIN select COALESCE(max(sfrmnsc_seqno) + 1,1) into seqno from sfrmnsc where sfrmnsc_pidm = :pidm and sfrmnsc_term_code = :term; insert into sfrmnsc ( sfrmnsc_term_code, sfrmnsc_pidm, sfrmnsc_majr_code, sfrmnsc_cipc_code, sfrmnsc_seqno, sfrmnsc_status_cde, sfrmnsc_start_date, sfrmnsc_report_date, sfrmnsc_effective_date, sfrmnsc_activity_date, sfrmnsc_user_id, sfrmnsc_data_origin) values (:term , :pidm , :save_majr_code , :save_cipc_code , seqno, COALESCE(:save_prog_status , '?'), to_date(:save_prog_begin_date ,'YYYYMMDD'), TO_DATE(:sel_date ,G$_DATE.GET_NLS_DATE_FORMAT), to_date(:save_prog_enr_stat_eff_date ,'YYYYMMDD'), sysdate, gb_common.f_sct_user, gb_common.data_origin); END; END-EXEC; POSTORA; } /* end if */ } /* end for loop */ } /************************************/ static void get_fos_data(void) { EXEC SQL DECLARE c_sovlfos CURSOR FOR select sovlfos_seqno, sovlfos_lfst_code, sovlfos_majr_code, sovlfos_term_code, COALESCE(sovlfos_active_ind,'N'), COALESCE(sovlfos_current_ind,'N'), sovlfos_lcur_seqno, sovlfos_priority_no, sovlfos_dept_code, sovlfos_term_code_ctlg, sovlfos_lfos_rule, sovlfos_conc_attach_rule, to_char(sovlfos_start_date,'YYYYMMDD'), to_char(sovlfos_end_date,'YYYYMMDD'), sovlfos_term_code_end, sovlfos_tmst_code, sovlfos_majr_code_attach, sovlfos_csts_code, sovlfos_cact_code, to_char(sovlfos_activity_date,'YYYYMMDD') from sovlfos where sovlfos_pidm = :pidm and sovlfos_lcur_seqno = :prog_lcur_seqno and sovlfos_lfst_code = sb_fieldofstudy_str.f_major and sovlfos_seqno = ( select max(m.sovlfos_seqno) from sovlfos m where m.sovlfos_pidm = sovlfos.sovlfos_pidm and m.sovlfos_lcur_seqno = :prog_lcur_seqno and m.sovlfos_majr_code = sovlfos.sovlfos_majr_code and m.sovlfos_lfst_code = sb_fieldofstudy_str.f_major and COALESCE(m.sovlfos_active_ind,'N') = 'Y') order by Decode(COALESCE(sovlfos_current_ind,'N'),'Y',1,'N',2),sovlfos_priority_no, sovlfos_seqno desc; EXEC SQL OPEN c_sovlfos; POSTORA; lfos_write = 0; while ( ( lfos_cnt < 6) ) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0192"," Debug get fos data: Starting while Loop lfos_cnt {0,%1d} lfos_write {1,%1d}\n"),lfos_cnt, lfos_write); #endif EXEC SQL FETCH c_sovlfos INTO :fos_seqno:Ind_01, :fos_fst_code:Ind_02, :fos_majr_code:Ind_03, :fos_term_code:Ind_04, :fos_active_ind:Ind_05, :fos_current_ind:Ind_06, :fos_lcur_seqno:Ind_07, :fos_priority_no:Ind_08, :fos_dept_code:Ind_09, :fos_term_code_ctlg:Ind_10, :fos_lfos_rule:Ind_11, :fos_conc_attach_rule:Ind_12, :fos_start_date:Ind_13, :fos_end_date:Ind_14, :fos_term_code_end:Ind_15, :fos_tmst_code:Ind_16, :fos_majr_code_attach:Ind_17, :fos_csts_code:Ind_18, :fos_cact_code:Ind_19, :fos_activity_date:Ind_20; POSTORA; if (NO_ROWS_FOUND) { *fos_seqno='\0'; *fos_fst_code='\0'; *fos_majr_code='\0'; *fos_term_code='\0'; *fos_prog_status='\0'; *fos_active_ind='\0'; *fos_current_ind='\0'; *fos_lcur_seqno='\0'; *fos_priority_no='\0'; *fos_dept_code='\0'; *fos_term_code_ctlg='\0'; *fos_lfos_rule='\0'; *fos_conc_attach_rule='\0'; *fos_start_date='\0'; *fos_end_date='\0'; *fos_term_code_end='\0'; *fos_tmst_code='\0'; *fos_majr_code_attach='\0'; *fos_csts_code='\0'; *fos_cact_code='\0'; *fos_activity_date='\0'; break; } else { *fos_prog_status='\0'; *prog_cipc_code='\0'; *prog_length='\0'; *prog_length_type='\0'; *prog_weeks_yr='\0'; *prog_begin_date='\0'; *special_prog_ind='\0'; *prog_cipc_pub_year='\0'; *prog_cred_level ='\0'; *prog_levl_code ='\0'; *prog_majr_code ='\0'; *prog_nondgr_ind ='\0'; *lfosreported = '\0'; *lfos_previous_reported='\0'; *fos_first_term='\0'; *fos_last_active_term='\0'; lfos_to_lcur_cnt = lfos_to_lcur_cnt + 1; tmstrcpy(skip_write,_TMC("N")); /* move get program status from learner here for each sovlfos record */ get_program_status(); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0193"," Debug get fos data: get fos pidm {0} majr {1} pgm stat {2}\n"),pidm, fos_majr_code, prog_status); tmprintf(&tmBundle, TM_NLS_Get("0194"," Debug get fos data: get fos cact {0} end term {1} csts {2} levl {3} term {4}\n"), fos_cact_code,fos_term_code_end, fos_csts_code, lcur_levl_code, fos_term_code); tmprintf(&tmBundle, TM_NLS_Get("0195"," Debug get fos data: fos priority {0} fos seqno {1}\n"), fos_priority_no,fos_seqno); tmprintf(&tmBundle, TM_NLS_Get("0196"," Debug get fos data: fos_start_date {0}, fos_end_date {1} \n"),fos_start_date,fos_end_date); #endif tmstrcpy(fos_prog_status, prog_status); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0197"," Debug get fos data: fos_prog_status = {0}\n"),fos_prog_status); #endif EXEC SQL EXECUTE DECLARE l_stdn_term_code_eff sgbstdn.sgbstdn_term_code_eff%TYPE; l_seqno sfrcplr.sfrcplr_seqno%TYPE; l_program_length_type sfrcplr.sfrcplr_prog_length_type%TYPE; l_program_length sfrcplr.sfrcplr_program_length%TYPE; l_program_calculated sfrcplr.sfrcplr_program_length%TYPE; l_program_hours sfrcplr.sfrcplr_program_hours%TYPE; l_weeks_year sfrcplr.sfrcplr_weekS_year%TYPE; l_credential_level sfrcplr.sfrcplr_credential_level%TYPE; l_special_program sfrcplr.sfrcplr_special_program%TYPE; l_cipc_code stvmajr.stvmajr_cipc_code%TYPE; l_aid_eligibility_ind stvmajr.stvmajr_aid_eligibility_ind%TYPE; l_message VARCHAR2(300); l_levl_code sorlcur.sorlcur_levl_code%TYPE; l_coll_code sorlcur.sorlcur_coll_code%TYPE; l_degc_code sorlcur.sorlcur_degc_code%TYPE; l_camp_code sorlcur.sorlcur_camp_code%TYPE; l_program sorlcur.sorlcur_program%TYPE; l_term_catlg sorlcur.sorlcur_term_code_ctlg%TYPE; l_cipc_pub_year stvcipc.stvcipc_pub_year%TYPE; CURSOR stvterm_c(term_code IN VARCHAR2) IS SELECT TO_CHAR(TRUNC(stvterm_start_date),'YYYYMMDD') FROM stvterm WHERE stvterm_code = term_code; CURSOR stvcipc_c(cipc_code IN VARCHAR2) IS SELECT TO_CHAR(stvcipc_pub_year) FROM stvcipc WHERE stvcipc_code = cipc_code; CURSOR lfos_first_term_c is select sovlcur_term_code from sovlcur where sovlcur_pidm = :pidm and sovlcur_lmod_code = sb_curriculum_str.f_learner and sovlcur_levl_code = :lcur_levl_code and sovlcur_active_ind = 'Y' and sovlcur_term_code = ( select min(a.sovlcur_term_code) from stvdegc, sovlcur a where a.sovlcur_pidm = sovlcur.sovlcur_pidm and a.sovlcur_lmod_code = sb_curriculum_str.f_learner and a.sovlcur_levl_code = sovlcur.sovlcur_levl_code and a.sovlcur_active_ind = 'Y' and stvdegc_code = a.sovlcur_degc_code and COALESCE(stvdegc_acat_code,'99') = COALESCE(:lcur_acat_code,'99') and exists ( select 1 from stvmajr,sovlfos where sovlfos_pidm = a.sovlcur_pidm and sovlfos_lfst_code = sb_fieldofstudy_str.f_major and sovlfos_lcur_seqno = a.sovlcur_seqno and stvmajr_code = sovlfos_majr_code and COALESCE(stvmajr_cipc_code,'999999') = COALESCE(l_cipc_code,'999999'))); BEGIN sfkcplr.p_process_NSLDS(:pidm,:term_to_process,:prog_lcur_seqno,:fos_seqno,:fos_fst_code,:fos_majr_code,null, l_stdn_term_code_eff,l_seqno,l_program_length_type,l_program_length, l_program_calculated,l_program_hours,l_weeks_year,l_credential_level, l_special_program,l_cipc_code,l_aid_eligibility_ind,l_message, l_levl_code,l_coll_code,l_degc_code,l_camp_code,l_program,l_term_catlg); :prog_length:Ind_05 := ltrim(replace(to_char(l_program_length,'099D990'),'.','')); if COALESCE(l_program_length_type,'Y') != 'Y' THEN :prog_weeks_yr:Ind_06 := ltrim(replace(to_char(l_weeks_year,'099D990'),'.','')); else :prog_weeks_yr:Ind_06 := null; END if; /* get the first term the student has this major */ open lfos_first_term_c; fetch lfos_first_term_c into :fos_first_term:Ind_01; close lfos_first_term_c; /* get first day of begin term */ OPEN stvterm_c(:fos_first_term:Ind_01); FETCH stvterm_c INTO :prog_begin_date:Ind_07; CLOSE stvterm_c; if l_cipc_code IS NOT NULL THEN OPEN stvcipc_c(l_cipc_code); FETCH stvcipc_c INTO l_cipc_pub_year; CLOSE stvcipc_c; END if; :prog_cipc_code:Ind_08 := l_cipc_code; :prog_length_type:Ind_09 := l_program_length_type; :special_prog_ind:Ind_10 := l_special_program; :prog_cred_level:Ind_11 :=l_credential_level; :prog_cipc_pub_year:Ind_12 := l_cipc_pub_year; :prog_levl_code:Ind_13 := l_levl_code; END; END-EXEC; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0198"," Debug get fos data: cipc {0} pub yr {1} cred levl {2} length {3}\n"), prog_cipc_code,prog_cipc_pub_year,prog_cred_level,prog_length); tmprintf(&tmBundle, TM_NLS_Get("0199"," Debug get fos data: major {0} first term {1} pgm date(from STVTERM) {2} eff date {3} activity date {4}\n"), fos_majr_code,fos_first_term,prog_begin_date, prog_enr_stat_eff_date, fos_activity_date); tmprintf(&tmBundle, TM_NLS_Get("0200"," Debug get fos data: fos_start_date {0}, fos_end_date {1} \n"),fos_start_date,fos_end_date); tmprintf(&tmBundle, TM_NLS_Get("0201"," Debug get fos data: Pgm_start_date {0}, Pgm_end_date {1} \n"),lcur_prog_start_date,lcur_prog_end_date); #endif if ( compare(usecurrstartenddatesflag,_TMC("Y"),EQS) ) { if ( (*fos_start_date) || (*lcur_prog_start_date) ) { if (*fos_start_date) { tmstrcpy(prog_begin_date,fos_start_date); } else { tmstrcpy(prog_begin_date,lcur_prog_start_date); } } } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0202"," Debug get fos data: After Considering Major or Program Start Date Logic > prog_begin_date {0}\n"),prog_begin_date); #endif if ( ((!*prog_cred_level )||(!*prog_length)) && (!tmstrcmp(lcur_levl_ceu_ind, _TMC("N")) ) ) { err_no_match = 1; } tmstrcpy(prog_majr_code,fos_majr_code); if (!tmstrcmp(prog_cred_level, _TMC("00")) ) { tmstrcpy(prog_nondgr_ind,_TMC("Y")); prog_nondgr_cnt = prog_nondgr_cnt + 1; lfos_nondgr_cnt = lfos_nondgr_cnt + 1; if ( nondgr_cnt < 10 ) { tmstrcpy (arr_nondgrdata[nondgr_cnt].nondgr_lcur_seqno,prog_lcur_seqno); tmstrcpy (arr_nondgrdata[nondgr_cnt].nondgr_lfos_seqno,fos_seqno); tmstrcpy (arr_nondgrdata[nondgr_cnt].nondgr_majr_code,fos_majr_code); nondgr_cnt++; } } else { tmstrcpy(prog_nondgr_ind,_TMC("N")); } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0203"," Debug get fos data: majr {0} withdraw date {1} end start date {2}\n"),fos_majr_code,withdraw_date,end_start_date); #endif if (*withdraw_date) { tmstrcpy(prog_enr_stat_eff_date,withdraw_date); } else if (*end_start_date) { tmstrcpy (prog_enr_stat_eff_date,end_start_date); } else if (tmstrcmp(prog_enr_stat_eff_date,prog_begin_date) < 0) { /* use the pgm start date as the effective date if the pgm change is after the tmst */ tmstrcpy (prog_enr_stat_eff_date,prog_begin_date); } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0204"," Debug get fos data: program status {0} fos prog status {1} eff date {2} start date {3}\n"), prog_status,fos_prog_status,prog_enr_stat_eff_date,prog_begin_date ); #endif if ( (!tmstrcmp(lcur_current_ind,_TMC("N"))) && (!tmstrcmp(prog_status,_TMC("G"))) ) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0205"," Debug get sovlcur going to skip fos: lcur seqno {0} prog status {1}\n"),prog_lcur_seqno,prog_status); #endif goto skip_fos; } /* copy to fos_prog_status unconditionally now that status is returned for all fos records. */ tmstrcpy(fos_prog_status,prog_status); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0206"," Debug get fos data: program status {0} fos_prog_status {1}\n"), prog_status,fos_prog_status ); #endif if (!tmstrcmp(prog_status, _TMC("G")) ) { sel_grad_date_g(); if (*grad_date_g) { tmstrcpy (prog_enr_stat_eff_date,grad_date_g); } } /** lfos is not both current and active **/ #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0207"," Debug get fos data: pgm status {0} major {1} current {2} active {3} term {4} report term {5} end term {6} last enrll {7}\n"), prog_status, fos_majr_code, fos_current_ind, fos_active_ind, fos_term_code, term_to_process, lcur_term_code_end, last_enrollment_term ); #endif /* if status is graduated do not reset status to W - withdrawn */ if ( ( (!tmstrcmp(fos_active_ind, _TMC("N")) ) || (!tmstrcmp(fos_current_ind, _TMC("N")) ) ) && (tmstrcmp(prog_status,_TMC("G"))) ) { tmstrcpy(fos_prog_status,_TMC("W")) ; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0208"," Debug get fos data: fos_prog_status is Reset to W. fos_prog_status = {0} prog_status {1} psed {2} \n"),fos_prog_status,prog_status, prog_enr_stat_eff_date); #endif tmstrcpy(orig_prog_enr_stat_eff_date_for_dup,prog_enr_stat_eff_date); if ( ( compare(usecurrstartenddatesflag,_TMC("Y"),EQS) ) && ( (*fos_end_date) || (*lcur_prog_end_date) ) ) { if (*fos_end_date) { tmstrcpy(prog_enr_stat_eff_date,fos_end_date); } else { tmstrcpy(prog_enr_stat_eff_date,lcur_prog_end_date); } } else { /* withdraw date needs to be the first day of the term of the curriculum change */ if (*lcur_term_code_end){ if ( check_curriculum_changed(fos_majr_code) ) { /* Report the STVTERM DATE */ EXEC SQL SELECT TO_CHAR(stvterm_start_date,'YYYYMMDD') into :temp_withdraw_start_date:Ind_01 FROM STVTERM WHERE STVTERM_CODE = :lcur_term_code_end; POSTORA; tmstrcpy(prog_enr_stat_eff_date,temp_withdraw_start_date); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0209"," Debug get fos data: prog_enr_stat_eff_date is Modified again here. > prog_enr_stat_eff_date {0}\n"),prog_enr_stat_eff_date); #endif } else { /* -- Report Actual Withdrawl Date -- Do not do anything, prog_enr_stat_eff_date contains actual withdrawal date. */ } } else { tmstrcpy(prog_enr_stat_eff_date,withdraw_start_date); } } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0210"," Debug get fos data: prog_enr_stat_eff_date is Modified again here. > prog_enr_stat_eff_date {0}\n"),prog_enr_stat_eff_date); #endif /* for records with an end term, make sure that the end term is less than or equal to the report term prior to checking the last enrollment term */ tmstrcpy(skip_write,_TMC("N")) ; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0211"," Debug get fos data: fos majr {0} skip write {1}\n"), fos_majr_code,skip_write); tmprintf(&tmBundle, TM_NLS_Get("0212"," Debug get fos data: end term {0} report term {1} last enrollment term {2}\n"), lcur_term_code_end,term_to_process,last_enrollment_term); #endif if ( (*lcur_term_code_end) && (tmstrcmp(lcur_term_code_end, term_to_process ) <= 0) && (tmstrcmp(lcur_term_code_end, last_enrollment_term ) > 0) ) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0213"," Debug get fos data: do not skip write because end term is <= report term\n")); tmprintf(&tmBundle, TM_NLS_Get("0214"," Debug get fos data: and end term is > last enrollment term\n")); #endif tmstrcpy(skip_write,_TMC("N")) ; } else { if ( tmstrcmp(fos_term_code, last_enrollment_term ) <= 0 ) { tmstrcpy(skip_write,_TMC("Y")) ; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0215"," Debug get fos data: skip write because fos term {0} is <= the last enrollment term {1}\n"), fos_term_code,last_enrollment_term); #endif } } /* close brace for else on end term */ } /* close brace for not current or not active */ #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0216"," Debug get fos data: fos majr {0} pgm status {1} skip write {2} \n"), fos_majr_code,fos_prog_status,skip_write); #endif tmstrcpy(hold_prog_status, fos_prog_status); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0217"," Debug get fos data: Again assigned value to hold_prog_status = {0} before process_fos\n"),hold_prog_status); #endif process_fos: /* check to see if the cipc code, credential level, program length already exists do not write it again 1) graduate first G 2) deceased D 3) full time F 4) 3/4 time Q 5) half time H 6) < half L 7) leave of absense A 8) withdraw W */ #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0218"," Debug get fos data: check to see if the cipc code, credential level, program length already exists do not write it again.\n")); tmprintf(&tmBundle, TM_NLS_Get("0219"," Debug get fos data: pidm {0} pgm status {1} fos csts {2} skip_write = {3} \n"),pidm, hold_prog_status, fos_csts_code ,skip_write); #endif /* load new array for duplicate checking */ if (!tmstrcmp(skip_write, _TMC("N")) ) { /* call new function to load array for duplicate checking */ /* we need this to be able to add back an entry for the case of graduating in a duplicate major but continuing on with a duplicate */ load_duplicate_array(); } lfosdup_cnt = 0; lfos_dupcntcheck_cnt = 0; lfos_write = 0; tmstrcpy(lfosnew,_TMC("Y")) ; tmstrcpy(lfosdup,_TMC("N")) ; dupcnt = 0; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0220"," Debug get fos data: lfos_write {0,%1d} lfosnew {1} lfosdup {2} skip_write {3} \n"), lfos_write ,lfosnew, lfosdup, skip_write); #endif if ( lfos_cnt == 0){ if (!tmstrcmp(skip_write, _TMC("N")) ){ #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0221"," Debug get fos data: lfos_cnt IS 0 and skip_write is also N so pushing values First FOS (Active) Record Values to arr_enrdata Array.\n")); #endif tmstrcpy (arr_enrdata[lfos_write].prog_enr_stat_eff_date,prog_enr_stat_eff_date); tmstrcpy (arr_enrdata[lfos_write].prog_status,hold_prog_status); tmstrcpy (arr_enrdata[lfos_write].prog_term_code,fos_term_code); tmstrcpy (arr_enrdata[lfos_write].prog_current_ind,lcur_current_ind); tmstrcpy (arr_enrdata[lfos_write].prog_begin_date,prog_begin_date); tmstrcpy (arr_enrdata[lfos_write].stud_majr1_cipc,prog_cipc_code); tmstrcpy (arr_enrdata[lfos_write].prog_length,prog_length); tmstrcpy (arr_enrdata[lfos_write].prog_length_type, prog_length_type); tmstrcpy (arr_enrdata[lfos_write].prog_weeks_yr,prog_weeks_yr); tmstrcpy (arr_enrdata[lfos_write].special_prog_ind,special_prog_ind); tmstrcpy (arr_enrdata[lfos_write].prog_credential_level,prog_cred_level); tmstrcpy (arr_enrdata[lfos_write].prog_cipc_pub_year,prog_cipc_pub_year); tmstrcpy (arr_enrdata[lfos_write].prog_levl_code,prog_levl_code); tmstrcpy (arr_enrdata[lfos_write].prog_ceu_ind,lcur_levl_ceu_ind); tmstrcpy (arr_enrdata[lfos_write].prog_nondgr_ind,prog_nondgr_ind); tmstrcpy (arr_enrdata[lfos_write].prog_majr_code,prog_majr_code); tmstrcpy (arr_enrdata[lfos_write].end_start_date,end_start_date); tmstrcpy(hold_majr,arr_enrdata[lfos_write].prog_majr_code); tmstrcpy(arr_enrdata[lfos_write].save_lcur_seqno,fos_lcur_seqno); tmstrcpy(arr_enrdata[lfos_write].save_priority_no,fos_priority_no); tmstrcpy(arr_enrdata[lfos_write].save_dept_code,fos_dept_code); tmstrcpy(arr_enrdata[lfos_write].save_term_code_ctlg,fos_term_code_ctlg); tmstrcpy(arr_enrdata[lfos_write].save_lfos_rule,fos_lfos_rule); tmstrcpy(arr_enrdata[lfos_write].save_conc_attach_rule,fos_conc_attach_rule); tmstrcpy(arr_enrdata[lfos_write].save_start_date,fos_start_date); tmstrcpy(arr_enrdata[lfos_write].save_end_date,fos_end_date); tmstrcpy(arr_enrdata[lfos_write].curr_prog_start_date,lcur_prog_start_date); tmstrcpy(arr_enrdata[lfos_write].curr_prog_end_date,lcur_prog_end_date); tmstrcpy(arr_enrdata[lfos_write].curr_fos_start_date,fos_start_date); tmstrcpy(arr_enrdata[lfos_write].curr_fos_end_date,fos_end_date); if (*fos_term_code_end) { tmstrcpy(arr_enrdata[lfos_write].save_term_code_end,fos_term_code_end); } else { tmstrcpy(arr_enrdata[lfos_write].save_term_code_end,term_to_process); } tmstrcpy(arr_enrdata[lfos_write].save_tmst_code,fos_tmst_code); tmstrcpy(arr_enrdata[lfos_write].save_majr_code_attach,fos_majr_code_attach); tmstrcpy(arr_enrdata[lfos_write].save_term_code,fos_term_code); tmstrcpy(arr_enrdata[lfos_write].save_cact_code,fos_cact_code); tmstrcpy(arr_enrdata[lfos_write].save_csts_code,fos_csts_code); tmstrcpy(arr_enrdata[lfos_write].save_activity_date,fos_activity_date); check_cipc_code(); check_cipc_code(); if ( ( c < 6 ) && (!tmstrcmp(missing_cipc_sw, _TMC("Y"))) ) { tmstrcpy(arr_missingcipc[c].missingcipc_majr_code,hold_majr); c++; } *hold_majr = '\0'; lfos_cnt++; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0222"," Debug get fos data: first after insert in array major {0} start {1} eff {2} act {3} \n"), arr_enrdata[lfos_write].prog_majr_code, arr_enrdata[lfos_write].prog_begin_date, arr_enrdata[lfos_write].prog_enr_stat_eff_date , arr_enrdata[lfos_write].save_activity_date ); tmprintf(&tmBundle, TM_NLS_Get("0223"," Debug get fos data: first after insert in array lfos_write {0,%1d} lfos_cnt {1,%1d} \n"), lfos_write,lfos_cnt); #endif } } else { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0224"," Debug get fos data: Inside Else Cond because lfos_cnt IS Not 0 and lfos_cnt = {0,%1d}. Starting For loop to Determine Duplicate Major Record.\n"),lfos_cnt); #endif for(dupcnt = 0; dupcnt < lfos_cnt ; dupcnt++) { /* change comparison to use cipc code, credential level and program length */ #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0225"," Debug get fos data: prog_cipc_code {0} arr_enrdata[dupcnt].prog_cipc_code {1}\n"), prog_cipc_code,arr_enrdata[dupcnt].stud_majr1_cipc ); tmprintf(&tmBundle, TM_NLS_Get("0226"," Debug get fos data: prog_cred_level {0} arr_enrdata[dupcnt].prog_credential_level {1}\n"), prog_cred_level,arr_enrdata[dupcnt].prog_credential_level ); tmprintf(&tmBundle, TM_NLS_Get("0227"," Debug get fos data: prog_length {0} arr_enrdata[dupcnt].prog_length {1}\n"), prog_length,arr_enrdata[dupcnt].prog_length ); tmprintf(&tmBundle, TM_NLS_Get("0228"," Debug get fos data: hold_prog_status = {0}, arr_enrdata[dupcnt].prog_status {1}\n"),hold_prog_status,arr_enrdata[dupcnt].prog_status ); tmprintf(&tmBundle, TM_NLS_Get("0229"," Debug get fos data: Current Major Record Being processed sovlfos_majr_code = {0}, arr_enrdata[dupcnt].prog_majr_code {1}\n"),fos_majr_code,arr_enrdata[dupcnt].prog_majr_code ); #endif if (!tmstrcmp(prog_cipc_code,arr_enrdata[dupcnt].stud_majr1_cipc ) && !tmstrcmp(prog_cred_level,arr_enrdata[dupcnt].prog_credential_level ) && !tmstrcmp(prog_length,arr_enrdata[dupcnt].prog_length ) ) { /* begin dup checking */ /* if old is not G we want to replace, so set lfos cnt to the entry number so we replace the older array with the new entry for graduated. We dont want to increment the lfos cnter */ if (!tmstrcmp(hold_prog_status, _TMC("G"))){ lfos_dupcntcheck_cnt = dupcnt; tmstrcpy(lfosnew,_TMC("N")); break; } else { if (!tmstrcmp(hold_prog_status, _TMC("D")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("G")) ){ lfos_dupcntcheck_cnt = dupcnt; tmstrcpy(lfosnew,_TMC("N")); break; } else { if (!tmstrcmp(hold_prog_status, _TMC("F")) && (tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("G")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("D")) ) ){ lfos_dupcntcheck_cnt = dupcnt; tmstrcpy(lfosnew,_TMC("N")); break; } else { if (!tmstrcmp(hold_prog_status, _TMC("Q")) && ( tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("G")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("D")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("F")) ) ){ lfos_dupcntcheck_cnt = dupcnt; tmstrcpy(lfosnew,_TMC("N")); break; } else { if (!tmstrcmp(hold_prog_status, _TMC("H")) && ( tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("G")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("D")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("F")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("Q")) ) ){ lfos_dupcntcheck_cnt = dupcnt; tmstrcpy(lfosnew,_TMC("N")); break; } else { if (!tmstrcmp(hold_prog_status, _TMC("L")) && ( tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("G")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("D")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("F")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("Q")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("H")) ) ){ lfos_dupcntcheck_cnt = dupcnt; tmstrcpy(lfosnew,_TMC("N")); break; } else { if (!tmstrcmp(hold_prog_status, _TMC("A")) && (tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("G")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("D")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("F")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("Q")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("H")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("L")) ) ){ lfos_dupcntcheck_cnt = dupcnt; tmstrcpy(lfosnew,_TMC("N")); break; } else { if (!tmstrcmp(hold_prog_status, _TMC("W")) && ( tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("G")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("D")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("F")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("Q")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("H")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("L")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("A")) && tmstrcmp(arr_enrdata[dupcnt].prog_status, _TMC("")) /*8.10.7.1*/ ) ){ lfos_dupcntcheck_cnt = dupcnt; tmstrcpy(lfosnew,_TMC("N")); break; } else { tmstrcpy(lfosdup,_TMC("Y")); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0230"," Debug get fos data: Making lfosdup to {0}\n"),lfosdup); tmprintf(&tmBundle, TM_NLS_Get("0231"," Debug get fos data: lfosnew = {0}\n"),lfosnew); tmprintf(&tmBundle, TM_NLS_Get("0232"," Debug get fos data: lfos_dupcntcheck_cnt = {0,%1d}\n"),lfos_dupcntcheck_cnt); #endif } } } } } } } } } skip_match: tmfflush(tmstdout); } /*For loop */ /* if a new entry is added to arr_enrdata check the status */ /* if status is not graduated set the flag used in calc_overall_status */ #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0233"," Debug get fos data: For loop ended. setting flag logic pidm {0} lfosnew {1} lfosdup {2} status {3} skip_write {4} \n"), pidm, lfosnew, lfosdup, hold_prog_status, skip_write) ; tmprintf(&tmBundle, TM_NLS_Get("0234"," Debug get fos data: prog_begin_date {0}\n"),arr_enrdata[lfos_write].prog_begin_date); tmprintf(&tmBundle, TM_NLS_Get("0235"," Debug get fos data: lfos_cnt {0,%1d} lfos_write {1,%1d}\n"),lfos_cnt, lfos_write); #endif /* lfos is not a dup so we can either replace or add it new */ if (!tmstrcmp(skip_write, _TMC("N")) ) { if (!tmstrcmp(lfosdup, _TMC("N")) ){ if (!tmstrcmp(lfosnew, _TMC("Y"))) { lfos_write = lfos_cnt; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0236"," Debug get fos data: lfos_cnt {0,%1d} lfos_write {1,%1d}\n"),lfos_cnt, lfos_write); #endif } else { lfos_write = lfos_dupcntcheck_cnt; } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0237"," Debug get fos data: fos is not a dup so we can either replace or add it new \n")) ; tmprintf(&tmBundle, TM_NLS_Get("0238"," Debug get fos data: prog_begin_date {0}\n"),arr_enrdata[lfos_write].prog_begin_date); tmprintf(&tmBundle, TM_NLS_Get("0239"," Debug get fos data: stud_majr1_cipc {0}\n"),arr_enrdata[lfos_write].stud_majr1_cipc); tmprintf(&tmBundle, TM_NLS_Get("0240"," Debug get fos data: cred level {0}\n"),arr_enrdata[lfos_write].prog_credential_level); tmprintf(&tmBundle, TM_NLS_Get("0241"," Debug get fos data: prog_length {0}\n"),arr_enrdata[lfos_write].prog_length); #endif if (!tmstrcmp(prog_cipc_code,arr_enrdata[lfos_write].stud_majr1_cipc ) && !tmstrcmp(prog_cred_level,arr_enrdata[lfos_write].prog_credential_level ) && !tmstrcmp(prog_length,arr_enrdata[lfos_write].prog_length ) && (tmstrcmp(lfosnew, _TMC("Y")) )) /* to consider the case when major is not duplicate and is a new major, new array element has to filled*/ { /* Duplicate CIPC Code Scenario for Different Major */ if (tmstrcmp(prog_enr_stat_eff_date,arr_enrdata[lfos_write].prog_enr_stat_eff_date) < 0) { /* The lesser Date should be updated in Array */ tmstrcpy (arr_enrdata[lfos_write].prog_enr_stat_eff_date,prog_enr_stat_eff_date); } else{ /* No need to replace */ } if (tmstrcmp(prog_begin_date,arr_enrdata[lfos_write].prog_begin_date) < 0) { /* The lesser Date should be updated in Array */ tmstrcpy (arr_enrdata[lfos_write].prog_begin_date,prog_begin_date); } else{ /* No need to replace */ } } else { /* CIPC Codes are different for Different Major */ tmstrcpy (arr_enrdata[lfos_write].prog_enr_stat_eff_date,prog_enr_stat_eff_date); tmstrcpy (arr_enrdata[lfos_write].prog_begin_date,prog_begin_date); } tmstrcpy (arr_enrdata[lfos_write].prog_status,hold_prog_status); tmstrcpy (arr_enrdata[lfos_write].prog_term_code,fos_term_code); tmstrcpy (arr_enrdata[lfos_write].prog_current_ind,lcur_current_ind); tmstrcpy (arr_enrdata[lfos_write].stud_majr1_cipc,prog_cipc_code); tmstrcpy (arr_enrdata[lfos_write].prog_length,prog_length); tmstrcpy (arr_enrdata[lfos_write].prog_length_type, prog_length_type); tmstrcpy (arr_enrdata[lfos_write].prog_weeks_yr,prog_weeks_yr); tmstrcpy (arr_enrdata[lfos_write].special_prog_ind,special_prog_ind); tmstrcpy (arr_enrdata[lfos_write].prog_credential_level,prog_cred_level); tmstrcpy (arr_enrdata[lfos_write].prog_cipc_pub_year,prog_cipc_pub_year); tmstrcpy (arr_enrdata[lfos_write].prog_levl_code,prog_levl_code); tmstrcpy (arr_enrdata[lfos_write].prog_ceu_ind,lcur_levl_ceu_ind); tmstrcpy (arr_enrdata[lfos_write].prog_nondgr_ind,prog_nondgr_ind); tmstrcpy (arr_enrdata[lfos_write].prog_majr_code,prog_majr_code); tmstrcpy(hold_majr,arr_enrdata[lfos_write].prog_majr_code); tmstrcpy (arr_enrdata[lfos_write].end_start_date,end_start_date); tmstrcpy(arr_enrdata[lfos_write].save_lcur_seqno,fos_lcur_seqno); tmstrcpy(arr_enrdata[lfos_write].save_priority_no,fos_priority_no); tmstrcpy(arr_enrdata[lfos_write].save_dept_code,fos_dept_code); tmstrcpy(arr_enrdata[lfos_write].save_term_code_ctlg,fos_term_code_ctlg); tmstrcpy(arr_enrdata[lfos_write].save_lfos_rule,fos_lfos_rule); tmstrcpy(arr_enrdata[lfos_write].save_conc_attach_rule,fos_conc_attach_rule); tmstrcpy(arr_enrdata[lfos_write].save_start_date,fos_start_date); tmstrcpy(arr_enrdata[lfos_write].save_end_date,fos_end_date); tmstrcpy(arr_enrdata[lfos_write].curr_prog_start_date,lcur_prog_start_date); tmstrcpy(arr_enrdata[lfos_write].curr_prog_end_date,lcur_prog_end_date); tmstrcpy(arr_enrdata[lfos_write].curr_fos_start_date,fos_start_date); tmstrcpy(arr_enrdata[lfos_write].curr_fos_end_date,fos_end_date); if (*fos_term_code_end) { tmstrcpy(arr_enrdata[lfos_write].save_term_code_end,fos_term_code_end); } else { tmstrcpy(arr_enrdata[lfos_write].save_term_code_end,term_to_process); } tmstrcpy(arr_enrdata[lfos_write].save_tmst_code,fos_tmst_code); tmstrcpy(arr_enrdata[lfos_write].save_majr_code_attach,fos_majr_code_attach); tmstrcpy(arr_enrdata[lfos_write].save_term_code,fos_term_code); tmstrcpy(arr_enrdata[lfos_write].save_cact_code,fos_cact_code); tmstrcpy(arr_enrdata[lfos_write].save_csts_code,fos_csts_code); tmstrcpy(arr_enrdata[lfos_write].save_activity_date,fos_activity_date); check_cipc_code(); if ( ( c < 6 ) && (!tmstrcmp(missing_cipc_sw, _TMC("Y"))) ) { tmstrcpy(arr_missingcipc[c].missingcipc_majr_code,hold_majr); c++; } *hold_majr = '\0'; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0242"," Debug get fos data: second after insert in array major {0} start {1} eff {2} act {3} \n"), arr_enrdata[lfos_write].prog_majr_code, arr_enrdata[lfos_write].prog_begin_date, arr_enrdata[lfos_write].prog_enr_stat_eff_date , arr_enrdata[lfos_write].save_activity_date ); tmprintf(&tmBundle, TM_NLS_Get("0243"," Debug get fos data: second after insert in array lfos_write {0,%1d} lfos_cnt {1,%1d} \n"), lfos_write,lfos_cnt); #endif /* increment the counter if the lfos is new to the list */ if (!tmstrcmp(lfosnew, _TMC("Y"))){ lfos_cnt++; lfos_write++; } } /* record is not a dup */ else /* fos is a duplicate so its skipped writing in Arrays */ { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0244"," Debug get fos data: fos is a duplicate so its skipped writing in Arrays. \n")); tmprintf(&tmBundle, TM_NLS_Get("0245"," Debug get fos data: lfos_write is still not incremented. lfos_write = {0,%1d} \n"),lfos_write); tmprintf(&tmBundle, TM_NLS_Get("0246"," Debug get fos data: Replacing the Prog Start Date {0} and PSED {1} of Array Major {2} "), arr_enrdata[lfos_write].prog_begin_date,arr_enrdata[lfos_write].prog_enr_stat_eff_date,arr_enrdata[lfos_write].prog_majr_code); tmprintf(&tmBundle, TM_NLS_Get("0247"," when Current Looping Major {0} Prog Start Date {1} is lesser. Original PSED Based on Time Status of Current Looping Majr {2} \n"), prog_majr_code,prog_begin_date,orig_prog_enr_stat_eff_date_for_dup); tmprintf(&tmBundle, TM_NLS_Get("0248"," Modified PSED Based on Major End Date of Current Looping Majr {0} \n"), prog_enr_stat_eff_date); #endif if (tmstrcmp(prog_begin_date,arr_enrdata[lfos_write].prog_begin_date) < 0) { /* use the pgm start date which is Older from Old Major and the effective date also from Old Major*/ tmstrcpy (arr_enrdata[lfos_write].prog_begin_date,prog_begin_date); if (*orig_prog_enr_stat_eff_date_for_dup) { tmstrcpy (arr_enrdata[lfos_write].prog_enr_stat_eff_date,orig_prog_enr_stat_eff_date_for_dup); *orig_prog_enr_stat_eff_date_for_dup = '\0'; } else { tmstrcpy (arr_enrdata[lfos_write].prog_enr_stat_eff_date,prog_enr_stat_eff_date); } } } } /* skip_write check */ skip_fos: *hold_prog_status = '\0'; /* we need to save the start date of the term for a non current and active learner whose major is graduated and is a duplicate of a major that is being reported*/ if ( (!tmstrcmp(lcur_current_ind,_TMC("N"))) && (!tmstrcmp(prog_status,_TMC("G"))) ) { write_to_save_graduated_majors(); } } /* lfos count is > 0 */ } /* no rows */ } /* less then 6 */ EXEC SQL CLOSE c_sovlfos; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0249"," Debug get fos data: at end of fos \n")) ; tmprintf(&tmBundle, TM_NLS_Get("0250"," Debug get fos data: at end of fos lfos_cnt {0,%1d} \n"),lfos_cnt); #endif } static void write_to_save_graduated_majors(void) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0251"," Debug write to grad majors pidm {0} major {1} status {2} cipc {3} length {4} \n"), pidm,fos_majr_code,prog_status,prog_cipc_code,prog_length); tmprintf(&tmBundle, TM_NLS_Get("0252"," Debug write to grad majors cred levl {0} begin date {1} PSED {2} \n"), prog_cred_level,prog_begin_date,prog_enr_stat_eff_date); #endif if (grad_cnt < 10) { tmstrcpy(arr_gradmajr[grad_cnt].prog_enr_stat_eff_date,prog_enr_stat_eff_date); tmstrcpy(arr_gradmajr[grad_cnt].prog_status,prog_status); tmstrcpy(arr_gradmajr[grad_cnt].prog_term_code,fos_term_code); tmstrcpy(arr_gradmajr[grad_cnt].prog_begin_date,prog_begin_date); tmstrcpy(arr_gradmajr[grad_cnt].prog_cipc_code,prog_cipc_code); tmstrcpy(arr_gradmajr[grad_cnt].prog_majr_code,prog_majr_code); tmstrcpy(arr_gradmajr[grad_cnt].prog_length,prog_length); tmstrcpy(arr_gradmajr[grad_cnt].prog_credential_level,prog_cred_level); tmstrcpy(arr_gradmajr[grad_cnt].curr_prog_start_date,lcur_prog_start_date); tmstrcpy(arr_gradmajr[grad_cnt].curr_prog_end_date,lcur_prog_end_date); tmstrcpy(arr_gradmajr[grad_cnt].curr_fos_start_date,fos_start_date); tmstrcpy(arr_gradmajr[grad_cnt].curr_fos_end_date,fos_end_date); grad_cnt = grad_cnt + 1; } } static void load_duplicate_array(void) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0253"," Debug load dupl array: pidm {0} fos lcur seqno {1} majr {2} pgm status {3} \n"), pidm,fos_lcur_seqno,fos_majr_code, hold_prog_status); tmprintf(&tmBundle, TM_NLS_Get("0254"," Debug load dupl array: prog begin date {0} PSED {1} value of duparray cnt {2,%1d} \n"), prog_begin_date,prog_enr_stat_eff_date,duparray_cnt ); #endif if (duparray_cnt < 10) { tmstrcpy(arr_dupmajr[duparray_cnt].prog_enr_stat_eff_date,prog_enr_stat_eff_date); tmstrcpy(arr_dupmajr[duparray_cnt].prog_status,hold_prog_status); tmstrcpy(arr_dupmajr[duparray_cnt].prog_term_code,fos_term_code); tmstrcpy(arr_dupmajr[duparray_cnt].prog_current_ind,lcur_current_ind); tmstrcpy(arr_dupmajr[duparray_cnt].prog_begin_date,prog_begin_date); tmstrcpy(arr_dupmajr[duparray_cnt].stud_majr1_cipc,prog_cipc_code); tmstrcpy(arr_dupmajr[duparray_cnt].prog_length,prog_length); tmstrcpy(arr_dupmajr[duparray_cnt].prog_length_type, prog_length_type); tmstrcpy(arr_dupmajr[duparray_cnt].prog_weeks_yr,prog_weeks_yr); tmstrcpy(arr_dupmajr[duparray_cnt].special_prog_ind,special_prog_ind); tmstrcpy(arr_dupmajr[duparray_cnt].prog_credential_level,prog_cred_level); tmstrcpy(arr_dupmajr[duparray_cnt].prog_cipc_pub_year,prog_cipc_pub_year); tmstrcpy(arr_dupmajr[duparray_cnt].prog_levl_code,prog_levl_code); tmstrcpy(arr_dupmajr[duparray_cnt].prog_ceu_ind,lcur_levl_ceu_ind); tmstrcpy(arr_dupmajr[duparray_cnt].prog_nondgr_ind,prog_nondgr_ind); tmstrcpy(arr_dupmajr[duparray_cnt].prog_majr_code,prog_majr_code); tmstrcpy(arr_dupmajr[duparray_cnt].end_start_date,end_start_date); tmstrcpy(arr_dupmajr[duparray_cnt].save_lcur_seqno,fos_lcur_seqno); tmstrcpy(arr_dupmajr[duparray_cnt].save_priority_no,fos_priority_no); tmstrcpy(arr_dupmajr[duparray_cnt].save_dept_code,fos_dept_code); tmstrcpy(arr_dupmajr[duparray_cnt].save_term_code_ctlg,fos_term_code_ctlg); tmstrcpy(arr_dupmajr[duparray_cnt].save_lfos_rule,fos_lfos_rule); tmstrcpy(arr_dupmajr[duparray_cnt].save_conc_attach_rule,fos_conc_attach_rule); tmstrcpy(arr_dupmajr[duparray_cnt].save_start_date,fos_start_date); tmstrcpy(arr_dupmajr[duparray_cnt].save_end_date,fos_end_date); tmstrcpy(arr_dupmajr[duparray_cnt].save_term_code_end,fos_term_code_end); tmstrcpy(arr_dupmajr[duparray_cnt].save_tmst_code,fos_tmst_code); tmstrcpy(arr_dupmajr[duparray_cnt].save_majr_code_attach,fos_majr_code_attach); tmstrcpy(arr_dupmajr[duparray_cnt].save_term_code,fos_term_code); tmstrcpy(arr_dupmajr[duparray_cnt].save_cact_code,fos_cact_code); tmstrcpy(arr_dupmajr[duparray_cnt].save_csts_code,fos_csts_code); tmstrcpy(arr_dupmajr[duparray_cnt].save_activity_date,fos_activity_date); tmstrcpy(arr_dupmajr[duparray_cnt].curr_prog_start_date,lcur_prog_start_date); tmstrcpy(arr_dupmajr[duparray_cnt].curr_prog_end_date,lcur_prog_end_date); tmstrcpy(arr_dupmajr[duparray_cnt].curr_fos_start_date,fos_start_date); tmstrcpy(arr_dupmajr[duparray_cnt].curr_fos_end_date,fos_end_date); duparray_cnt = duparray_cnt + 1; } } static void review_majors(void) { newcnt = lfos_cnt; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0255"," Debug review major arr enrdata: pidm {0} lfos_cnt {1,%1d} value of newcnt {2,%1d} \n"), pidm,lfos_cnt,newcnt); #endif for(m = 0; (m < 10); m++) { if (!*arr_enrdata[m].prog_status) { break; } if (*arr_enrdata[m].prog_status) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0256"," Debug review major arr enrdata: pidm {0} majr {1} status {2} value of m {3,%1d} \n"), pidm,arr_enrdata[m].prog_majr_code,arr_enrdata[m].prog_status,m); #endif if (!tmstrcmp(arr_enrdata[m].prog_status,_TMC("G")) ) { for(p = 0; (p < 10); p++) { if (!*arr_dupmajr[p].stud_majr1_cipc) { break; } if (*arr_dupmajr[p].stud_majr1_cipc) { if ( (!tmstrcmp(arr_dupmajr[p].stud_majr1_cipc,arr_enrdata[m].stud_majr1_cipc ) && !tmstrcmp(arr_dupmajr[p].prog_credential_level,arr_enrdata[m].prog_credential_level ) && !tmstrcmp(arr_dupmajr[p].prog_length,arr_enrdata[m].prog_length ) ) && (tmstrcmp(arr_dupmajr[p].prog_status,_TMC("G")) && tmstrcmp(arr_dupmajr[p].prog_status,_TMC("W")) ) ) { /* write out dupmajr time status to arr_enrdata */ #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0257"," Debug review majors: writing out new entry majr {0} cipc {1} status {2} PSED {3} \n"), arr_dupmajr[p].prog_majr_code, arr_dupmajr[p].stud_majr1_cipc,arr_dupmajr[p].prog_status,arr_dupmajr[p].prog_enr_stat_eff_date); tmprintf(&tmBundle, TM_NLS_Get("0258"," Debug review majors: writing out new entry prior dupmajr PSED {0} enrdata PSED {1} save date {2} \n"), arr_dupmajr[p].prog_enr_stat_eff_date, arr_enrdata[m].prog_enr_stat_eff_date,save_grad_status_date); #endif tmstrcpy(save_grad_status_date,arr_enrdata[m].prog_enr_stat_eff_date); update_status_date(); tmstrcpy(arr_dupmajr[p].prog_enr_stat_eff_date,save_grad_status_date); add_to_arr_enrdata(); } /* end dupl if */ } /* end null check p */ }/* end p loop */ } /* end G if */ } /* end null check m*/ } /* end for m loop */ } static void add_to_arr_enrdata(void) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0259"," Debug add to arr enrdata: pidm {0} lfos_cnt {1,%1d} value of newcnt {2,%1d} value of p {3,%1d} \n"), pidm,lfos_cnt,newcnt,p); tmprintf(&tmBundle, TM_NLS_Get("0260"," Debug add to arr enrdata: majr {0} status {1} PSED {2} \n"), arr_dupmajr[p].prog_majr_code,arr_dupmajr[p].prog_status,arr_dupmajr[p].prog_enr_stat_eff_date); #endif if (newcnt < 10) { tmstrcpy(arr_enrdata[newcnt].prog_enr_stat_eff_date,arr_dupmajr[p].prog_enr_stat_eff_date); tmstrcpy(arr_enrdata[newcnt].prog_status,arr_dupmajr[p].prog_status); tmstrcpy(arr_enrdata[newcnt].prog_term_code,arr_dupmajr[p].prog_term_code); tmstrcpy(arr_enrdata[newcnt].prog_current_ind,arr_dupmajr[p].prog_current_ind); tmstrcpy(arr_enrdata[newcnt].prog_begin_date,arr_dupmajr[p].prog_begin_date); tmstrcpy(arr_enrdata[newcnt].stud_majr1_cipc,arr_dupmajr[p].stud_majr1_cipc); tmstrcpy(arr_enrdata[newcnt].prog_length,arr_dupmajr[p].prog_length); tmstrcpy(arr_enrdata[newcnt].prog_length_type,arr_dupmajr[p].prog_length_type); tmstrcpy(arr_enrdata[newcnt].prog_weeks_yr,arr_dupmajr[p].prog_weeks_yr); tmstrcpy(arr_enrdata[newcnt].special_prog_ind,arr_dupmajr[p].special_prog_ind); tmstrcpy(arr_enrdata[newcnt].prog_credential_level,arr_dupmajr[p].prog_credential_level); tmstrcpy(arr_enrdata[newcnt].prog_cipc_pub_year,arr_dupmajr[p].prog_cipc_pub_year); tmstrcpy(arr_enrdata[newcnt].prog_levl_code,arr_dupmajr[p].prog_levl_code); tmstrcpy(arr_enrdata[newcnt].prog_ceu_ind,arr_dupmajr[p].prog_ceu_ind); tmstrcpy(arr_enrdata[newcnt].prog_nondgr_ind,arr_dupmajr[p].prog_nondgr_ind); tmstrcpy(arr_enrdata[newcnt].prog_majr_code,arr_dupmajr[p].prog_majr_code); tmstrcpy(arr_enrdata[newcnt].end_start_date,arr_dupmajr[p].end_start_date); tmstrcpy(arr_enrdata[newcnt].save_lcur_seqno,arr_dupmajr[p].save_lcur_seqno); tmstrcpy(arr_enrdata[newcnt].save_priority_no,arr_dupmajr[p].save_priority_no); tmstrcpy(arr_enrdata[newcnt].save_dept_code,arr_dupmajr[p].save_dept_code); tmstrcpy(arr_enrdata[newcnt].save_term_code_ctlg,arr_dupmajr[p].save_term_code_ctlg); tmstrcpy(arr_enrdata[newcnt].save_lfos_rule,arr_dupmajr[p].save_lfos_rule); tmstrcpy(arr_enrdata[newcnt].save_conc_attach_rule,arr_dupmajr[p].save_conc_attach_rule); tmstrcpy(arr_enrdata[newcnt].save_start_date,arr_dupmajr[p].save_start_date); tmstrcpy(arr_enrdata[newcnt].save_end_date,arr_dupmajr[p].save_end_date); tmstrcpy(arr_enrdata[newcnt].save_term_code_end,arr_dupmajr[p].save_term_code_end); tmstrcpy(arr_enrdata[newcnt].save_tmst_code,arr_dupmajr[p].save_tmst_code); tmstrcpy(arr_enrdata[newcnt].save_majr_code_attach,arr_dupmajr[p].save_majr_code_attach); tmstrcpy(arr_enrdata[newcnt].save_term_code,arr_dupmajr[p].save_term_code); tmstrcpy(arr_enrdata[newcnt].save_cact_code,arr_dupmajr[p].save_cact_code); tmstrcpy(arr_enrdata[newcnt].save_csts_code,arr_dupmajr[p].save_csts_code); tmstrcpy(arr_enrdata[newcnt].save_activity_date,arr_dupmajr[p].save_activity_date); tmstrcpy(arr_enrdata[newcnt].curr_prog_start_date,arr_dupmajr[p].curr_prog_start_date); tmstrcpy(arr_enrdata[newcnt].curr_prog_end_date,arr_dupmajr[p].curr_prog_end_date); tmstrcpy(arr_enrdata[newcnt].curr_fos_start_date,arr_dupmajr[p].curr_fos_start_date); tmstrcpy(arr_enrdata[newcnt].curr_fos_end_date,arr_dupmajr[p].curr_fos_end_date); newcnt = newcnt +1; lfos_cnt = lfos_cnt +1; } } static void update_status_date(void) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0261"," Debug update status date: pidm {0} PSED {1} \n"),pidm,save_grad_status_date); #endif EXEC SQL EXECUTE DECLARE conv_date DATE; CURSOR date_cursor IS SELECT TO_DATE(:save_grad_status_date:Ind_01,'YYYYMMDD') FROM DUAL; BEGIN OPEN date_cursor; FETCH date_cursor into conv_date; CLOSE date_cursor; conv_date := conv_date + 1; SELECT TO_CHAR(conv_date,'YYYYMMDD') INTO :save_grad_status_date:Ind_01 FROM DUAL; END; END-EXEC; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0262"," Debug after update status date: pidm {0} PSED {1} \n"),pidm,save_grad_status_date); #endif } /* this function is for debugging only */ static void list_out_array(void) { for(x1 = 0; (x1 < 10); x1++) { tmprintf(&tmBundle, TM_NLS_Get("0263"," Debug look at major array at end of student : pidm {0} majr {1} status {2} PSED {3} \n"), pidm,arr_enrdata[x1].prog_majr_code,arr_enrdata[x1].prog_status,arr_enrdata[x1].prog_enr_stat_eff_date); } } static void check_for_duplicate_graduated_status(void) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0264"," Debug check_for_duplicate_graduated_status: pidm {0} \n"),pidm); #endif for(q = 0; (q < 10); q++) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0265"," Debug check_for_duplicate inside Q loop arr_gradmajr[q].prog_status {0} value of q {1,%1d} \n"), arr_gradmajr[q].prog_status,q); tmprintf(&tmBundle, TM_NLS_Get("0266"," Debug check_for_duplicate inside Q loop arr_gradmajr[q].prog_majr_code {0} \n"), arr_gradmajr[q].prog_majr_code); #endif if (!*arr_gradmajr[q].prog_status) { break; } if (*arr_gradmajr[q].prog_status) { for(r = 0; (r < 10); r++) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0267"," Debug check_for_duplicate inside R loop arr_enrdata[r].prog_credential_level {0} value of r {1,%1d} \n"), arr_enrdata[r].prog_credential_level,r); #endif if (!*arr_enrdata[r].prog_credential_level) { break; } if ( (!tmstrcmp(arr_gradmajr[q].prog_cipc_code,arr_enrdata[r].stud_majr1_cipc ) && !tmstrcmp(arr_gradmajr[q].prog_credential_level,arr_enrdata[r].prog_credential_level ) && !tmstrcmp(arr_gradmajr[q].prog_length,arr_enrdata[r].prog_length ) && tmstrcmp(arr_gradmajr[q].prog_majr_code,arr_enrdata[r].prog_majr_code) ) && (!tmstrcmp(arr_gradmajr[q].prog_status,_TMC("G")) ) ) { tmstrcpy(arr_enrdata[r].prog_begin_date,arr_gradmajr[q].prog_begin_date); tmstrcpy(save_grad_status_date,arr_gradmajr[q].prog_enr_stat_eff_date); update_status_date(); tmstrcpy(arr_enrdata[r].prog_enr_stat_eff_date,save_grad_status_date); } /* end if */ } /* r loop */ } /* if prog status */ } /* q loop */ } /* get the last enrollment for student before the report term */ static void get_last_enrollment(void) { *last_enrollment_term='\0'; EXEC SQL EXECUTE DECLARE pkg_last_enrollment_term stvterm.stvterm_code%type; BEGIN sfkenrl.p_find_last_enrollment(:pidm,:term_to_process,:rptname,:sessionid,pkg_last_enrollment_term); if pkg_last_enrollment_term is not null then :last_enrollment_term:Ind_01 := pkg_last_enrollment_term; else :last_enrollment_term:Ind_01 := ''; end if; END; END-EXEC; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0268"," Debug get last enrollment: {0} \n"), last_enrollment_term) ; #endif } static void check_cipc_code(void) { tmstrcpy(missing_cipc_sw,_TMC("N")); EXEC SQL DECLARE c_stvmajr CURSOR FOR SELECT stvmajr_code FROM stvmajr WHERE stvmajr_code = :hold_majr AND stvmajr_cipc_code is NULL; EXEC SQL OPEN c_stvmajr; POSTORA; EXEC SQL FETCH c_stvmajr INTO :hold_majr:Ind_01; POSTORA; if (ROWS_FOUND ) { tmstrcpy(missing_cipc_sw,_TMC("Y")); } EXEC SQL CLOSE c_stvmajr; POSTORA; } static int get_program_status(void) { *prog_status = '\0'; *end_start_date = '\0'; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0269"," Debug get_program_status: Before check_student_deceased(). prog_enr_stat_eff_date {0} \n"),prog_enr_stat_eff_date); #endif check_student_deceased(); if (!tmstrcmp(prog_status, _TMC("D")) ) { return TRUE;} #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0270"," Debug get_program_status: Student not deceased. lcur_current_ind {0} \n"),lcur_current_ind); #endif if (!tmstrcmp(lcur_current_ind, _TMC("Y")) ) /* if current */ { check_student_graduated(); if (!tmstrcmp(prog_status, _TMC("G"))) { return TRUE;} else { check_stud_apprv_leave(); if (*prog_status) { return TRUE; } else { check_student_withdrawn(); if (*prog_status) { return TRUE; } else { tmstrcpy(date_type,_TMC("S")); tmstrcpy(use_date, sel_date); tmstrcpy(use_time, sel_time); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0271"," Debug: report 2, sel fulltime3 use date {0} \n"), use_date); #endif sel_full_half_status(); tmstrcpy(prog_status, nslc_fhl_code); if ( compare(usecurrstartenddatesflag,_TMC("Y"),EQS) ) { if ( (*fhl_date) && (*prog_status) ) { if ( (tmstrcmp(fos_start_date,fhl_date) > 0) && (*fos_start_date) ) { tmstrcpy(prog_enr_stat_eff_date, fos_start_date); return TRUE; } else if ( (tmstrcmp(lcur_prog_start_date,fhl_date) > 0) && (*lcur_prog_start_date) ) { tmstrcpy(prog_enr_stat_eff_date, lcur_prog_start_date); return TRUE; } } } if (*prog_status) /* When prog_status IS NOT NULL */ { tmstrcpy(prog_enr_stat_eff_date,fhl_date); } return TRUE; } } } } else /* if not current */ { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0272"," Debug get_program_status: Student not deceased. lcur_current_ind {0} not current. lcur_term_code_end {1} \n"),lcur_current_ind,lcur_term_code_end); #endif if (*lcur_term_code_end) { /* check to see if student graduated in a previous term */ check_student_graduated(); if (!tmstrcmp(prog_status, _TMC("G"))) { return TRUE;} EXEC SQL DECLARE c_stvterm CURSOR FOR SELECT TO_CHAR(stvterm_start_date,'YYYYMMDD') FROM stvterm WHERE stvterm_code = :lcur_term_code_end; EXEC SQL OPEN c_stvterm; POSTORA; EXEC SQL FETCH c_stvterm INTO :end_start_date:Ind_01; POSTORA; EXEC SQL CLOSE c_stvterm; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0273"," Debug get_program_status: When lcur_term_code_end Not Null.fos_end_date {0} lcur_prog_end_date {1} fos_term_code {2} \n"),fos_end_date,lcur_prog_end_date,fos_term_code); #endif if ( compare(usecurrstartenddatesflag,_TMC("Y"),EQS) ) { sel_full_half_status_for_term_code(fos_term_code); tmstrcpy(prog_status,_TMC("W")); if ( (*fhl_date_for_term_code) && (*nslc_fhl_code_for_term_code) ) { if ( (tmstrcmp(fos_end_date,fhl_date_for_term_code) > 0) && (*fos_end_date) ) { tmstrcpy(prog_enr_stat_eff_date, fos_end_date); tmstrcpy(end_start_date, fos_end_date); return TRUE; } else if ( (tmstrcmp(lcur_prog_end_date,fhl_date_for_term_code) > 0) && (*lcur_prog_end_date) ) { tmstrcpy(prog_enr_stat_eff_date, lcur_prog_end_date); tmstrcpy(end_start_date, lcur_prog_end_date); return TRUE; } else { tmstrcpy(prog_enr_stat_eff_date,fhl_date_for_term_code); tmstrcpy(end_start_date, fhl_date_for_term_code); return TRUE; } } } /* when none of above conditions will satisfy and control reaches here.prog_enr_stat_eff_date will be based on STVTERM */ #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0274"," Debug get_program_status: 1: FOS and LCUR End Dates not avalable. Setting Prog Status to W and prog_enr_stat_eff_date {0} Based on STVTERM of {1} \n"),end_start_date,lcur_term_code_end); #endif tmstrcpy(prog_status,_TMC("W")); tmstrcpy(prog_enr_stat_eff_date,end_start_date); return TRUE; /* if ( ( compare(usecurrstartenddatesflag,_TMC("Y"),EQS) ) && ( (*fos_end_date) || (*lcur_prog_end_date) ) ) { tmstrcpy(prog_status,_TMC("W")); if (*fos_end_date) { tmstrcpy(prog_enr_stat_eff_date,fos_end_date); tmstrcpy(end_start_date, fos_end_date); return TRUE; } else { tmstrcpy(prog_enr_stat_eff_date,lcur_prog_end_date); tmstrcpy(end_start_date, lcur_prog_end_date); return TRUE; } } else { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("7705"," Debug get_program_status: 1: FOS and LCUR End Dates not avalable. Setting Prog Status to W and prog_enr_stat_eff_date {0} Based on STVTERM of {1} \n"),end_start_date,lcur_term_code_end); #endif tmstrcpy(prog_status,_TMC("W")); tmstrcpy(prog_enr_stat_eff_date,end_start_date); return TRUE; } */ } else { /* check to see if the student graduated in a previous term and there is no end term on the learner */ #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0275"," Debug get_program_status: check to see if the student graduated in a previous term and there is no end term on the learner \n")); #endif check_student_graduated(); if (!tmstrcmp(prog_status, _TMC("G"))) { return TRUE;} #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0276"," Debug get_program_status: Student not Graduated. fos_end_date {0}, lcur_prog_end_date {1} \n"),fos_end_date,lcur_prog_end_date); #endif if ( ( compare(usecurrstartenddatesflag,_TMC("Y"),EQS) ) && ( (*fos_end_date) || (*lcur_prog_end_date) ) ) { tmstrcpy(prog_status,_TMC("W")); if (*fos_end_date) { tmstrcpy(prog_enr_stat_eff_date,fos_end_date); return TRUE; } else { tmstrcpy(prog_enr_stat_eff_date,lcur_prog_end_date); return TRUE; } } else { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0277"," Debug get_program_status: 2: FOS and LCUR End Dates Not available. Setting prog_status {0} \n"),prog_status); tmprintf(&tmBundle, TM_NLS_Get("0278"," Debug get_program_status: 3: FOS and LCUR ENd Dates Not available. Setting lcur_activity_date_update {0} prog_enr_stat_eff_date=lcur_activity_date_update \n"),lcur_activity_date_update); #endif tmstrcpy(prog_status,_TMC("W")); tmstrcpy(prog_enr_stat_eff_date,lcur_activity_date_update); return TRUE; } } } } static void check_student_graduated(void) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0279"," Debug: check_student_graduated pidm {0} fos major code {1} \n"),pidm,fos_majr_code);; tmprintf(&tmBundle, TM_NLS_Get("0280"," Debug: check_student_graduated lcur camp {0} lcur acat code {1}\n"), lcur_camp_code,lcur_acat_code); #endif *prog_grad_ind = '\0'; *prog_grad_date = '\0'; *grad_term = '\0'; *grad_term_end_date = '\0'; EXEC SQL EXECUTE DECLARE CURSOR degree_c IS SELECT 'Y' , TO_CHAR(SHRDGMR_GRAD_DATE,'YYYYMMDD'), SHRDGMR_TERM_CODE_GRAD FROM stvdegs, stvdegc, sovlfos degm, sovlcur degr, shrdgmr WHERE degr.sovlcur_pidm = :pidm AND COALESCE(degr.sovlcur_camp_code,'#') = COALESCE(:lcur_camp_code,'#') AND degr.sovlcur_lmod_code = sb_curriculum_str.f_outcome AND degr.sovlcur_current_ind = 'Y' AND degr.sovlcur_active_ind = 'Y' AND shrdgmr_pidm = degr.sovlcur_pidm AND degr.sovlcur_key_seqno = shrdgmr_seq_no AND stvdegs_code = shrdgmr_degs_code AND stvdegs_award_status_ind = 'A' AND stvdegc_code = degr.sovlcur_degc_code and COALESCE(stvdegc_acat_code,'99') = COALESCE(:lcur_acat_code,'99') AND degm.sovlfos_pidm = :pidm AND degm.sovlfos_lcur_seqno = degr.sovlcur_seqno AND degm.sovlfos_lfst_code = sb_fieldofstudy_str.f_major AND degm.sovlfos_seqno = ( SELECT MAX(m.sovlfos_seqno) FROM sovlfos m WHERE m.sovlfos_pidm = degm.sovlfos_pidm AND m.sovlfos_lcur_seqno = degr.sovlcur_seqno AND m.sovlfos_lfst_code = sb_fieldofstudy_str.f_major AND m.sovlfos_majr_code = :fos_majr_code); BEGIN OPEN degree_c; FETCH degree_c INTO :prog_grad_ind:Ind_01, :prog_grad_date:Ind_02, :grad_term:Ind_03; CLOSE degree_c; END; END-EXEC; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0281"," Debug: check_student_graduated lcur current {0} prog grad ind {1} grad term {2}\n"), lcur_current_ind,prog_grad_ind,grad_term); #endif if (!tmstrcmp(lcur_current_ind, _TMC("Y")) ) { if (!tmstrcmp(prog_grad_ind,_TMC("Y"))) { if ((!tmstrcmp(grad_term,term_to_process)) || (!tmstrcmp(grad_term,_TMC("")))) { tmstrcpy(prog_status,_TMC("G")); if(*prog_grad_date) { tmstrcpy(prog_enr_stat_eff_date,prog_grad_date); } else { tmstrcpy(prog_enr_stat_eff_date,_TMC("")); } tmstrcpy(arr_enrdata[lfos_cnt].prog_grad_term,grad_term); } } /* end prog grad ind */ } /* end current ind */ if (tmstrcmp(lcur_current_ind, _TMC("Y")) ) /* process non current graduate program */ { if (!tmstrcmp(prog_grad_ind,_TMC("Y"))) { if (tmstrcmp(grad_term,_TMC("")) ) { tmstrcpy(prog_status,_TMC("G")); if(*prog_grad_date) { tmstrcpy(prog_enr_stat_eff_date,prog_grad_date); } else { tmstrcpy(prog_enr_stat_eff_date,_TMC("")); } tmstrcpy(arr_enrdata[lfos_cnt].prog_grad_term,grad_term); } } /* end prog grad ind */ } /* end current ind */ } /* Determine if student has (W)ithdrawn */ static void check_student_withdrawn(void) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0282"," Debug inside check_student_withdrawn() Student pidm = {0} ,check_scpreg_flag = {1} ,Term= {2} ,scps_code = {3}\n"),pidm, check_scpreg_flag,term,scps_code); #endif *withdraw_date = '\0'; EXEC SQL DECLARE c_withdrawn CURSOR FOR SELECT STVESTS_THIRD_PARTY_WD_IND, TO_CHAR(MAX(SFBETRM_ESTS_DATE),'YYYYMMDD') FROM SFBETRM,STVESTS WHERE STVESTS_CODE = SFBETRM_ESTS_CODE AND SFBETRM_PIDM = :pidm AND ((:check_scpreg_flag='Y' AND SFBETRM_TERM_CODE IN (SELECT SORSCPT_TERM_CODE FROM SORSCPT WHERE SORSCPT_SCPS_CODE=:scps_code)) OR (:check_scpreg_flag='N' AND SFBETRM_TERM_CODE = :term)) AND STVESTS_THIRD_PARTY_WD_IND = 'Y' GROUP BY STVESTS_THIRD_PARTY_WD_IND; EXEC SQL DECLARE c_withdrawn_date CURSOR FOR SELECT TO_CHAR(MAX(SFRWDRL_EFF_WDRL_DATE),'YYYYMMDD') FROM SFRWDRL WHERE SFRWDRL_PIDM = :pidm AND ((:check_scpreg_flag='Y' AND SFRWDRL_TERM_CODE IN (SELECT SORSCPT_TERM_CODE FROM SORSCPT WHERE SORSCPT_SCPS_CODE=:scps_code)) OR (:check_scpreg_flag='N' AND SFRWDRL_TERM_CODE = :term)) AND SFRWDRL_SEQ_NO = (SELECT MAX(SFRWDRL_SEQ_NO) FROM SFRWDRL WHERE SFRWDRL_PIDM = :pidm AND ((:check_scpreg_flag='Y' AND SFRWDRL_TERM_CODE IN (SELECT SORSCPT_TERM_CODE FROM SORSCPT WHERE SORSCPT_SCPS_CODE=:scps_code)) OR (:check_scpreg_flag='N' AND SFRWDRL_TERM_CODE = :term))); EXEC SQL OPEN c_withdrawn; POSTORA; EXEC SQL FETCH c_withdrawn INTO :withdraw_ind:Ind_01, :withdraw_date:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) { *withdraw_ind = '\0'; *withdraw_date = '\0'; EXEC SQL CLOSE c_withdrawn; POSTORA; } else { if ( *withdraw_ind ) { EXEC SQL CLOSE c_withdrawn; POSTORA; tmstrcpy(prog_status,_TMC("W")); if (!tmstrcmp(eff_wdrl_ind,_TMC("Y"))) { EXEC SQL OPEN c_withdrawn_date; POSTORA; EXEC SQL FETCH c_withdrawn_date INTO :eff_wdrl_date:Ind_03; POSTORA; if ( !*eff_wdrl_date ) { *eff_wdrl_date = '\0'; EXEC SQL CLOSE c_withdrawn_date; POSTORA; } else { tmstrcpy(withdraw_date,eff_wdrl_date); EXEC SQL CLOSE c_withdrawn_date; POSTORA; } } } if(*withdraw_date) { tmstrcpy(prog_enr_stat_eff_date,withdraw_date); } else { tmstrcpy(prog_enr_stat_eff_date,_TMC("")); } } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0283"," Debug inside check_student_withdrawn() Student withdraw_ind = {0} ,withdraw_date = {1} ,prog_status= {2} ,eff_wdrl_ind = {3}\n"),withdraw_ind, withdraw_date,prog_status,eff_wdrl_ind); tmprintf(&tmBundle, TM_NLS_Get("0284"," Debug inside check_student_withdrawn() Student prog_enr_stat_eff_date = {0} ,eff_wdrl_date = {1}\n"),prog_enr_stat_eff_date, eff_wdrl_date); #endif } static void check_student_deceased(void) { /* Determine if student is (D)eceased */ EXEC SQL BEGIN DECLARE SECTION; static TMCHAR dead_ind[2]={0}; EXEC SQL END DECLARE SECTION; EXEC SQL DECLARE c_deceased CURSOR FOR SELECT SPBPERS_DEAD_IND, TO_CHAR(SPBPERS_DEAD_DATE,'YYYYMMDD') FROM SPBPERS WHERE SPBPERS_PIDM = :pidm AND SPBPERS_DEAD_IND = 'Y'; EXEC SQL OPEN c_deceased; POSTORA; EXEC SQL FETCH c_deceased INTO :dead_ind:Ind_01, :dead_date:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) { *dead_ind = '\0'; *dead_date = '\0'; EXEC SQL CLOSE c_deceased; POSTORA; } if (*dead_ind) { tmstrcpy(prog_status,_TMC("D")); EXEC SQL CLOSE c_deceased; POSTORA; if(*dead_date) { tmstrcpy(prog_enr_stat_eff_date,dead_date); } else { tmstrcpy(prog_enr_stat_eff_date,_TMC("")); } } } static void check_stud_apprv_leave(void) { /* Determine if student has an approved leave of (A)bsence */ EXEC SQL DECLARE c_appr_leave CURSOR FOR SELECT 'A',TO_CHAR(SGBSTDN_LEAV_FROM_DATE,'YYYYMMDD') FROM SGBSTDN,STVLEAV WHERE SGBSTDN_PIDM = :pidm AND SGBSTDN_TERM_CODE_EFF = (SELECT MAX(SGBSTDN_TERM_CODE_EFF) FROM SGBSTDN WHERE SGBSTDN_PIDM = :pidm AND SGBSTDN_TERM_CODE_EFF <= :term) AND SGBSTDN_LEAV_CODE = STVLEAV_CODE AND STVLEAV_THIRD_PARTY_REPORT_IND = 'Y' AND SGBSTDN_LEAV_FROM_DATE <= TO_DATE(:sel_date,G$_DATE.GET_NLS_DATE_FORMAT) AND SGBSTDN_LEAV_TO_DATE >= TO_DATE(:sel_date,G$_DATE.GET_NLS_DATE_FORMAT); EXEC SQL OPEN c_appr_leave; POSTORA; EXEC SQL FETCH c_appr_leave INTO :leave_ind:Ind_01, :leave_date:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) { *leave_ind = '\0'; *leave_date = '\0'; EXEC SQL CLOSE c_appr_leave; POSTORA; } if ( *leave_ind ) { tmstrcpy(prog_status,_TMC("A")); EXEC SQL CLOSE c_appr_leave; POSTORA; if(*leave_date) { tmstrcpy(prog_enr_stat_eff_date,leave_date); } else { tmstrcpy(prog_enr_stat_eff_date,_TMC("")); } } } static void fill_status_order() { tmstrcpy (arr_statord[0].status,_TMC("D")); tmstrcpy (arr_statord[1].status,_TMC("F")); tmstrcpy (arr_statord[2].status,_TMC("Q")); tmstrcpy (arr_statord[3].status,_TMC("H")); tmstrcpy (arr_statord[4].status,_TMC("L")); tmstrcpy (arr_statord[5].status,_TMC("G")); tmstrcpy (arr_statord[6].status,_TMC("A")); tmstrcpy (arr_statord[7].status,_TMC("W")); } static void calc_overall_status() { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0285"," Debug calc overall status: pidm {0} status {1} \n"),pidm,stud_status); #endif static TMCHAR last_prog_status[2]={0}; int i =0; int j = 0; int last_match_counter = -1; for(i = 0; i < lfos_cnt; i++) { for(j=0;j< 8;j++) { if ( (!*arr_enrdata[i].prog_status) && ( i == 0 ) ) { tmstrcpy (stud_status,arr_enrdata[i].prog_status); tmstrcpy (stud_cipc_code,arr_enrdata[i].stud_majr1_cipc); tmstrcpy (stud_status_date,arr_enrdata[i].prog_enr_stat_eff_date); tmstrcpy (stud_grad_term,arr_enrdata[i].prog_grad_term); tmstrcpy (stud_levl_code,arr_enrdata[i].prog_levl_code); tmstrcpy (stud_credential_level,arr_enrdata[i].prog_credential_level); last_match_counter = j; i = lfos_cnt +1; } else { if (!tmstrcmp(arr_enrdata[i].prog_status,arr_statord[j].status)) { if(( j < last_match_counter) || (last_match_counter == -1)) { tmstrcpy (stud_status,arr_enrdata[i].prog_status); tmstrcpy (stud_cipc_code,arr_enrdata[i].stud_majr1_cipc); tmstrcpy (stud_status_date,arr_enrdata[i].prog_enr_stat_eff_date); tmstrcpy (stud_grad_term,arr_enrdata[i].prog_grad_term); tmstrcpy (stud_levl_code,arr_enrdata[i].prog_levl_code); tmstrcpy (stud_credential_level,arr_enrdata[i].prog_credential_level); last_match_counter = j; break; } else { break; } } } } } } static int selmajr_1_2_cipccode(int mode) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0286"," Debug selmajr_1_2_cipccode: pidm {0} learner seqno {1}\n"),pidm,curriculam_seqno); #endif EXEC SQL DECLARE cursor_402 CURSOR FOR SELECT lfos.majrcode, lfos.lcurseq, lfos.lfosseq, rownum FROM ( SELECT sovlfos_majr_code majrcode, sovlfos_lcur_seqno lcurseq, sovlfos_seqno lfosseq FROM sovlfos WHERE sovlfos_pidm = :pidm AND sovlfos_lcur_seqno = :curriculam_seqno AND sovlfos_current_ind = 'Y' AND sovlfos_active_ind = 'Y' AND sovlfos_lfst_code=sb_fieldofstudy_str.f_major ORDER BY sovlfos_priority_no, sovlfos_seqno desc )lfos; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_402; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_402; POSTORA; } EXEC SQL FETCH cursor_402 INTO :majr_code:Ind_01, :majr_lcur_seqno:Ind_03, :majr_lfos_seqno:Ind_04, :row_num:Ind_02; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0287"," Debug selmajr_1_2_cipccode getting next row : pidm {0} majr {1} lfos_seq {2}\n"), pidm,majr_code,majr_lfos_seqno); #endif if ( NO_ROWS_FOUND ) { *majr_code='\0'; *row_num='\0'; *majr_lcur_seqno='\0'; *majr_lfos_seqno='\0'; return FALSE; } for(m = 0; (m < 6); m++) { if (*arr_nondgrdata[m].nondgr_majr_code) { if ( (!tmstrcmp(arr_nondgrdata[m].nondgr_lcur_seqno,majr_lcur_seqno)) && (!tmstrcmp(arr_nondgrdata[m].nondgr_lfos_seqno,majr_lfos_seqno)) && (!tmstrcmp(arr_nondgrdata[m].nondgr_majr_code,majr_code)) ) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0288"," Debug selmajr_1_2_cipccode reset for non degree: pidm {0} majr {1} lfos_seq {2}\n"),pidm,majr_code,majr_lfos_seqno); #endif *majr_code = '\0'; *row_num = '\0'; *majr_lcur_seqno='\0'; *majr_lfos_seqno='\0'; } } } return TRUE; } static void sel_majrcipc_desc(void) { /*To fetch majr 1 & 2 desc and CIPC code*/ EXEC SQL DECLARE cursor_desc CURSOR FOR SELECT regexp_replace(shksels.f_stvmajr_value(:majr_code_1,'D'),'[^[:alnum:]'' '']',' ')majr1, shksels.f_stvmajr_value(:majr_code_1,'C')majr1cipc, regexp_replace(shksels.f_stvmajr_value(:majr_code_2,'D'),'[^[:alnum:]'' '']',' ')majr2, shksels.f_stvmajr_value(:majr_code_2,'C')majr2cipc FROM DUAL; EXEC SQL OPEN cursor_desc; POSTORA; EXEC SQL FETCH cursor_desc INTO :stud_majr1:Ind_01, :stud_majr1_cipc:Ind_02, :stud_majr2:Ind_03, :stud_majr2_cipc:Ind_04; POSTORA; if (NO_ROWS_FOUND) { *stud_majr1='\0'; *stud_majr1_cipc='\0'; *stud_majr2='\0'; *stud_majr2_cipc='\0'; } EXEC SQL CLOSE cursor_desc; POSTORA; if (!tmstrcmp(run_mode,_TMC("1"))) { if (!tmstrcmp(stud_majr1_cipc,_TMC(""))) { tmstrcpy(err_majr1,majr_code_1); } else { *err_majr1='\0'; } } if (!tmstrcmp(run_mode,_TMC("1"))) { if (!tmstrcmp(stud_majr2_cipc,_TMC(""))) { tmstrcpy(err_majr2,majr_code_2); } else { *err_majr2='\0'; } } } static void fetch_major_data(void) { *curriculam_seqno = '\0'; *majr_code_1 = '\0'; *majr_code_2 = '\0'; l_cnt = 0; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0289"," Debug fetch_major_data: pidm {0}\n"),pidm); #endif if(*pidm) { EXEC SQL EXECUTE BEGIN soklcur.p_create_sotvcur(p_pidm => :pidm, p_lmod_code => sb_curriculum_str.f_learner, p_term_code => :term_to_process); END; END-EXEC; POSTORA; EXEC SQL DECLARE c_sovlcur CURSOR FOR SELECT a.sovlcur_seqno FROM sovlcur a WHERE a.sovlcur_pidm = :pidm AND a.sovlcur_lmod_code = sb_curriculum_str.f_learner AND a.sovlcur_active_ind = 'Y' AND a.sovlcur_current_ind = 'Y' AND (( a.sovlcur_levl_code NOT IN (SELECT sprcolr_value_atyp FROM sprcolr WHERE sprcolr_job = 'SFRNSLC' AND sprcolr_sessionid = :sessionid AND sprcolr_type = 'C')) OR (a.sovlcur_levl_code = (SELECT stvlevl_code FROM stvlevl WHERE stvlevl_code = a.sovlcur_levl_code AND stvlevl_ceu_ind = 'N'))) ORDER BY sovlcur_priority_no,sovlcur_seqno; EXEC SQL OPEN c_sovlcur; POSTORA; while ((l_cnt < 2)&& (!*majr_code_2)) { EXEC SQL FETCH c_sovlcur INTO :curriculam_seqno:Ind_01; POSTORA; if (NO_ROWS_FOUND) { *curriculam_seqno='\0'; break; } else { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0290"," Debug fetch_major_data: pidm {0} learner seqno {1}\n"),pidm,curriculam_seqno); #endif selmajr_1_2_cipccode(FIRST_ROW); /*To Fetch 1st Major Record*/ #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0291"," Debug fetch_major_data: pidm {0} majr code {1} majr code2 {2} l_cnt {3,%1d}\n"), pidm,majr_code,majr_code_2,l_cnt); #endif if((l_cnt >0)&&(!*majr_code_2)) { if (*majr_code) { tmstrcpy(majr_code_2,majr_code); } } else { if (*majr_code) { tmstrcpy(majr_code_1,majr_code); } while (*majr_code) /*To Fetch 2nd Major Record*/ { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0292"," Debug fetch_major_data getting next row : pidm {0}\n"),pidm); #endif selmajr_1_2_cipccode(NEXT_ROW); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0293"," Debug after fetch_major_data getting next row : pidm {0} majr {1}\n"),pidm,majr_code); #endif if (!*majr_code) { break; } else { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0294"," Debug after fetch_major_data getting next row : pidm {0} row_num {1}\n"),pidm,row_num); #endif if ( compare(row_num,_TMC("2"),EQS) ) { tmstrcpy(majr_code_2,majr_code); break; } } } } l_cnt++; } } } EXEC SQL CLOSE c_sovlcur; POSTORA; sel_majrcipc_desc(); } static int get_secondlast_run_date(void) { *secondlast_run_date = '\0'; EXEC SQL DECLARE sel_secondlast_date CURSOR FOR SELECT TO_CHAR(MAX(TRUNC(SFRTCTL_ACTIVITY_DATE)),'YYYYMMDD') FROM SFRTCTL WHERE TRUNC(SFRTCTL_ACTIVITY_DATE) NOT IN (SELECT MAX(TRUNC(SFRTCTL_ACTIVITY_DATE)) FROM SFRTCTL where TRUNC(SFRTCTL_ACTIVITY_DATE) != trunc(sysdate) ) AND TRUNC(SFRTCTL_ACTIVITY_DATE) != trunc(sysdate) AND SFRTCTL_TERM_CODE = :term_to_process AND SFRTCTL_NSLC_VERSION = '8.6.6'; EXEC SQL OPEN sel_secondlast_date; POSTORA; EXEC SQL FETCH sel_secondlast_date INTO :secondlast_run_date:Ind_01; POSTORA; if (NO_ROWS_FOUND) { *secondlast_run_date = '\0'; EXEC SQL CLOSE sel_secondlast_date; POSTORA; return FALSE; } EXEC SQL CLOSE sel_secondlast_date; POSTORA; return TRUE; } static int incl_withdraw_records(void) { *include_flag = '\0'; EXEC SQL DECLARE include_flag_cursor CURSOR FOR SELECT 'Y' FROM DUAL WHERE (( :secondlast_run_date IS NULL) OR ( :secondlast_run_date IS NOT NULL AND TO_NUMBER(COALESCE(:prog_withdraw_date,'00000000')) > TO_NUMBER(:secondlast_run_date))); EXEC SQL OPEN include_flag_cursor; POSTORA; EXEC SQL FETCH include_flag_cursor INTO :include_flag:Ind_01; POSTORA; if (NO_ROWS_FOUND) { *include_flag = '\0'; EXEC SQL CLOSE include_flag_cursor; POSTORA; return FALSE; } EXEC SQL CLOSE include_flag_cursor; POSTORA; return TRUE; } /* Get address information */ static int seladdr(int mode) { *temp_street_line1 = '\0'; EXEC SQL DECLARE cursor_016 CURSOR FOR SELECT SPRADDR_ATYP_CODE, SPRADDR_STREET_LINE1, SPRADDR_STREET_LINE2, SPRADDR_STREET_LINE3, SPRADDR_CITY||',', SPRADDR_STAT_CODE, LTRIM(RTRIM(SUBSTR(SPRADDR_ZIP,1, (INSTR(SPRADDR_ZIP,'-') - 1))|| (SUBSTR(SPRADDR_ZIP,(INSTR(SPRADDR_ZIP,'-') + 1), LENGTH(SPRADDR_ZIP))),' '),' '), SPRADDR_NATN_CODE, SPRADDR_SEQNO, STVNATN_EDI_EQUIV FROM STVNATN, SPRCOLR A, SPRADDR X WHERE STVNATN_CODE (+) = X.SPRADDR_NATN_CODE AND X.SPRADDR_SEQNO = (SELECT MAX(Y.SPRADDR_SEQNO) FROM SPRCOLR B, SPRADDR Y WHERE B.SPRCOLR_SESSIONID = A.SPRCOLR_SESSIONID AND B.SPRCOLR_TYPE = A.SPRCOLR_TYPE AND Y.SPRADDR_PIDM = X.SPRADDR_PIDM AND Y.SPRADDR_ATYP_CODE = X.SPRADDR_ATYP_CODE AND Y.SPRADDR_STATUS_IND IS NULL AND ( (Y.SPRADDR_TO_DATE IS NULL AND Y.SPRADDR_FROM_DATE IS NULL) OR (Y.SPRADDR_TO_DATE IS NOT NULL AND Y.SPRADDR_FROM_DATE IS NOT NULL AND TRUNC(B.SPRCOLR_VALUE_DATE) BETWEEN TRUNC(Y.SPRADDR_FROM_DATE) AND TRUNC(Y.SPRADDR_TO_DATE) ) OR (Y.SPRADDR_FROM_DATE IS NOT NULL AND Y.SPRADDR_TO_DATE IS NULL AND TRUNC(B.SPRCOLR_VALUE_DATE) >= TRUNC(Y.SPRADDR_FROM_DATE) ) OR (Y.SPRADDR_FROM_DATE IS NULL AND Y.SPRADDR_TO_DATE IS NOT NULL AND TRUNC(B.SPRCOLR_VALUE_DATE) <= TRUNC(Y.SPRADDR_TO_DATE) ) ) ) AND X.SPRADDR_ATYP_CODE = substr(a.sprcolr_value_atyp,2,2) AND (a.SPRCOLR_VALUE_ATYP) = (SELECT MIN(C.SPRCOLR_VALUE_ATYP) FROM SPRADDR Z, SPRCOLR C WHERE C.SPRCOLR_SESSIONID = A.SPRCOLR_SESSIONID AND C.SPRCOLR_TYPE = A.SPRCOLR_TYPE AND Z.SPRADDR_PIDM = X.SPRADDR_PIDM AND Z.SPRADDR_ATYP_CODE = SUBSTR(C.SPRCOLR_VALUE_ATYP,2,2) AND Z.SPRADDR_STATUS_IND IS NULL AND ( (Z.SPRADDR_TO_DATE IS NULL AND SPRADDR_FROM_DATE IS NULL) OR (Z.SPRADDR_TO_DATE IS NOT NULL AND Z.SPRADDR_FROM_DATE IS NOT NULL AND TRUNC(C.SPRCOLR_VALUE_DATE) BETWEEN TRUNC(Z.SPRADDR_FROM_DATE) AND TRUNC(Z.SPRADDR_TO_DATE) ) OR (Z.SPRADDR_FROM_DATE IS NOT NULL AND Z.SPRADDR_TO_DATE IS NULL AND TRUNC(C.SPRCOLR_VALUE_DATE) >= TRUNC(Z.SPRADDR_FROM_DATE) ) OR (Z.SPRADDR_FROM_DATE IS NULL AND Z.SPRADDR_TO_DATE IS NOT NULL AND TRUNC(C.SPRCOLR_VALUE_DATE) <= TRUNC(Z.SPRADDR_TO_DATE) ) ) ) AND X.SPRADDR_STATUS_IND IS NULL AND ( (X.SPRADDR_TO_DATE IS NULL AND X.SPRADDR_FROM_DATE IS NULL) OR (X.SPRADDR_TO_DATE IS NOT NULL AND X.SPRADDR_FROM_DATE IS NOT NULL AND TRUNC(A.SPRCOLR_VALUE_DATE) BETWEEN TRUNC(X.SPRADDR_FROM_DATE) AND TRUNC(X.SPRADDR_TO_DATE) ) OR (X.SPRADDR_FROM_DATE IS NOT NULL AND X.SPRADDR_TO_DATE IS NULL AND TRUNC(A.SPRCOLR_VALUE_DATE) >= TRUNC(X.SPRADDR_FROM_DATE) ) OR (X.SPRADDR_FROM_DATE IS NULL AND X.SPRADDR_TO_DATE IS NOT NULL AND TRUNC(A.SPRCOLR_VALUE_DATE) <= TRUNC(X.SPRADDR_TO_DATE) ) ) AND A.SPRCOLR_TYPE = 'A' AND A.SPRCOLR_SESSIONID = :sessionid AND X.SPRADDR_PIDM = :pidm; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_016; POSTORA; return TRUE; } if (mode==FIRST_ROW) { EXEC SQL OPEN cursor_016; /* Open address select cursor */ POSTORA; } EXEC SQL FETCH cursor_016 INTO :pers_atyp_code:Ind_01, :street_line1:Ind_02, :street_line2:Ind_03, :street_line3:Ind_04, :city_var:Ind_05, :state:Ind_06, :zip:Ind_07, :pers_natn:Ind_08, :seqno:Ind_09, :natn_edi_equiv:Ind_10; POSTORA; if ( NO_ROWS_FOUND ) { *pers_atyp_code='\0'; tmstrcpy(temp_street_line1,_TMC("UK")); *street_line1='\0'; *street_line2='\0'; *street_line3='\0'; *city_var='\0'; *state='\0'; *zip='\0'; *pers_natn='\0'; *seqno='\0'; *natn_edi_equiv='\0'; return FALSE; } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0295"," Debug seladdr: after pidm {0} temp_street_line1 {1} \n"), pidm, temp_street_line1); #endif EXEC SQL SELECT COALESCE(TRIM(' ' from regexp_replace(:street_line1,'[^[:alnum:]'' '']',' ')),'NOVALUE') INTO :street_line1:Ind_02 FROM DUAL; POSTORA; EXEC SQL SELECT COALESCE(TRIM(' ' FROM regexp_replace(:street_line2,'[^[:alnum:]'' '']',' ')),'NOVALUE') INTO :street_line2:Ind_03 FROM DUAL; POSTORA; if (!tmstrcmp(street_line1,_TMC("NOVALUE"))) { *street_line1 = '\0'; } if (!tmstrcmp(street_line2,_TMC("NOVALUE"))) { *street_line2 = '\0'; } return TRUE; } static int check_grad_levl(int mode) { EXEC SQL DECLARE cursor_020 CURSOR FOR SELECT 'Y' FROM STVLEVL WHERE STVLEVL_CODE = UPPER(:ask_glvl_code); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_020; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_020; POSTORA; } EXEC SQL FETCH cursor_020 INTO :found_ind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { return FALSE; } return TRUE; } static int check_ceu_levl(int mode) { EXEC SQL DECLARE cursor_920 CURSOR FOR SELECT 'Y' FROM STVLEVL WHERE STVLEVL_CODE = UPPER(:ask_clvl_code); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_920; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_920; POSTORA; } EXEC SQL FETCH cursor_920 INTO :ceu_found_ind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { return FALSE; } return TRUE; } static int check_attr_code(int mode) { EXEC SQL DECLARE cursor_929 CURSOR FOR SELECT 'Y' FROM STVATTR WHERE STVATTR_CODE = UPPER(:ask_attr_code); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_929; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_929; POSTORA; } EXEC SQL FETCH cursor_929 INTO :attr_found_ind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { return FALSE; } return TRUE; } static int check_detail(int mode) { EXEC SQL DECLARE cursor_585 CURSOR FOR SELECT 'Y' FROM STVLEVL WHERE STVLEVL_CODE = UPPER(:ask_detl_code); if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_585; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_585; POSTORA; } EXEC SQL FETCH cursor_585 INTO :detl_found_ind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { return FALSE; } return TRUE; } static int check_reg(int mode) /* Is student registered for at least one course this term? */ { EXEC SQL DECLARE cursor_021 CURSOR FOR SELECT 'Y' FROM STVRSTS, SFRSTCR WHERE SFRSTCR_PIDM = :pidm AND SFRSTCR_TERM_CODE = :term_to_process AND SFRSTCR_RSTS_CODE = STVRSTS_CODE AND STVRSTS_INCL_SECT_ENRL = 'Y'; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_021; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_021; POSTORA; } EXEC SQL FETCH cursor_021 INTO :found_ind:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { return FALSE; } return TRUE; } static void check_reg_levl(void) /* Compare course levels with GRAD LEVL codes entered by user. */ /* If student is registered for any other level course, reg_levl := 'UN' */ /* If student is registered for only grad-level courses, reg_levl := '28' */ { EXEC SQL DECLARE cursor_022 CURSOR FOR SELECT 'UN' FROM STVRSTS, SFRSTCR WHERE SFRSTCR_PIDM = :pidm AND SFRSTCR_TERM_CODE = :term_to_process AND SFRSTCR_RSTS_CODE = STVRSTS_CODE AND STVRSTS_INCL_SECT_ENRL = 'Y' AND SFRSTCR_LEVL_CODE NOT IN (SELECT SPRCOLR_VALUE_ATYP FROM SPRCOLR WHERE SPRCOLR_JOB = :rptname AND SPRCOLR_SESSIONID = :sessionid AND SPRCOLR_TYPE = 'G'); EXEC SQL OPEN cursor_022; POSTORA; EXEC SQL FETCH cursor_022 INTO :reg_levl:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { tmstrcpy(reg_levl,_TMC("28")); EXEC SQL CLOSE cursor_022; POSTORA; } EXEC SQL CLOSE cursor_022; POSTORA; } /* Retrieve anticipated grad date for status of F,H,A */ static void sel_grad_date_fha(void) { EXEC SQL DECLARE cursor_017 CURSOR FOR SELECT TO_CHAR(SGBSTDN_EXP_GRAD_DATE,'YYYYMMDD') FROM SGBSTDN WHERE SGBSTDN_PIDM = :pidm AND SGBSTDN_TERM_CODE_EFF = (SELECT MAX(SGBSTDN_TERM_CODE_EFF) FROM SGBSTDN WHERE SGBSTDN_TERM_CODE_EFF <= :term AND SGBSTDN_PIDM = :pidm ); EXEC SQL OPEN cursor_017; POSTORA; EXEC SQL FETCH cursor_017 INTO :grad_date_fha:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *grad_date_fha='\0'; } EXEC SQL CLOSE cursor_017; /* Close address select cursor */ POSTORA; } /* Retrieve anticipated grad date for status of G */ static void sel_grad_date_g(void) { EXEC SQL DECLARE cursor_018 CURSOR FOR SELECT TO_CHAR(MAX(final_graddate_tbl.final_gr_date),'YYYYMMDD') FROM ( SELECT max(SSBSECT_PTRM_END_DATE) final_gr_date FROM SFRSTCR, SSBSECT, STVRSTS WHERE SFRSTCR_PIDM = :pidm AND SFRSTCR_TERM_CODE = :term_to_process AND SSBSECT_TERM_CODE = SFRSTCR_TERM_CODE AND SSBSECT_CRN = SFRSTCR_CRN AND SFRSTCR_RSTS_CODE = STVRSTS_CODE AND ( SFRSTCR_GRDE_DATE IS NOT NULL OR ( STVRSTS_INCL_SECT_ENRL = 'Y' AND STVRSTS_VOICE_TYPE = 'R' ) ) UNION ALL SELECT max(fncr.SORFNCR_END_DATE) final_gr_date FROM STVRSTS rsts, SORFNCR fncr, SSBSECT sect, SFRSTCR stcr WHERE stcr.SFRSTCR_TERM_CODE = :term_to_process AND stcr.SFRSTCR_PIDM = :pidm AND sect.SSBSECT_TERM_CODE = stcr.SFRSTCR_TERM_CODE AND sect.SSBSECT_CRN = stcr.SFRSTCR_CRN AND stcr.SFRSTCR_RSTS_CODE = rsts.STVRSTS_CODE AND ( stcr.SFRSTCR_GRDE_DATE IS NOT NULL OR ( rsts.STVRSTS_INCL_SECT_ENRL = 'Y' AND rsts.STVRSTS_VOICE_TYPE = 'R' ) ) AND fncr.SORFNCR_TERM_CODE = sect.SSBSECT_TERM_CODE AND fncr.SORFNCR_CRN = sect.SSBSECT_CRN AND COALESCE(:usefinaldateflag,'N') = 'Y' UNION ALL SELECT max(fnpt.SORFNPT_END_DATE) final_gr_date FROM STVRSTS rsts, SORFNPT fnpt, SSBSECT sect, SFRSTCR stcr WHERE stcr.SFRSTCR_TERM_CODE = :term_to_process AND stcr.SFRSTCR_PIDM = :pidm AND sect.SSBSECT_TERM_CODE = stcr.SFRSTCR_TERM_CODE AND sect.SSBSECT_CRN = stcr.SFRSTCR_CRN AND stcr.SFRSTCR_RSTS_CODE = rsts.STVRSTS_CODE AND ( stcr.SFRSTCR_GRDE_DATE IS NOT NULL OR ( rsts.STVRSTS_INCL_SECT_ENRL = 'Y' AND rsts.STVRSTS_VOICE_TYPE = 'R' ) ) AND fnpt.SORFNPT_TERM_CODE = sect.SSBSECT_TERM_CODE AND fnpt.SORFNPT_PTRM_CODE = sect.SSBSECT_PTRM_CODE AND COALESCE(:usefinaldateflag,'N') = 'Y' )final_graddate_tbl; EXEC SQL OPEN cursor_018; POSTORA; EXEC SQL FETCH cursor_018 INTO :grad_date_g:Ind_01; POSTORA; if ( NO_ROWS_FOUND ) { *grad_date_g='\0'; } EXEC SQL CLOSE cursor_018; /* Close address select cursor */ POSTORA; } /* Retrieve FICE code */ static int sel_fice(int mode) { EXEC SQL DECLARE cursor_019 CURSOR FOR SELECT SHBCGPA_INST_FICE FROM SHBCGPA; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_019; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_019; POSTORA; } EXEC SQL FETCH cursor_019 INTO :fice:Ind_01; POSTORA; if (!*fice) { tmstrcpy(fice,_TMC("000000")); return FALSE; } return TRUE; } /* Determine if student is Full, Half, or less than half time status Effective date is always the most recent time the student was at the current status Different scenarios : student is full time first term and in each term there after. The effective date is always the first date of the first term student is FT term 1, switches to HT term 2, then FT term 3. The effective date for the term 3 reporting is the first date of term 3. student is FT term 1, mid term 2 switches to HT and in term 3 is HT. The effective date for term 2 and term 3 is the TMST date for HT from term 2. student is FT term 1, does not attend term 2, returns as FT term 3. The effective date for term 3 is the first day of term 3. Process to find effective date: 1. find the most current TMST code for the student and term 2. find the youngest occurrence of that tmst value for the student that is after any gap in enrollment, or is after previous status values. 3. if the student has a gap find the date after the gap ends If the TMST date is less then the start of the term use the start of the term */ static int sel_full_half_status(void) { static TMCHAR use_date_time[21]={0}; *use_date_time = '\0'; *hold_scp_tmst_date = '\0'; tmstrcat(use_date_time,use_date); tmstrcat(use_date_time,use_time); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0296"," Debug sel_full_half_status: use date time in set fulltime {0} gap report term {1} term {2} use_date {3} use_time {4}\n"), use_date_time, last_gap_term, term_to_process,use_date,use_time); tmprintf(&tmBundle, TM_NLS_Get("0297"," Debug sel_full_half_status: pidm {0} cycle_code {1} enrl_cycle_code {2} scp_process {3} fhl_date {4}\n"), pidm, cycle_code, enrl_cycle_code,scp_process,fhl_date); #endif /* if processing by scp_process use the scp time status table regardless of how many terms within the scp the student is registered for */ if (( compare(scp_process,_TMC("Y"),EQS) ) && ( compare(cycle_code,enrl_cycle_code,EQS) )) { EXEC SQL DECLARE cursor_118 CURSOR FOR SELECT SFRSTSH_TMST_CODE, TO_CHAR(SFRSTSH_TMST_DATE,'YYYYMMDD') FROM SFRSTSH WHERE SFRSTSH_PIDM = :pidm AND SFRSTSH_SCPS_CODE = :scps_code AND SFRSTSH_TMST_DATE <= TO_DATE(:use_date_time, 'DD-MON-YYYYHH24:MI:SS') ORDER BY SFRSTSH_TMST_DATE desc; EXEC SQL OPEN cursor_118; POSTORA; EXEC SQL FETCH cursor_118 INTO :tmst_code:Ind_01, :hold_scp_tmst_date:Ind_02 ; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0298"," Debug sel_full_half_status: pidm {0} hold scp date {1} \n"), pidm, hold_scp_tmst_date); #endif if ( NO_ROWS_FOUND ) { *tmst_code = '\0'; } EXEC SQL CLOSE cursor_118; POSTORA; if (!*tmst_code ) { err_scp_tmst_code = 1; } else if (!tmstrcmp(tmst_code,_TMC("99"))) { err_scp_tmst_99 = 1; } /* now find the earliest date of the status value since last change */ if (*tmst_code) { EXEC SQL DECLARE cursor_1181 CURSOR FOR select to_char(min(SFRstsh_TMST_DATE),'YYYYMMDD') FROM SFRstsh WHERE SFRstsh_PIDM = :pidm AND SFRstsh_SCPS_CODE = :scps_code and sfrstsh_tmst_code = :tmst_code AND SFRstsh_TMST_DATE >= ( select max(m.sfrstsh_tmst_date) from sfrstsh m where m.sfrstsh_pidm = sfrstsh.sfrstsh_pidm and m.sfrstsh_scps_code = sfrstsh.sfrstsh_scps_code and m.sfrstsh_tmst_date >= ( select min(mm.sfrstsh_tmst_date) from sfrstsh mm where mm.sfrstsh_pidm = sfrstsh.sfrstsh_pidm and mm.sfrstsh_scps_code <= sfrstsh.SFRstsh_SCPS_CODE and mm.sfrstsh_tmst_code <> sfrstsh.sfrstsh_tmst_code) ) ; EXEC SQL OPEN cursor_1181; POSTORA; EXEC SQL FETCH cursor_1181 INTO :fhl_date:Ind_01 ; POSTORA; if ( NO_ROWS_FOUND ) { *fhl_date = '\0'; tmstrcpy(fhl_date,hold_scp_tmst_date); } if (!*fhl_date) { tmstrcpy(fhl_date,hold_scp_tmst_date); } EXEC SQL CLOSE cursor_1181; POSTORA; } } /******* process regular term *****/ else { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0299"," Debug sel_full_half_status: processing regular term. pidm {0} term_to_process {1} use_date_time {2} \n"),pidm,term_to_process,use_date_time); #endif /* find most current tmst for the term as of the report date */ EXEC SQL DECLARE cursor_050 CURSOR FOR SELECT SFRTHST_TMST_CODE FROM SFRTHST WHERE SFRTHST_PIDM = :pidm AND SFRTHST_TERM_CODE = :term_to_process AND SFRTHST_TMST_DATE = ( select max(m.sfrthst_tmst_date) from sfrthst m where m.sfrthst_pidm = sfrthst.sfrthst_pidm and m.sfrthst_term_code = sfrthst.sfrthst_term_code and to_date(to_char(m.sfrthst_tmst_date,'DD-MON-YYYYHH24:MI:SS'),'DD-MON-YYYYHH24:MI:SS') <= to_date(:use_date_time,'DD-MON-YYYYHH24:MI:SS')); /* and m.sfrthst_tmst_date <= TO_DATE(:use_date_time,'DD-MON-YYYYHH24:MI:SS')) ; */ EXEC SQL OPEN cursor_050; POSTORA; EXEC SQL FETCH cursor_050 INTO :tmst_code:Ind_01 ; POSTORA; if ( NO_ROWS_FOUND ) { *tmst_code = '\0'; } EXEC SQL CLOSE cursor_050; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0300"," Debug sel_full_half_status:most recent tmst_code found {0} \n"), tmst_code); #endif if (!*tmst_code ) { err_tmst_code = 1; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0301"," Debug sel_full_half_status: tmst code is null {0} \n"), tmst_code); #endif } else if (!tmstrcmp(tmst_code,_TMC("99"))) { err_tmst_99 = 1; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0302"," Debug sel_full_half_status: tmst code is 99 {0} \n"), tmst_code); #endif } /* now find the earliest date of the status value since last change */ if ( *tmst_code) { /* find out if the student had a previous status that is different even though student has a gap and was not reported in the last cycle they still may have changed status. in that case use the most current. Difference in code between having gap and not is if there is a gap look within the current term, else look before and in the current processing term */ *prev_tmst_code='\0'; *prev_fhl_date='\0'; *prev_tmst_term = '\0'; *prev_fhl_term_date= '\0'; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0303"," Debug sel_full_half_status: use date time before sfvtmst query {0} SESSIONID {1}\n"), use_date_time,sessionid ); #endif EXEC SQL EXECUTE DECLARE gap_term varchar2(6); grad_term shrdgmr.shrdgmr_term_code_grad%TYPE; fhl_date varchar2(10); tmst_code stvtmst.stvtmst_code%type; tmst_term stvterm.stvterm_code%TYPE; fhl_term_date varchar2(10); sfhl_date varchar2(10); stmst_code stvtmst.stvtmst_code%type; stmst_term stvterm.stvterm_code%TYPE; sfhl_term_date varchar2(10); report_flag varchar2(1); branch varchar2(2); fice varchar2(6); CURSOR prev_degree_c IS SELECT SHRDGMR_TERM_CODE_GRAD FROM stvdegs, stvdegc, sovlfos degm, sovlcur degr, shrdgmr WHERE degr.sovlcur_pidm = :pidm AND COALESCE(degr.sovlcur_camp_code,'#') = COALESCE(:lcur_camp_code,'#') AND degr.sovlcur_lmod_code = sb_curriculum_str.f_outcome AND degr.sovlcur_current_ind = 'Y' AND degr.sovlcur_active_ind = 'Y' AND shrdgmr_pidm = degr.sovlcur_pidm AND shrdgmr_term_code_grad < :term_to_process AND degr.sovlcur_key_seqno = shrdgmr_seq_no AND stvdegs_code = shrdgmr_degs_code AND stvdegs_award_status_ind = 'A' AND stvdegc_code = degr.sovlcur_degc_code and COALESCE(stvdegc_acat_code,'99') = COALESCE(:lcur_acat_code,'99') AND degm.sovlfos_pidm = :pidm AND degm.sovlfos_lcur_seqno = degr.sovlcur_seqno AND degm.sovlfos_lfst_code = sb_fieldofstudy_str.f_major AND degm.sovlfos_seqno = ( SELECT MAX(m.sovlfos_seqno) FROM sovlfos m WHERE m.sovlfos_pidm = degm.sovlfos_pidm AND m.sovlfos_lcur_seqno = degr.sovlcur_seqno AND m.sovlfos_lfst_code = sb_fieldofstudy_str.f_major AND m.sovlfos_majr_code = :fos_majr_code); BEGIN open prev_degree_c; fetch prev_degree_c into grad_term; if prev_degree_c%notfound then grad_term := '000000'; end if; close prev_degree_c; report_flag := :report_flag; branch := :branch_code; fice := :fice; gap_term := :last_gap_term; sfkenrl.p_find_time_status_PSED (:pidm,:term_to_process,:tmst_code,gap_term,grad_term,:rptname,:sessionid, :use_date_time,branch,fice,fhl_date,tmst_code,tmst_term,fhl_term_date); if fhl_date < fhl_term_date then fhl_date := fhl_term_date; end if; :fhl_date:Ind_01 := fhl_date; :fhl_tmst_term:Ind_02 := tmst_term; END; END-EXEC; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0304"," Debug sel_full_half_status: PSED {0} partoftermdateind {1} partofterm_mindate {2} term_to_process {3} PSEDTerm {4}\n"), fhl_date,partoftermdateind,partofterm_mindate,term_to_process,fhl_tmst_term); #endif /* Replacing the fhl date i.e. Program Status effectie Date if its lesser then the Start Date being Reported for DTP|382|.... line */ /* that is partoftermdateind */ if ( (!tmstrcmp(partoftermdateind,_TMC("Y"))) && (tmstrcmp(term_to_process,fhl_tmst_term)) /* When term_to_process and fhl_tmst_term is not equal */ ) { tmstrcpy(temp_partofterm_mindate,partofterm_mindate); tmstrcpy(temp_partofterm_maxdate,partofterm_maxdate); selstartenddates(fhl_tmst_term); } else { /* No need to do anything since selstartenddates() is getting executed earlier for term_to_process. */ } if ( (!tmstrcmp(partoftermdateind,_TMC("Y"))) && (tmstrcmp(fhl_date,partofterm_mindate) < 0) ) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0305"," Debug sel_full_half_status(): Copying partofterm_mindate {0} to the fhl date {1}, because its lesser then the Start Date being Reported for DTP|382|.... line \n"),partofterm_mindate, fhl_date); #endif tmstrcpy(fhl_date,partofterm_mindate); tmstrcpy(prog_enr_stat_eff_date,fhl_date); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0306"," Debug sel_full_half_status(): New fhl date {0} New prog_enr_stat_eff_date {1} \n"),fhl_date, prog_enr_stat_eff_date); #endif } if ( (!tmstrcmp(partoftermdateind,_TMC("Y"))) && (tmstrcmp(term_to_process,fhl_tmst_term)) /* When term_to_process and fhl_tmst_term is not equal */ ) { tmstrcpy(partofterm_mindate,temp_partofterm_mindate); tmstrcpy(partofterm_maxdate,temp_partofterm_maxdate); *temp_partofterm_mindate = '\0'; *temp_partofterm_maxdate = '\0'; } else { /* No need to do anything since selstartenddates() is getting executed earlier for term_to_process. */ } } } /* Compare values with the validation table */ EXEC SQL DECLARE cursor_051 CURSOR FOR SELECT STVTMST_CODE, STVTMST_NSLC_EQUIV_IND FROM STVTMST WHERE STVTMST_CODE = :tmst_code AND STVTMST_NSLC_EQUIV_IND IS NOT NULL; EXEC SQL OPEN cursor_051; POSTORA; EXEC SQL FETCH cursor_051 INTO :fhl_code:Ind_01, :nslc_fhl_code:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) { *fhl_code = '\0'; *nslc_fhl_code = '\0'; *fhl_date = '\0'; } EXEC SQL CLOSE cursor_051; POSTORA; if (!*fhl_code) { if ((*tmst_code ) && (tmstrcmp(tmst_code,_TMC("99")))) { err_nslc_fhl_code = 1; tmstrcpy(nslc_nomatch_tmst,tmst_code); } return FALSE; } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0307"," Debug sel_full_half_status: end tmst {0} fhl date {1} err_nslc_fhl_code {2,%1d} nslc_nomatch_tmst {3}\n"), tmst_code , fhl_date, err_nslc_fhl_code, nslc_nomatch_tmst); #endif return TRUE; } static int sel_last_full_half_status(int mode) { static TMCHAR use_date_time[21]={0}; *use_date_time = '\0'; tmstrcat(use_date_time,use_date); tmstrcat(use_date_time,use_time); if (( compare(scp_process,_TMC("Y"),EQS) ) && ( compare(cycle_code,enrl_cycle_code,EQS) )) { EXEC SQL DECLARE cursor_118L CURSOR FOR SELECT SFRSTSH_TMST_CODE, TO_CHAR(SFRSTSH_TMST_DATE,'YYYYMMDD') FROM SFRSTSH WHERE SFRSTSH_PIDM = :pidm AND SFRSTSH_SCPS_CODE = :scps_code AND SFRSTSH_TMST_DATE <= TO_DATE(:use_date_time, 'DD-MON-YYYYHH24:MI:SS') ORDER BY SFRSTSH_TMST_DATE desc; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_118L; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_118L; POSTORA; } EXEC SQL FETCH cursor_118L INTO :tmst_code:Ind_01, :fhl_date:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) { *tmst_code = '\0'; *fhl_date = '\0'; } if (!*tmst_code ) { err_scp_tmst_code = 1; } else if (!tmstrcmp(tmst_code,_TMC("99"))) { err_scp_tmst_99 = 1; } } else { EXEC SQL DECLARE cursor_050L CURSOR FOR SELECT SFRTHST_TMST_CODE, TO_CHAR(SFRTHST_TMST_DATE,'YYYYMMDD') FROM SFRTHST WHERE SFRTHST_PIDM = :pidm AND SFRTHST_TERM_CODE = :term_to_process AND SFRTHST_TMST_DATE <= TO_DATE(:use_date_time, 'DD-MON-YYYYHH24:MI:SS') ORDER BY SFRTHST_TMST_DATE desc; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_050L; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_050L; POSTORA; } EXEC SQL FETCH cursor_050L INTO :tmst_code:Ind_01, :fhl_date:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) { *tmst_code = '\0'; *fhl_date = '\0'; } if (!*tmst_code ) { err_tmst_code = 1; } else if (!tmstrcmp(tmst_code,_TMC("99"))) { err_tmst_99 = 1; } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0308"," Debug: sel_last_full_half_status, tmst code {0} date {1} \n"), tmst_code, use_date_time); #endif } /* Compare values with the validation table */ EXEC SQL DECLARE cursor_051L CURSOR FOR SELECT STVTMST_CODE, STVTMST_NSLC_EQUIV_IND FROM STVTMST WHERE STVTMST_CODE = :tmst_code AND STVTMST_NSLC_EQUIV_IND IS NOT NULL; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_051L; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_051L; POSTORA; } EXEC SQL FETCH cursor_051L INTO :fhl_code:Ind_01, :nslc_fhl_code:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) { *fhl_code = '\0'; *nslc_fhl_code = '\0'; *fhl_date = '\0'; } if ( !mode ) { if (( compare(scp_process,_TMC("Y"),EQS) ) && ( compare(cycle_code,enrl_cycle_code,EQS) )) { EXEC SQL CLOSE cursor_118L; } else { EXEC SQL CLOSE cursor_050L; } EXEC SQL CLOSE cursor_051L; } if (!*fhl_code) { if ((*tmst_code ) && (tmstrcmp(tmst_code,_TMC("99")))) { err_nslc_fhl_code = 1; tmstrcpy(nslc_nomatch_tmst,tmst_code); } return FALSE; } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0309"," Debug sel_last_full_half_status: tmst_code {0} fhl date {1} err_nslc_fhl_code {2,%1d} nslc_nomatch_tmst {3}\n"), tmst_code , fhl_date, err_nslc_fhl_code, nslc_nomatch_tmst); #endif return TRUE; } /* Determine if student is Full, Half, or less than half time status Effective date is always the most recent time the student was at the current status Different scenarios : student is full time first term and in each term there after. The effective date is always the first date of the first term student is FT term 1, switches to HT term 2, then FT term 3. The effective date for the term 3 reporting is the first date of term 3. student is FT term 1, mid term 2 switches to HT and in term 3 is HT. The effective date for term 2 and term 3 is the TMST date for HT from term 2. student is FT term 1, does not attend term 2, returns as FT term 3. The effective date for term 3 is the first day of term 3. Process to find effective date: 1. find the most current TMST code for the student and term 2. find the youngest occurrence of that tmst value for the student that is after any gap in enrollment, or is after previous status values. 3. if the student has a gap find the date after the gap ends If the TMST date is less then the start of the term use the start of the term This sel_full_half_status_for_term_code() method is being used to Determine the Program Status Effective DATE only for the Program/Major which was withdrawn. It calculates the Status and Date based on the Term Code being Passed. In Multiple Major Same CIP Code scenario, the Term Code being Passed will be the Term Code in which the Program/Major was Active. Since in this scenario the PSED needs to be reported as it was reported in earlier Term when it was Active. This method is being called in get_program_status() and under usecurrstartenddatesflag=Y condition and after this method call irrespective of Program Status Determined by this method, the Program Status will be made as W but Program Status Effective Date is been used for reporting. This method is not using SCP_Process = Y. It will be used only for processing Regular Term. */ static int sel_full_half_status_for_term_code(TMCHAR p_term_code[7]) { static TMCHAR use_date_time[21]={0}; *use_date_time = '\0'; *hold_scp_tmst_date = '\0'; *fhl_date_for_term_code = '\0'; *nslc_fhl_code_for_term_code = '\0'; tmstrcat(use_date_time,use_date); tmstrcat(use_date_time,use_time); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0310"," Debug sel_full_half_status_for_term_code: use date time in set fulltime {0} gap report term {1} term_to_process {2} p_term_code {3} use_date {4} use_time {5} \n"), use_date_time, last_gap_term, term_to_process,p_term_code, use_date,use_time); tmprintf(&tmBundle, TM_NLS_Get("0311"," Debug sel_full_half_status_for_term_code: pidm {0} cycle_code {1} enrl_cycle_code {2} scp_process {3}\n"), pidm, cycle_code, enrl_cycle_code,scp_process); #endif /* if processing by scp_process use the scp time status table regardless of how many terms within the scp the student is registered for */ if (( compare(scp_process,_TMC("Y"),EQS) ) && ( compare(cycle_code,enrl_cycle_code,EQS) )) { /* Commented out the entire section of code because its not used in this method but later if in future its needed the changes may need to be done accordingly EXEC SQL DECLARE cursor_118 CURSOR FOR SELECT SFRSTSH_TMST_CODE, TO_CHAR(SFRSTSH_TMST_DATE,'YYYYMMDD') FROM SFRSTSH WHERE SFRSTSH_PIDM = :pidm AND SFRSTSH_SCPS_CODE = :scps_code AND SFRSTSH_TMST_DATE <= TO_DATE(:use_date_time, 'DD-MON-YYYYHH24:MI:SS') ORDER BY SFRSTSH_TMST_DATE desc; EXEC SQL OPEN cursor_118; POSTORA; EXEC SQL FETCH cursor_118 INTO :tmst_code:Ind_01, :hold_scp_tmst_date:Ind_02 ; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("5002"," Debug sel_full_half_status: pidm {0} hold scp date {1} \n"), pidm, hold_scp_tmst_date); #endif if ( NO_ROWS_FOUND ) { *tmst_code = '\0'; } EXEC SQL CLOSE cursor_118; POSTORA; if (!*tmst_code ) { err_scp_tmst_code = 1; } else if (!tmstrcmp(tmst_code,_TMC("99"))) { err_scp_tmst_99 = 1; } -- now find the earliest date of the status value since last change if (*tmst_code) { EXEC SQL DECLARE cursor_1181 CURSOR FOR select to_char(min(SFRstsh_TMST_DATE),'YYYYMMDD') FROM SFRstsh WHERE SFRstsh_PIDM = :pidm AND SFRstsh_SCPS_CODE = :scps_code and sfrstsh_tmst_code = :tmst_code AND SFRstsh_TMST_DATE >= ( select max(m.sfrstsh_tmst_date) from sfrstsh m where m.sfrstsh_pidm = sfrstsh.sfrstsh_pidm and m.sfrstsh_scps_code = sfrstsh.sfrstsh_scps_code and m.sfrstsh_tmst_date >= ( select min(mm.sfrstsh_tmst_date) from sfrstsh mm where mm.sfrstsh_pidm = sfrstsh.sfrstsh_pidm and mm.sfrstsh_scps_code <= sfrstsh.SFRstsh_SCPS_CODE and mm.sfrstsh_tmst_code <> sfrstsh.sfrstsh_tmst_code) ) ; EXEC SQL OPEN cursor_1181; POSTORA; EXEC SQL FETCH cursor_1181 INTO :fhl_date:Ind_01 ; POSTORA; if ( NO_ROWS_FOUND ) { *fhl_date = '\0'; tmstrcpy(fhl_date,hold_scp_tmst_date); } if (!*fhl_date) { tmstrcpy(fhl_date,hold_scp_tmst_date); } EXEC SQL CLOSE cursor_1181; POSTORA; } */ } /******* process regular term *****/ else { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0312"," Debug sel_full_half_status_term_code_end: processing regular term \n")); #endif /* find most current tmst for the term as of the report date */ EXEC SQL DECLARE cursor_sfrthst_term_code_end CURSOR FOR SELECT SFRTHST_TMST_CODE FROM SFRTHST WHERE SFRTHST_PIDM = :pidm AND SFRTHST_TERM_CODE = :p_term_code AND SFRTHST_TMST_DATE = ( select max(m.sfrthst_tmst_date) from sfrthst m where m.sfrthst_pidm = sfrthst.sfrthst_pidm and m.sfrthst_term_code = sfrthst.sfrthst_term_code and to_date(to_char(m.sfrthst_tmst_date,'DD-MON-YYYYHH24:MI:SS'),'DD-MON-YYYYHH24:MI:SS') <= to_date(:use_date_time,'DD-MON-YYYYHH24:MI:SS')); /*and m.sfrthst_tmst_date <= TO_DATE(:use_date_time,'DD-MON-YYYYHH24:MI:SS')) ; */ EXEC SQL OPEN cursor_sfrthst_term_code_end; POSTORA; EXEC SQL FETCH cursor_sfrthst_term_code_end INTO :tmst_code:Ind_01 ; POSTORA; if ( NO_ROWS_FOUND ) { *tmst_code = '\0'; } EXEC SQL CLOSE cursor_sfrthst_term_code_end; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0313"," Debug sel_full_half_status_for_term_code:most recent tmst_code found {0} \n"), tmst_code); #endif if (!*tmst_code ) { err_tmst_code = 1; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0314"," Debug sel_full_half_status_for_term_code: tmst code is null {0} \n"), tmst_code); #endif } else if (!tmstrcmp(tmst_code,_TMC("99"))) { err_tmst_99 = 1; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0315"," Debug sel_full_half_status_for_term_code: tmst code is 99 {0} \n"), tmst_code); #endif } /* now find the earliest date of the status value since last change */ if ( *tmst_code) { /* find out if the student had a previous status that is different even though student has a gap and was not reported in the last cycle they still may have changed status. in that case use the most current. Difference in code between having gap and not is if there is a gap look within the current term, else look before and in the current processing term */ *prev_tmst_code='\0'; *prev_fhl_date='\0'; *prev_tmst_term = '\0'; *prev_fhl_term_date= '\0'; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0316"," Debug sel_full_half_status_for_term_code: use date time before sfvtmst query {0} SESSIONID {1}\n"), use_date_time,sessionid ); #endif EXEC SQL EXECUTE DECLARE gap_term varchar2(6); grad_term shrdgmr.shrdgmr_term_code_grad%TYPE; fhl_date varchar2(10); tmst_code stvtmst.stvtmst_code%type; tmst_term stvterm.stvterm_code%TYPE; fhl_term_date varchar2(10); sfhl_date varchar2(10); stmst_code stvtmst.stvtmst_code%type; stmst_term stvterm.stvterm_code%TYPE; sfhl_term_date varchar2(10); report_flag varchar2(1); branch varchar2(2); fice varchar2(6); CURSOR prev_degree_c IS SELECT SHRDGMR_TERM_CODE_GRAD FROM stvdegs, stvdegc, sovlfos degm, sovlcur degr, shrdgmr WHERE degr.sovlcur_pidm = :pidm AND COALESCE(degr.sovlcur_camp_code,'#') = COALESCE(:lcur_camp_code,'#') AND degr.sovlcur_lmod_code = sb_curriculum_str.f_outcome AND degr.sovlcur_current_ind = 'Y' AND degr.sovlcur_active_ind = 'Y' AND shrdgmr_pidm = degr.sovlcur_pidm AND shrdgmr_term_code_grad < :p_term_code AND degr.sovlcur_key_seqno = shrdgmr_seq_no AND stvdegs_code = shrdgmr_degs_code AND stvdegs_award_status_ind = 'A' AND stvdegc_code = degr.sovlcur_degc_code and COALESCE(stvdegc_acat_code,'99') = COALESCE(:lcur_acat_code,'99') AND degm.sovlfos_pidm = :pidm AND degm.sovlfos_lcur_seqno = degr.sovlcur_seqno AND degm.sovlfos_lfst_code = sb_fieldofstudy_str.f_major AND degm.sovlfos_seqno = ( SELECT MAX(m.sovlfos_seqno) FROM sovlfos m WHERE m.sovlfos_pidm = degm.sovlfos_pidm AND m.sovlfos_lcur_seqno = degr.sovlcur_seqno AND m.sovlfos_lfst_code = sb_fieldofstudy_str.f_major AND m.sovlfos_majr_code = :fos_majr_code); BEGIN open prev_degree_c; fetch prev_degree_c into grad_term; if prev_degree_c%notfound then grad_term := '000000'; end if; close prev_degree_c; report_flag := :report_flag; branch := :branch_code; fice := :fice; gap_term := :last_gap_term; sfkenrl.p_find_time_status_PSED (:pidm,:p_term_code,:tmst_code,gap_term,grad_term,:rptname,:sessionid, :use_date_time,branch,fice,fhl_date,tmst_code,tmst_term,fhl_term_date); if fhl_date < fhl_term_date then fhl_date := fhl_term_date; end if; :fhl_date_for_term_code:Ind_01 := fhl_date; END; END-EXEC; POSTORA; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0317"," Debug sel_full_half_status_for_term_code: eff date {0}\n"), fhl_date_for_term_code); #endif } } if( tmstrcmp(p_term_code,term_to_process) == 0 ) /* This section of code is required to be performed in case both the terms are equal */ { /* Compare values with the validation table */ EXEC SQL DECLARE cursor_stvtmst CURSOR FOR SELECT STVTMST_CODE, STVTMST_NSLC_EQUIV_IND FROM STVTMST WHERE STVTMST_CODE = :tmst_code AND STVTMST_NSLC_EQUIV_IND IS NOT NULL; EXEC SQL OPEN cursor_stvtmst; POSTORA; EXEC SQL FETCH cursor_stvtmst INTO :fhl_code_for_term_code:Ind_01, :nslc_fhl_code_for_term_code:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) { *fhl_code_for_term_code = '\0'; *nslc_fhl_code_for_term_code = '\0'; *fhl_date_for_term_code = '\0'; } EXEC SQL CLOSE cursor_stvtmst; POSTORA; if (!*fhl_code_for_term_code) { if ((*tmst_code ) && (tmstrcmp(tmst_code,_TMC("99")))) { err_nslc_fhl_code = 1; tmstrcpy(nslc_nomatch_tmst,tmst_code); #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0318"," Debug sel_full_half_status_for_term_code: end tmst {0} fhl date {1} err_nslc_fhl_code {2,%1d} nslc_nomatch_tmst {3} fhl_code_for_term_code {4}\n"), tmst_code , fhl_date_for_term_code, err_nslc_fhl_code, nslc_nomatch_tmst,fhl_code_for_term_code); #endif } return FALSE; } } #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0319"," Debug sel_full_half_status_for_term_code: end tmst {0} fhl date {1} err_nslc_fhl_code {2,%1d} nslc_nomatch_tmst {3}\n"), tmst_code , fhl_date_for_term_code, err_nslc_fhl_code, nslc_nomatch_tmst); #endif return TRUE; } /* check_major_changed() --> Based on Major Code, CIPC CODE, Program Length, Cred Level and Start/End Date. check_program_changed() --> Based on Program, and Start/End Date. */ static int check_major_changed(TMCHAR p_majr_code[5]) { *chk_major_changed_start_date = '\0'; *chk_major_changed_end_date = '\0'; #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0320"," Debug check_major_changed: pidm {0} p_majr_code {1} prog_lcur_seqno {2} \n"), pidm, p_majr_code, prog_lcur_seqno); #endif /* The Major which is being processed would be a Non-Current and Active Major so following query should look for Current and Active record of same Major. */ EXEC SQL DECLARE c_check_for_same_major CURSOR FOR select to_char(sovlfos_start_date,'YYYYMMDD'), to_char(sovlfos_end_date,'YYYYMMDD') from sovlfos where sovlfos_pidm = :pidm and sovlfos_lfst_code = sb_fieldofstudy_str.f_major and sovlfos_majr_code = :p_majr_code and COALESCE(sovlfos_current_ind,'N') = 'Y' /* Current */ and COALESCE(sovlfos_active_ind,'N') = 'Y'; /* Active */ EXEC SQL OPEN c_check_for_same_major; POSTORA; EXEC SQL FETCH c_check_for_same_major INTO :chk_major_changed_start_date:Ind_01, :chk_major_changed_end_date:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) /* Same Major Code Not Found. That means Major Changed. */ { EXEC SQL CLOSE c_check_for_same_major; POSTORA; /* >> Check to see if CIPC CODE, Program Length, Cred Level and Start/End Date has been changed */ return TRUE; /* Means Yes means Major changed. */ } else /* Same Major Code Found. */ { EXEC SQL CLOSE c_check_for_same_major; POSTORA; return FALSE; /* Means NO means Major did not changed. */ } } static int check_program_changed() { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0321"," Debug check_program_changed: \n")); #endif return FALSE; } static int check_curriculum_changed(TMCHAR p_majr_code[5]) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0322"," Debug check_curriculum_changed: Major {0} \n"),p_majr_code); #endif if ( check_major_changed(p_majr_code) || check_program_changed() ) { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0323"," Debug check_curriculum_changed: Yes Curriculum data has been changed. \n")); #endif return TRUE; /* Means Yes Curriculum data has changed */ } else { #ifdef SCT_DEBUG tmprintf(&tmBundle, TM_NLS_Get("0324"," Debug check_curriculum_changed: No Curriculum data did not changed. \n")); #endif return FALSE; /* Means No Curriculum data did not changed */ } } /* Search the CONTROL table for previous records to determine whethter previous processing of this pidm occured; update with new information if an EDI report is run */ static int control_table(int mode) { EXEC SQL DECLARE cursor_055 CURSOR FOR SELECT TO_CHAR(MAX(SFRTCTL_RPRT_DATE),G$_DATE.GET_NLS_DATE_FORMAT), TO_CHAR(MAX(SFRTCTL_RPRT_DATE),'HH24:MI:SS') FROM SFRTCTL WHERE SFRTCTL_TERM_CODE = :term AND SFRTCTL_BRANCH_CDE = :branch_code AND SFRTCTL_INST_FICE = :fice; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_055; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_055; POSTORA; } EXEC SQL FETCH cursor_055 INTO :control_rpt_date:Ind_01, :control_rpt_time:Ind_02; POSTORA; if ( NO_ROWS_FOUND ) { EXEC SQL SELECT TO_CHAR(to_date(G$_DATE.normalise_greg_date('01-07-2014','DD-MM-YYYY'),G$_DATE.GET_NLS_DATE_FORMAT)) INTO :control_rpt_date:Ind_01 FROM DUAL; POSTORA; *control_rpt_time = '\0'; } /* update the control table */ locktctl(); EXEC SQL INSERT INTO SFRTCTL (SFRTCTL_TERM_CODE, SFRTCTL_RPRT_DATE, SFRTCTL_RPRT_STANDARD_IND, SFRTCTL_ACTIVITY_DATE, SFRTCTL_NSLC_VERSION, SFRTCTL_BRANCH_CDE, SFRTCTL_INST_FICE) VALUES (:term, TO_DATE(:sel_date||' '||:sel_time,'DD-MON-YYYY HH24:MI:SS'), :report_flag, SYSDATE, '8.6.6', :branch_code, :fice); POSTORA; if ( !*control_rpt_date ) { return FALSE; } return TRUE; } static int enrollment_period(int mode) { EXEC SQL DECLARE cursor_057 CURSOR FOR SELECT TO_CHAR(STVTERM_START_DATE, 'YYYYMMDD'), TO_CHAR(STVTERM_END_DATE,'YYYYMMDD'), STVTERM_DESC, SUBSTR(TO_CHAR(STVTERM_START_DATE, 'YYYYMMDD'),1,6), TO_CHAR(STVTERM_START_DATE,G$_DATE.GET_NLS_DATE_FORMAT) FROM STVTERM WHERE STVTERM_CODE = :term; if ( mode==CLOSE_CURSOR ) { EXEC SQL CLOSE cursor_057; POSTORA; return TRUE; } if ( mode==FIRST_ROW ) { EXEC SQL OPEN cursor_057; POSTORA; } EXEC SQL FETCH cursor_057 INTO :enroll_start_date:Ind_01, :enroll_end_date:Ind_02, :term_desc:Ind_03, :term_yearmm:Ind_04, :resid_date:Ind_05; POSTORA; if (!*enroll_start_date) { *enroll_start_date='\0'; *enroll_end_date='\0'; *enroll_end_date_orig='\0'; *term_desc='\0'; *term_yearmm='\0'; *resid_date='\0'; return FALSE; } tmstrcpy(enroll_end_date_orig,enroll_end_date); return TRUE; } /* Check to see if report heading should be printed */ static void chk_for_heading(UFILE *ofile_in) { if (lineno <= (numlines - 2)) { tmfprintf(&tmBundle, ofile_in,_TMC("\n")); lineno++; count++; } else { lineno=0; pageno++; tmfprintf(&tmBundle, ofile_in,_TMC("\f")); print_heading(ofile_in); } } /* Print the report heading */ static void print_heading(UFILE *file_in) { tmfprintf(&tmBundle, file_in,_TMC("{0} {1}{2,%*s}"), print_sel_date4, time_var, inst_pos, institution); tmfprintf(&tmBundle, file_in, _TMC("{0,%*s} {1,number,integer}\n"), page_pos, TM_NLS_Get("0325","PAGE"), pageno); tmfprintf(&tmBundle, file_in, _TMC("{0}{1,%*s}{2,%*s}\n\n"), term, title_pos, title_var, rpt_pos, rptname); if (!tmstrcmp(run_mode,_TMC("2"))||!tmstrcmp(run_mode,_TMC("3"))) { tmfprintf(&tmBundle, file_in,_TMC("{0,%-12s}{1,%-32s}{2,%-16s}{3,%-10s}{4,%-14s}{5,%-16s}{6,%-24s}{7,%-9s}\n"), TM_NLS_Get("0326","BANNER ID"),TM_NLS_Get("0327","Name"),TM_NLS_Get("0328","SSN"),TM_NLS_Get("0329","DOB"),TM_NLS_Get("0330","EB Status"), TM_NLS_Get("0331","EB Change"),TM_NLS_Get("0332","Enroll Start/End"),TM_NLS_Get("0333","Grad Date")); tmfprintf(&tmBundle, file_in,_TMC("{0,%-84s}{1,%-16s}\n"), _TMC(" "),TM_NLS_Get("0334","Status Date")); tmfprintf(&tmBundle, file_in,_TMC("{0,%-12s}{1,%-32s}{2,%-16s}{3,%-10s}{4,%-14s}{5,%-16s}{6,%-24s}{7,%-9s}\n\n"), _TMC("---------"),_TMC("-------------------------------"),_TMC("---"),_TMC("---"),_TMC("---------"), _TMC("-------------"),_TMC("----------------"),_TMC("---------")); } else { tmfprintf(&tmBundle, file_in, TM_NLS_Get("0335","Student Student\n")); tmfprintf(&tmBundle, file_in, TM_NLS_Get("0336","ID Name")); tmfprintf(&tmBundle, file_in, _TMC("{0,%87s}\n"),TM_NLS_Get("0337","Error Message")); tmfprintf(&tmBundle, file_in, _TMC("--------- --------------------------------------------")); tmfprintf(&tmBundle, file_in,_TMC("---------------------------------")); tmfprintf(&tmBundle, file_in,_TMC(" ---------------------------------\n\n")); } lineno = lineno + 7; count = count + 7; } /* Parse the job submission control line */ static void _rptopen1(TMCHAR *user_pass,int argc,TMCHAR *argv[]) { /* parse the command line parameters */ for ( cnt=1 ; cnt