/*TMCI18N BEGIN HEADER*/ #if !defined( tmBundle_EXISTS ) #define TM_ON_STARTUP tmInitGlobS_sfrtmst #include "tmcilib.h" static struct TMBundle tmBundle = {"sfrtmst.pc",NULL,NULL,NULL,NULL}; #define tmBundle_EXISTS #endif /*TMCI18N END HEADER*/ /* AUDIT_TRAIL_MSGKEY_UPDATE -- PROJECT : MSGKEY -- MODULE : SFRTMST -- SOURCE : enUS -- TARGET : I18N -- DATE : Tue Nov 29 03:48:16 2011 -- MSGSIGN : #8130666c576f8e53 END AUDIT_TRAIL_MSGKEY_UPDATE */ /* AUDIT_TRAIL_TM63 -- TranMan 6.3 -- PROJECT : PVV_TEST -- MODULE : SFRTMST -- SOURCE : enUS -- TARGET : I18N -- DATE : Wed Oct 17 05:38:52 2007 END AUDIT_TRAIL_TM63 */ /******************************************************************************/ /* SFRTMST.PC Copyright (c) SCT Corporation 1995. All rights reserved. */ /* COPYRIGHT..: Copyright (c) SunGard 1995 - 2009. All rights reserved. */ /******************************************************************************/ /****************************************************************************/ /* */ /* Copyright 1995 - 2009 SunGard. All rights reserved. */ /* */ /* SunGard or its subsidiaries in the U.S. and other countries is the owner */ /* of numerous marks, including "SunGard," the SunGard logo, "Banner," */ /* "PowerCAMPUS," "Advance," "Luminis," "UDC," and "Unified Digital Campus."*/ /* Other names and marks used in this material are owned by third parties. */ /* */ /* This [site/software] contains confidential and proprietary information */ /* of SunGard and its subsidiaries. Use of this [site/software] is limited */ /* to SunGard Higher Education licensees, and is subject to the terms and */ /* conditions of one or more written license agreements between SunGard */ /* Higher Education and the licensee in question. */ /* */ /****************************************************************************/ /* SFRTMST.PC */ /* */ /* Time Status Calculation Update Program */ /* */ /* AUDIT TRAIL: 2.0.8 */ /* INIT DATE */ /* __________________________________________________ ____ ________ */ /* 1. New program to determine if the existing time MKH 07/07/95 */ /* status record is current and, if necessary, */ /* update the time status information in SFBETRM */ /* and insert a time status history record into */ /* SFRTHST. If a difference exists, the Id, name, */ /* existing time status code, current time status */ /* code, and either an '**' indicating that the */ /* record has been/will be updated, depending on */ /* whether the run mode selected is (A)udit or */ /* (U)pdate, or a message indicating the reason no */ /* action was taken will be included in the report */ /* (sfrtmst.lis) produced by the process. Records */ /* with a message indicating that no action has */ /* been taken should be reviewed to determine if */ /* they should/must be updated manually. */ /* */ /* 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 ofBANNER2.1. */ /* (Not all changes necessarily apply.) */ /* 2. Added READ_CAMP_CODE and READ_LEVL_CODE to retrieve MKH 10/31/95*/ /* parameter values from job submission. */ /* */ /* AUDIT TRAIL: 2.1.8 */ /* 1. Modified GETSTATUS to populate the grad_ind with MKH 04/01/96 */ /* "G" only if the graduation term contained in */ /* SHRDGMR_TERM_CODE_GRAD matches the term specified. */ /* 2. Removed unused functions READCAMP and READLEVL. MKH 04/01/96 */ /* */ /* AUDIT TRAIL: 3.0.0.1 */ /* 1. Defect #5160. Added closing comment to line BTD 11/20/97 */ /* that displays the file name. */ /* */ /* AUDIT TRAIL:3.1 */ /* 1.Update release no. LK 02/11/98 */ /* 2.For Year 2000 compliance testing */ /* change date field size. */ /* */ /* AUDIT TRAIL: 4.0 */ /* 1. Modify Release Number in Report Control Information */ /* header. AT 01/21/99 */ /* */ /* 2. Expand camp and camp_code to 4 characters. AT 01/21/99 */ /* */ /* 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. */ /* */ /* AUDIT TRAIL: 4.3.3 */ /* 1. Defect 44403. EFD 09/07/2000 */ /* Problem..Previous defect correction 14648 was not implemented */ /* Fix......Change length of ofile_name from 40 to 81. */ /* Also added several missing indicator variables, and added */ /* distinct to validate_one_up_no to prevent */ /* SELECT...INTO returns too many rows error */ /* Also removed unused variables and functions */ /* */ /* AUDIT TRAIL: 5.4.0.1 */ /* 1. Defect 78666. JC 06/21/2002 */ /* Problem..If more than one row is returned from SFRTMST which has */ /* the same number of criteria that matches the student, */ /* you don't know which row you will get. For example, if */ /* one row in SFRTMST matches student's COLL, DEGR, and */ /* MAJR, and another row matches student's LEVL, CAMP, and */ /* STYP, you could get either row. */ /* Fix......Modified ORDER BY clause in gettmst. If multiple rows */ /* are found with same number of matching criteria, one of */ /* those rows will be selected by "weight". Weight is */ /* determined by the order of the criteria on form SFATMST.*/ /* For example, LEVL carries more weight than CAMP, which */ /* carries more weight than COLL, etc. */ /* */ /*AUDIT TRAIL: 6.0 */ /* 1. Student Expanded Credit Hours and GPA Project DRA OCT072002 */ /* */ /* AUDIT TRAIL: 7.0 */ /*1. APIs DRA 29APR2004 */ /* Replace LOCK SFBETRM with sb_enrollment.p_lock(). */ /*2. APIs DRA 29APR2004 */ /* Replace UPDATE SFBETRM with sb_enrollment.p_update(). */ /* */ /* AUDIT TRAIL: 7.3.1 JC 07/25/2006 */ /*1. NSC Enhancements */ /* Modified function gettmst. Replaced existing code with call to */ /* sfkfunc.p_calc_tmst. */ /* */ /* AUDIT TRAIL: 8.0 */ /*1. Concurrent Curricula ES 06/08/2007 */ /* Remove retrieval of the level camp college degree and major */ /* from the cursor, add procedure calls to select the values from the */ /* primary learner curriculum. Select the primary major for the */ /* curriculum. */ /* */ /* AUDIT TRAIL: 8.1.1 */ /*1. Defect 1-42ZSJX JC 10/20/2008 */ /* Problem: When SFRTMST is run, time status for all students is */ /* reset to the value associated with 0.000 credits. */ /* Fix: Two arguments were in the wrong order in the call to */ /* p_calc_tmst in 8.0 version (not a problem in 7x). Changed */ /* the order of 'styp' and 'term'. */ /* */ /* AUDIT TRAIL: 8.2 */ /*1. Defect 1-4YIQGX JC 02/25/2009 */ /* Problem: Program prints negative number of records updated. */ /* Fix: Changed definition of variables 'numrec', 'numrev', 'numupd',*/ /* and 'num_to_upd' as follows: */ /* OLD: short int numrec */ /* NEW: long int numrec */ /*2. Defect 1-5EP0D5 JC 05/14/2009 */ /* Problem: Program aborts in update mode, as soon as first error */ /* is encountered. */ /* Fix: Changed the following line of code: */ /* OLD: if (!*pidm) */ /* goto skiprecord; */ /* NEW: if (!tmstrcmp(pidm,_TMC("0")) ) */ /* goto skiprecord; */ /* */ /* AUDIT TRAIL: 8.2.1 */ /*1. Defect 1-5JHVZQ MAH 6/12/09 */ /* Problem: The routine getdata reads the students from the enrollment and student tables and then reads concurrent curricula separately to determine if they have a college, level or campus on their primary curriculum. The comparison to the job submission parameters was incorrect logically causing all students to be accepted for processing. Solution: Rewrite the logic to fetch the concurrent curriculum data and the comparisons of those values to the data in the parameters The and / or conditions for the matched value outcome comparison was incorrect. Remove join to spbpers from the main select and separate into it's own cursor to remove the outer join. /* */ /* */ /* AUDIT TRAIL: 8.4 PV 01/12/2010 */ /* Student centric period changes. */ /* */ /* 1.Added new parameter(05) */ /* Calculate SCP(Student Centric Period) Time Status. */ /* */ /* 2. Added below new functions. */ /* static int read_calc_scps_ind(void) */ /* static void get_term_comments(void); */ /* static void get_scps_data(void); */ /* static void get_scps_code(void); */ /* static void get_scps_old_tmst(void); */ /* static void get_scps_new_tmst(void). */ /* static void get_scps_comments(void). */ /* static void check_scps_enabled(void); */ /* static void insstsh(void); */ /* static void lock_sfrthst(); */ /* */ /* 3. Modified Functions */ /* static void getdata(void). */ /* static void retrieve_parms(void). */ /* static void print_subheading(void). */ /* static void getparms(void). */ /* */ /* 4. Added new variables */ /* static TMCHAR comments[80]. */ /* static TMCHAR scps_comments[80]. */ /* static TMCHAR calc_scps_ind[2]. */ /* static TMCHAR scps_tmst_new[3]. */ /* static TMCHAR scps_tmst_old[3]. */ /* static TMCHAR scps_tmst_maint_ind[3]. */ /* static TMCHAR scps_tmst_desc[31]. */ /* static TMCHAR scps_code[10]. */ /* static TMCHAR display_tmst[3]. */ /* static TMCHAR scps_enabled[2]. */ /* static TMCHAR scps_eff_styp[3]. */ /* static TMCHAR scps_eff_term[3]. */ /* */ /* AUDIT TRAIL: 8.4 */ /* Defect 1-AYKY6H PV 3/1/10 */ /* Problem:Rephase the error message that is generated */ /* When PROCESSSCP does not =Y on .log file */ /* */ /* Solution:Made changes in the main func to rephase error message to */ /*Process by Student Period must be N when GTVSDAX PROCESSSCP does not=Y*/ /* AUDIT TRAIL: 8.5.0.1 */ /* 1. Defect 1-C4WHCE */ /* Problem: the process is updating a manual Time Status value that */ /* was entered on SFAREGS */ /* Fix: Code added to process study path forced update each time */ /* a row was processed. Added if statement to check the tmst_maint_ind */ /* If the variable is 'S' allow update to continue. */ /* AUDIT TRAIL: 8.5.3 */ /* 1. Defect 1-KVH7NN MV 09/16/2011 */ /* Problem: Some lines have incorrect function call (there are more) */ /* Following code have called incorrect function */ /* (Lines from 1462 to 1466,1197,1206) */ /* 1. tmfprintf(&tmBundle, ofile,_TMC("{0,%25s} Time Status Code(Term Basis) */ /* Time Status Code(Student Centric Period Basis)\n"),filler); */ /* 2. tmfprintf(&tmBundle, ofile,_TMC("ID/Name{0,%21s}Existing Revised Comments */ /* Existing Revised Comments\n"),filler,filler); */ /* 3. tmstrcpy(comments,_TMC("Deceased")); */ /* 4. tmstrcpy(comments,_TMC("Graduated")); */ /* 5. tmstrcpy(comments,_TMC("No Grad Term on SHADEGR")); */ /* 6. tmstrcpy(comments,_TMC("Leave of absence")); */ /* 7. tmstrcpy(comments,_TMC("Withdrawn")); */ /* 8. tmstrcpy(comments,_TMC("MUST be updated manually")); */ /* 9. tmstrcpy(comments,_TMC("ERROR - Must be resolved")); */ /* 10. tmstrcpy(comments,_TMC("**")); */ /* 11. tmstrcpy( scps_comments, _TMC( "Deceased" ) ); */ /* 12. tmstrcpy( scps_comments, _TMC( "MUST be updated manually" ) ); */ /* 13. tmstrcpy( scps_comments, _TMC( "ERROR - Must be resolved" ) ); */ /* 14. tmstrcpy( scps_comments, _TMC( "**" ) ); */ /* Fix: Used TM_NLS_Get function instead of _TMC function. */ /* AUDIT TRAIL END */ /* */ /* */ /***********************************************************************/ /* Parameters: TERM - Required - Character(6) - Single */ /* Term for which data is to be reported to the */ /* National Student Loan Clearinghouse, validated */ /* against STVTERM. */ /* CAMPUS - Required - Character(1) - Single */ /* Campus for which records are to be included in the */ /* report. Valid values are a single campus code, */ /* validated against STVCAMP, or '%' to include all */ /* campuses. Default is '%'. */ /* LEVEL - Required - Character(2) - Single */ /* Level for which records are to be included in the */ /* report. Valid values are a single level code, */ /* validated against STVLEVL, or '%' to include all */ /* levels. Default is '%'. */ /* RUN MODE - Required - Character(1) - Single */ /* Mode in which report is to be run. Valid values */ /* are 'A' for Audit and 'U' for Update. Default is */ /* 'A' for Audit. */ /* CALCULATE SCP(Student Centric Period)TIME STATUS */ /* Required - Character(1) - Single */ /* Mode in which report is to be run.Valid values are */ /* Y to process Student-Centric Period time status. */ /* Default is 'N'. */ /* */ /* Tables: */ /* GJBJOBS Report/Process Definition Table */ /* GJBPDEF Jobs Parameter Definition Table */ /* GJBPRUN Process Run Parameter Table */ /* GUBINST Institutional Description Table */ /* */ /* SFBETRM Student Registration Table */ /* SFRSTCR Student Course Registration Repeating Table */ /* SFRTHST Student Enrollament Time Status History Table */ /* SFRTMSL Full/Part Time Status Level Code Table */ /* SFRTMST Full/Part Time Status Rules Code Table */ /* SGBSTDN Student Base Table */ /* SHRDGMR Degree Table */ /* SPBPERS Basic Person Base Table */ /* SPRIDEN Person Identification/Name Repeating Table */ /* STVCAMP Campus Validation Table */ /* STVDEGS Degree Status Code Validation Table */ /* STVESTS Student Registration Status Validation Table */ /* STVLEVL Division Code Validation Table */ /* STVTERM Term Code Validation Table */ /* STVTMST Full/Part Time Status Validation Table */ /* SOBSCPS Student Centric Periods Table */ /* SORSCPT Student Centric Period Term Control Table */ /* SFRSTSH Student Centric Time Status History Table */ /* SFRSTST Student Centric Time Status Table */ /* SFRSTSL Student Centric Time Status Levels table */ /* */ /* */ /* ******************************************************************* */ #include "guarpfe.h" EXEC SQL INCLUDE guaorac.c; EXEC SQL BEGIN DECLARE SECTION; /* Standard variables */ static TMCHAR rptname[8]; static BANNUMSTR(linelimit); short int lineno; static TMCHAR curr_date[21]; static TMCHAR title_var[31]; short int count; short int pageno; static TMCHAR sessionid[31]={0}/*TMCI18N CHANGED FROM ""*/; /* Application variables */ static TMCHAR camp_code[4]; short int date_time_len=20; static TMCHAR dead_ind[2]; static TMCHAR filler[2]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR grad_term[7]={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR grad_ind[2]; static TMCHAR id[10]; short int inst_len; static TMCHAR inst_name[31]; short int inst_pos; static TMCHAR leav_from_date[12]; static TMCHAR leav_to_date[12]; static TMCHAR levl_code[3]; static TMCHAR name[80]; short int numlines; long int numupd; long int numrec; long int numrev; long int num_to_upd; short int page_num_len=4; short int page_pos; static BANNUMSTR(pidm); short int rpt_wid=132; short int rpt_pos; static TMCHAR run_mode[2]; static TMCHAR term[7]; short int term_len=7; short int title_len; short int title_pos; static TMCHAR tmst_maint_ind[2]; static TMCHAR tmst_new[3]; static TMCHAR tmst_desc[31]; static TMCHAR tmst_old[3]; static TMCHAR levl[3]; static TMCHAR styp[2]; static TMCHAR camp[4]; static TMCHAR coll[3]; static TMCHAR majr[5]; static TMCHAR degc[7]; static TMCHAR valid_parm[2]; static TMCHAR withdraw_ind[2]; int lcur_seqno=0; static TMCHAR found_camp[2]={0}; static TMCHAR found_levl[2]={0}; /* Job submission alteration */ static BANNUMSTR(rpt_one_up_no)={0}/*TMCI18N CHANGED FROM ""*/; static TMCHAR valid_ind[2]; static TMCHAR comments[80]; static TMCHAR scps_comments[80]; static TMCHAR calc_scps_ind[2]; static TMCHAR scps_tmst_new[3]; static TMCHAR scps_tmst_old[3]; static TMCHAR scps_tmst_maint_ind[3]; static TMCHAR scps_tmst_desc[31]; static TMCHAR scps_code[10]; static TMCHAR scps_eff_term[7]; static TMCHAR display_tmst[3]; static TMCHAR scps_eff_styp[3]; static TMCHAR scps_enabled[2]; /* 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; short Ind_21; short Ind_22; EXEC SQL END DECLARE SECTION; /* Local prototypes */ static void _rptopen1(TMCHAR *user_pass,int argc,TMCHAR *argv[]); static int validate_one_up_no(void); static void getdata(void); static void getparms(void); static void insthst(void); static void invalid_parm(void); static void lock_sfbetrm(void); static void lock_sfrthst(void); static void print_heading(void); static void print_subheading(void); static int seltitle(void); static int sel_gubinst(void); static void sel_numlines(void); static void retrieve_parms(void); static int read_camp_code(void); static int read_levl_code(void); static int readterm(void); static int read_line_count(void); static int read_run_mode(void); static void delparms(void); static void getsession(void); static int getstatus(void); static void gettmst(void); static void updetrm(void); static int validate_camp(void); static int validate_levl(void); static int validate_term(void); static int read_calc_scps_ind(void); static void get_term_comments(void); static void get_scps_data(void); static void get_scps_code(void); static void get_scps_old_tmst(void); static void get_scps_new_tmst(void); static void lock_sfrstsh(void); static void get_scps_comments(void); static void insstsh(void); static void check_scps_enabled(void); /* Output file. */ static UFILE *ofile; int cnt,i,next_arg; /*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]; /* **************************************************************** */ int main(int argc, TMCHAR *argv[]) { extern short sqltrace_flag; /* sql_trace option is on */ _rptopen1(user_pass,argc,argv); getxnam(*argv); login(); if (sqltrace_flag) EXEC SQL ALTER SESSION SET SQL_TRACE TRUE; tmstrcpy(rptname,_TMC("SFRTMST")); /* Initialize variables */ sysdate(curr_date,ORA_NLS_DATE_FORMAT); numrec = 0; lineno = 0; pageno = 1; count = 0; getsession(); /* Job submission alteration */ input (rpt_one_up_no, TM_NLS_Get("0000","RUN SEQUENCE NUMBER: "),26,NUM); if (*rpt_one_up_no) { tmstrcpy(valid_ind, _TMC("N")); validate_one_up_no(); if (!tmstrcmp(valid_ind,_TMC("Y"))) { retrieve_parms(); } else { tmprintf(&tmBundle, TM_NLS_Get("0001","Parameter sequence number is invalid, aborting job\n")); exit2os(EXIT_SUCCESS); } } else { getparms(); /* Ask for parameters */ } if (!tmstrcmp(calc_scps_ind,_TMC("Y"))) { check_scps_enabled(); if (tmstrcmp(scps_enabled,_TMC("Y"))) { tmprintf(&tmBundle, TM_NLS_Get("0002","Process by Student Period must be N when GTVSDAX PROCESSSCP does not = Y\n")); exit2os(EXIT_SUCCESS); } else lock_sfrstsh(); /* Lock SFRSTSH table */ } sel_gubinst(); /* Get institution name & address */ seltitle(); /* Get report title */ sel_numlines(); /* Convert linelimit to type int */ lock_sfbetrm(); /* Lock SFBETRM table */ lock_sfrthst(); /* Lock SFRTHST table */ /* Print report and update/insert time status records as necessary */ print_heading(); if (!tmstrcmp(run_mode,_TMC("U"))) tmfprintf(&tmBundle, ofile,TM_NLS_Get("0003","{0,%55s}** Time Status Updated\n\n"),filler); else tmfprintf(&tmBundle, ofile,TM_NLS_Get("0004","{0,%53s}** Time Status to be Updated\n\n"),filler); lineno = lineno + 2; count = count + 2; print_subheading(); getdata(); if (num_to_upd == 0) { tmfprintf(&tmBundle, ofile,TM_NLS_Get("0005","\n\n{0,%44s}*** No Time Status Records to be Updated ***\n"), filler); count = count + 3; } tmfprintf(&tmBundle, ofile,_TMC("\f")); print_heading(); tmfprintf(&tmBundle, ofile,TM_NLS_Get("0006","{0,%35s}* * * REPORT CONTROL INFORMATION - "),filler); tmfprintf(&tmBundle, ofile,TM_NLS_Get("0007","{0} - Release 8.5.3 * * *\n"),rptname); tmfprintf(&tmBundle, ofile,_TMC("\n\n")); tmfprintf(&tmBundle, ofile,TM_NLS_Get("0008","TERM: {0}\n\n"),term); tmfprintf(&tmBundle, ofile,TM_NLS_Get("0009","CAMPUS CODE: ")); tmfprintf(&tmBundle, ofile,_TMC("{0}\n\n"),camp_code); tmfprintf(&tmBundle, ofile,TM_NLS_Get("0010","LEVEL CODE: ")); tmfprintf(&tmBundle, ofile,_TMC("{0}\n\n"),levl_code); tmfprintf(&tmBundle, ofile,TM_NLS_Get("0011","RUN MODE: {0}\n\n"),run_mode); tmfprintf(&tmBundle, ofile,TM_NLS_Get("0012","CALCULATE SCP(Student Centric Period)TIME STATUS: {0}\n\n\n"),calc_scps_ind); tmfprintf(&tmBundle, ofile,TM_NLS_Get("0013","Number of Records Processed: {0,number,integer}\n\n"),numrec); tmfprintf(&tmBundle, ofile,TM_NLS_Get("0014","Number of Records Eligible for Update: {0,number,integer}\n"),num_to_upd); if (!tmstrcmp(run_mode,_TMC("A"))) tmfprintf(&tmBundle, ofile,TM_NLS_Get("0015"," Number of Records to be Updated: {0,number,integer}\n"),numupd); else tmfprintf(&tmBundle, ofile,TM_NLS_Get("0016"," Number of Records Updated: {0,number,integer}\n"),numupd); tmfprintf(&tmBundle, ofile,TM_NLS_Get("0017"," Number of Records for Review: {0,number,integer}\n"),numrev); count = count + 17; prtmsg(CMPNORM,str2lc(rptname)); prtmsg(LINSOUT,count,ofile_name); exit2os(EXIT_SUCCESS); return (0); } /* **************************************************************** */ /* Delete paramter table records */ static void delparms(void) { EXEC SQL DELETE GJBPRUN WHERE GJBPRUN_JOB = :rptname AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); POSTORA; } /* **************************************************************** */ /* Retrieve data for report - driving select */ static void getdata(void) { EXEC SQL DECLARE cursor_100 CURSOR FOR SELECT SGBSTDN_PIDM, SFBETRM_TMST_CODE, SFBETRM_TMST_MAINT_IND, SGBSTDN_STYP_CODE, TO_CHAR(SGBSTDN_LEAV_FROM_DATE,'YYYYMMDD'), TO_CHAR(SGBSTDN_LEAV_TO_DATE,'YYYYMMDD'), SPRIDEN_ID, SPRIDEN_LAST_NAME||', '||SPRIDEN_FIRST_NAME||' '|| SUBSTR(SPRIDEN_MI,1,1), STVESTS_EFF_HEADCOUNT FROM SPRIDEN, SGBSTDN A, SFBETRM, STVESTS WHERE SFBETRM_TERM_CODE = :term AND STVESTS_CODE = SFBETRM_ESTS_CODE AND A.SGBSTDN_PIDM = SFBETRM_PIDM AND A.SGBSTDN_TERM_CODE_EFF = (SELECT MAX(B.SGBSTDN_TERM_CODE_EFF) FROM SGBSTDN B WHERE B.SGBSTDN_PIDM = A.SGBSTDN_PIDM AND B.SGBSTDN_TERM_CODE_EFF <= :term) AND SPRIDEN_PIDM = SFBETRM_PIDM AND SPRIDEN_ENTITY_IND = 'P' AND SPRIDEN_CHANGE_IND IS NULL ORDER BY 8; EXEC SQL OPEN cursor_100; /* Open the main select cursor */ POSTORA; while (1) { EXEC SQL FETCH cursor_100 INTO :pidm:Ind_01, :tmst_old:Ind_02, :tmst_maint_ind:Ind_03, :styp:Ind_05, :leav_from_date:Ind_10, :leav_to_date:Ind_11, :id:Ind_12, :name:Ind_13, :withdraw_ind:Ind_15; POSTORA; if (NO_ROWS_FOUND) { *pidm='\0'; *tmst_old='\0'; *tmst_maint_ind='\0'; *styp='\0'; *leav_from_date='\0'; *leav_to_date='\0'; *id='\0'; *name='\0'; *withdraw_ind='\0'; break; } *levl='\0'; *camp='\0'; *coll='\0'; *majr='\0'; *degc='\0'; lcur_seqno=0; *dead_ind='\0'; /* separate spbpers select to remove outer join */ EXEC SQL DECLARE cursor_pers CURSOR for SELECT SPBPERS_DEAD_IND FROM SPBPERS WHERE SPBPERS_PIDM = :pidm; EXEC SQL OPEN cursor_pers; POSTORA; EXEC SQL FETCH cursor_pers INTO :dead_ind:Ind_14; POSTORA; if (NO_ROWS_FOUND) { *dead_ind='\0'; } EXEC SQL CLOSE cursor_pers; POSTORA; /* procedure to get the curriculum and the major */ /* 8.2.1 rewrite cursors and fetches to include pointers to address nulls */ EXEC SQL EXECUTE BEGIN /* get the level for the current term */ Soklcur.p_create_sotvcur(p_pidm => :pidm, p_lmod_code => sb_curriculum_str.f_learner, p_term_code => :term); END; END-EXEC; POSTORA; EXEC SQL DECLARE cursor_lcur_c CURSOR for Select sovlcur_levl_code, sovlcur_coll_code, sovlcur_camp_code, sovlcur_degc_code, sovlcur_seqno From sovlcur Where sovlcur_pidm = :pidm And sovlcur_lmod_code = sb_curriculum_str.f_learner And sovlcur_current_ind = 'Y' And sovlcur_active_ind = 'Y' and sovlcur_priority_no = ( select min(m.sovlcur_priority_no) from sovlcur m where m.sovlcur_pidm = sovlcur.sovlcur_pidm and m.sovlcur_lmod_code = sovlcur.sovlcur_lmod_code And m.sovlcur_current_ind = 'Y' And m.sovlcur_active_ind = 'Y' ) Order by sovlcur_priority_no; EXEC SQL OPEN cursor_lcur_c; POSTORA; EXEC SQL FETCH cursor_lcur_c INTO :levl:Ind_01, :coll:Ind_02 , :camp:Ind_03 , :degc:Ind_04, :lcur_seqno:Ind_05 ; POSTORA; if (NO_ROWS_FOUND) { *levl='\0'; *camp='\0'; *coll='\0'; *degc='\0'; lcur_seqno=0; } EXEC SQL CLOSE cursor_lcur_c; POSTORA; EXEC SQL DECLARE cursor_lfos_c CURSOR for select sovlfos_majr_code from sovlfos where sovlfos_pidm = :pidm and sovlfos_lcur_seqno = :lcur_seqno and sovlfos_current_ind = 'Y' and sovlfos_active_ind = 'Y' and sovlfos_lfst_code = sb_fieldofstudy_str.f_major and sovlfos_priority_no = ( select min(m.sovlfos_priority_no) from sovlfos m where m.sovlfos_pidm = :pidm and m.sovlfos_lcur_seqno = sovlfos.sovlfos_lcur_seqno and m.sovlfos_current_ind = 'Y' and m.sovlfos_active_ind = 'Y' and m.sovlfos_lfst_code = sovlfos.sovlfos_lfst_code); EXEC SQL OPEN cursor_lfos_c; POSTORA; EXEC SQL FETCH cursor_lfos_c INTO :majr:Ind_01 ; POSTORA; if (NO_ROWS_FOUND) { *majr='\0'; } EXEC SQL CLOSE cursor_lfos_c; POSTORA; tmstrcpy(found_camp,_TMC("N")); tmstrcpy(found_levl,_TMC("N")); /* see if level code matches input parm */ if (!*levl_code) tmstrcpy(found_levl,_TMC("Y")); else if (!tmstrcmp(levl_code,_TMC("%")) ) tmstrcpy(found_levl,_TMC("Y")); else if (!tmstrcmp(levl_code,levl) ) tmstrcpy(found_levl,_TMC("Y")); /* see if campus matches input parm */ if (!*camp_code) tmstrcpy(found_camp,_TMC("Y")); else if (!tmstrcmp(camp_code,_TMC("%")) ) tmstrcpy(found_camp,_TMC("Y")); else if (!tmstrcmp(camp_code,camp) ) tmstrcpy(found_camp,_TMC("Y")); if ( ( !(tmstrcmp(found_camp,_TMC("N")) ) ) || ( !(tmstrcmp(found_levl,_TMC("N")) ) ) ) { *pidm='\0'; /* tmprintf (&tmBundle, _TMC("pidm not accepted found camp = {0}, pcamp= {1} camp {2} found lev: {3} plevl= {4} levl {5} pidm {6} \n"), found_camp, camp_code, camp, found_levl, levl_code , levl, pidm ); tmfflush(tmstdout);*/ goto skiprecord; } /* tmprintf (&tmBundle, _TMC("found camp = {0}, pcamp= {1} camp {2} found lev: {3} plevl= {4} levl {5} pidm {6} \n"), found_camp, camp_code, camp, found_levl, levl_code , levl, pidm ); tmfflush(tmstdout); */ numrec++; if (lineno >= numlines) { tmfprintf(&tmBundle, ofile,_TMC("\f")); print_heading(); print_subheading(); lineno = 0; } gettmst(); /* scp changes start */ /* if ((tmstrcmp(tmst_old,tmst_new)) || (!tmstrcmp(tmst_new,_TMC("99")))) { tmfprintf(&tmBundle, ofile,_TMC("{0,%-10s}{1,%-83s}{2,%-8s}{3,%-6s}"),id,name,tmst_old,tmst_new); num_to_upd++; switch(*dead_ind) { case 'Y': tmfprintf(&tmBundle, ofile,TM_NLS_Get("0016","Deceased\n")); numrev++; lineno++; count++; break; default: getstatus(); switch(*grad_ind) { case 'G': if (tmstrcmp(grad_term,_TMC(""))) tmfprintf(&tmBundle, ofile,TM_NLS_Get("0017","Graduated\n")); else tmfprintf(&tmBundle, ofile,TM_NLS_Get("0018","No Grad Term on SHADEGR\n")); numrev++; lineno++; count++; break; default: if ((tmstrcmp(leav_from_date,sysdate(NULL,ORA_NLS_DATE_FORMAT)) <= 0) && (tmstrcmp(leav_to_date,sysdate(NULL,ORA_NLS_DATE_FORMAT)) >= 0)) { tmfprintf(&tmBundle, ofile,TM_NLS_Get("0019","Leave of absence\n")); numrev++; lineno++; count++; } else switch(*withdraw_ind) { case 'N': tmfprintf(&tmBundle, ofile,TM_NLS_Get("0020","Withdrawn\n")); numrev++; lineno++; count++; break; default: switch (*tmst_maint_ind) { case 'U': tmfprintf(&tmBundle, ofile,TM_NLS_Get("0021","MUST be updated manually\n")); numrev++; lineno++; count++; break; default: if (!tmstrcmp(tmst_new,_TMC("99"))) { tmfprintf(&tmBundle, ofile,TM_NLS_Get("0022","ERROR - Must be resolved\n")); numrev++; } else { tmfprintf(&tmBundle, ofile,_TMC("**\n")); numupd++; } lineno++; count++; if (!tmstrcmp(run_mode,_TMC("U"))) { updetrm(); insthst(); } } } } } tmfprintf(&tmBundle, ofile,_TMC("\n")); lineno++; count++; } */ tmstrcpy(display_tmst,_TMC("")); if ( ( tmstrcmp( tmst_old, tmst_new ) ) || ( !tmstrcmp( tmst_new, _TMC( "99" ) ) ) ) { tmstrcpy( display_tmst, _TMC( "Y" ) ); get_term_comments(); if ( !tmstrcmp( run_mode, _TMC( "U" ) ) ) { if (!tmstrcmp(tmst_maint_ind, _TMC( "S" ) ) ) { updetrm(); insthst(); } if (!*tmst_maint_ind ) { updetrm(); insthst(); } } } else { tmstrcpy( tmst_old, _TMC( "" ) ); tmstrcpy( tmst_new, _TMC( "" ) ); tmstrcpy( comments, _TMC( "" ) ); } if ( !tmstrcmp( calc_scps_ind, _TMC( "Y" ) ) ) { get_scps_data(); if ( tmstrcmp( scps_code, _TMC( "" ) ) ) { if ( ( tmstrcmp( scps_tmst_old, scps_tmst_new ) ) || ( !tmstrcmp( scps_tmst_new, _TMC( "99" ) ) ) ) { tmstrcpy( display_tmst, _TMC( "Y" ) ); get_scps_comments(); if ( !tmstrcmp( run_mode, _TMC( "U" ) ) ) { insstsh(); } } else { tmstrcpy( scps_tmst_old, _TMC( "" ) ); tmstrcpy( scps_tmst_new, _TMC( "" ) ); tmstrcpy( scps_comments, _TMC( "" ) ); } } else { tmstrcpy( scps_tmst_old, _TMC( "" ) ); tmstrcpy( scps_tmst_new, _TMC( "" ) ); tmstrcpy( scps_comments, _TMC( "" ) ); } } if ( !tmstrcmp( display_tmst, _TMC( "Y" ) ) ) { tmfprintf( &tmBundle, ofile, _TMC( "{0,%-10s}{1,%21s} {2,%-6s}{3,%-35s}{4,%-8s} {5,%-6s}{6,%-35s}" ), id, tmst_old, tmst_new, comments, scps_tmst_old, scps_tmst_new, scps_comments ); tmfprintf( &tmBundle, ofile, _TMC( "\n" ) ); tmfprintf( &tmBundle, ofile, _TMC( "{0,%-83s}" ), name ); tmfprintf( &tmBundle, ofile, _TMC( "\n\n" ) ); num_to_upd++; lineno++; count++; } /* scp changes end*/ skiprecord: continue; } } /* **************************************************************** */ /* Prompt for parameters */ static void getparms(void) { tmstrcpy(valid_parm,_TMC("N")); /* Prompt for term */ while (tmstrcmp(valid_parm,_TMC("Y"))) { input(term, TM_NLS_Get("0018","TERM: "), 6, ALPHA); { validate_term(); if (!tmstrcmp(valid_ind,_TMC("Y"))) tmstrcpy(valid_parm,_TMC("Y")); else invalid_parm(); } } tmstrcpy(valid_parm,_TMC("N")); /* Prompt for Campus Code - % for All */ while (tmstrcmp(valid_parm,_TMC("Y"))) { input(camp_code, TM_NLS_Get("0019","CAMPUS CODE - {0,% f}or All - Default [%]: "), 3, ALPHA); if ((!*camp_code) || (!tmstrcmp(camp_code,_TMC("%")))) { tmstrcpy(camp_code,_TMC("%")); tmstrcpy(valid_parm,_TMC("Y")); } else { tmstrcpy(camp_code,str2uc(camp_code)); validate_camp(); if (!tmstrcmp(valid_ind,_TMC("Y"))) tmstrcpy(valid_parm,_TMC("Y")); else invalid_parm(); } } tmstrcpy(valid_parm,_TMC("N")); /* Prompt for Level Code - % for All */ while (tmstrcmp(valid_parm,_TMC("Y"))) { input(levl_code, TM_NLS_Get("0020","LEVEL CODE - {0,% f}or All - Default [%]: "), 2, ALPHA); if ((!*levl_code) || (!tmstrcmp(levl_code,_TMC("%")))) { tmstrcpy(levl_code,_TMC("%")); tmstrcpy(valid_parm,_TMC("Y")); } else { tmstrcpy(levl_code,str2uc(levl_code)); validate_levl(); if (!tmstrcmp(valid_ind,_TMC("Y"))) tmstrcpy(valid_parm,_TMC("Y")); else invalid_parm(); } } tmstrcpy(valid_parm,_TMC("N")); /* Prompt for Run Mode - (A)udit or (U)pdate */ while (tmstrcmp(valid_parm,_TMC("Y"))) { input(run_mode, TM_NLS_Get("0021","RUN MODE - (A)udit or (U)pdate - Default [A]: "), 1, ALPHA); if (!*run_mode) { tmstrcpy(run_mode,_TMC("A")); tmstrcpy(valid_parm,_TMC("Y")); } else { tmstrcpy(run_mode,str2uc(run_mode)); if (!inlist(run_mode,ALPHA,_TMC("A"),_TMC("U"))) invalid_parm(); else tmstrcpy(valid_parm,_TMC("Y")); } } tmstrcpy(valid_parm,_TMC("N")); /* Calculate SCP(Student Centric Period) Time Status - (Y) to process or (N) */ while ( tmstrcmp( valid_parm, _TMC( "Y" ) ) ) { input( calc_scps_ind, TM_NLS_Get( "0022", "CALCULATE SCP(Student Centric Period)TIME STATUS (Y/N): " ), 1,ALPHA ); if ( !*calc_scps_ind ) { tmstrcpy( calc_scps_ind, _TMC( "N" ) ); tmstrcpy( valid_parm, _TMC( "Y" ) ); } else { tmstrcpy( calc_scps_ind, str2uc( calc_scps_ind ) ); if ( !inlist( calc_scps_ind, ALPHA, _TMC( "Y" ), _TMC( "N" ) ) ) invalid_parm(); else tmstrcpy( valid_parm, _TMC( "Y" ) ); } } tmstrcpy(valid_parm,_TMC("N")); /* Prompt for line count */ input(linelimit, TM_NLS_Get("0023","NUMBER OF LINES PRINTED PER PAGE [55]: "), 26, NUM); if (!*linelimit) tmstrcpy(linelimit,_TMC("55")); } /* **************************************************************** */ /* Get session id */ static void getsession(void) { EXEC SQL SELECT USERENV('SESSIONID') INTO :sessionid:Ind_01 FROM DUAL; POSTORA; } /* **************************************************************** */ /* Retrieve graduation status */ static int getstatus(void) { EXEC SQL SELECT 'Y',SHRDGMR_TERM_CODE_GRAD INTO :grad_ind:Ind_01, :grad_term:Ind_02 FROM SHRDGMR, STVDEGS WHERE STVDEGS_CODE = SHRDGMR_DEGS_CODE AND STVDEGS_AWARD_STATUS_IND = 'A' AND SHRDGMR_PIDM = :pidm AND SHRDGMR_LEVL_CODE = :levl; POSTORA; if (NO_ROWS_FOUND) { *grad_ind = '\0'; *grad_term = '\0'; return FALSE; } if (!tmstrcmp(grad_ind,_TMC("Y"))) if ((!tmstrcmp(term,grad_term)) || (!tmstrcmp(grad_term,_TMC("")))) tmstrcpy(grad_ind,_TMC("G")); else tmstrcpy(grad_ind,_TMC("")); return TRUE; } /* **************************************************************** */ /* Calculate current time status for student */ static void gettmst(void) { EXEC SQL EXECUTE BEGIN sfkfunc.p_calc_tmst(:tmst_new:Ind_01, :tmst_desc:Ind_02, :styp, :term, :pidm); END; END-EXEC; POSTORA; if (!*tmst_new) tmstrcpy(tmst_new,_TMC("99")); } /* **************************************************************** */ /* Insert time status history (SFRTHST) record */ static void insthst(void) { EXEC SQL INSERT INTO SFRTHST (SFRTHST_PIDM, SFRTHST_TERM_CODE, SFRTHST_TMST_CODE, SFRTHST_TMST_DATE, SFRTHST_TMST_MAINT_IND, SFRTHST_USER, SFRTHST_ACTIVITY_DATE) VALUES (:pidm, :term, :tmst_new, SYSDATE, 'S', 'SFRTMST', SYSDATE); POSTORA; } /* **************************************************************** */ static void get_term_comments(void) { switch(*dead_ind) { case 'Y': tmstrcpy(comments, TM_NLS_Get("0024","Deceased")); numrev++; lineno++; count++; break; default: getstatus(); switch(*grad_ind) { case 'G': if (tmstrcmp(grad_term,_TMC(""))) tmstrcpy(comments,TM_NLS_Get("0025","Graduated")); else tmstrcpy(comments,TM_NLS_Get("0026","No Grad Term on SHADEGR")); numrev++; lineno++; count++; break; default: if ((tmstrcmp(leav_from_date,sysdate(NULL,ORA_NLS_DATE_FORMAT)) <= 0) && (tmstrcmp(leav_to_date,sysdate(NULL,ORA_NLS_DATE_FORMAT)) >= 0)) { tmstrcpy(comments,TM_NLS_Get("0027","Leave of absence")); numrev++; lineno++; count++; } else switch(*withdraw_ind) { case 'N': tmstrcpy(comments,TM_NLS_Get("0028","Withdrawn")); numrev++; lineno++; count++; break; default: switch (*tmst_maint_ind) { case 'U': tmstrcpy(comments,TM_NLS_Get("0029","MUST be updated manually")); numrev++; lineno++; count++; break; default: if (!tmstrcmp(tmst_new,_TMC("99"))) { tmstrcpy(comments,TM_NLS_Get("0030","ERROR - Must be resolved")); numrev++; } else { tmstrcpy(comments,TM_NLS_Get("0031","**")); numupd++; } } } } } } /* **************************************************************** */ /* scp changes start */ static void check_scps_enabled(void) { EXEC SQL EXECUTE BEGIN :scps_enabled := gokeacc.f_getgtvsdaxextcode('PROCESSSCP', 'CENTRICPERIODS'); END; END-EXEC; POSTORA; if (!*scps_enabled) tmstrcpy(scps_enabled,_TMC("N")); } /* **************************************************************** */ static void get_scps_data( void ) { get_scps_code(); if ( tmstrcmp( scps_code, _TMC( "" ) ) ) { get_scps_old_tmst(); if ( !tmstrcmp( scps_tmst_maint_ind, _TMC( "S" ) ) ) { get_scps_new_tmst(); } } } /* **************************************************************** */ static void get_scps_code(void) { EXEC SQL EXECUTE BEGIN sb_centricperiod.p_get_scps_term_styp(:scps_code:Ind_16, :scps_eff_term:Ind_17, :scps_eff_styp:Ind_18, :term, :pidm); END; END-EXEC; POSTORA; if (!*scps_tmst_new) tmstrcpy(scps_tmst_new,_TMC("99")); } /* **************************************************************** */ static void get_scps_old_tmst(void) { EXEC SQL EXECUTE BEGIN sb_centricperiod.p_get_scps_tmst_code(:scps_tmst_old:Ind_19, :scps_tmst_maint_ind:Ind_20, :scps_code, :pidm); END; END-EXEC; POSTORA; if (!*scps_tmst_maint_ind) tmstrcpy(scps_tmst_maint_ind,_TMC("S")); } /* **************************************************************** */ static void get_scps_new_tmst(void) { EXEC SQL EXECUTE BEGIN sfkfunc.p_calc_scps_tmst(:scps_tmst_new:Ind_21, :scps_tmst_desc:Ind_22, :scps_eff_styp, :scps_eff_term, :scps_code, :pidm); END; END-EXEC; POSTORA; if (!*scps_tmst_new) tmstrcpy(scps_tmst_new,_TMC("99")); } /* **************************************************************** */ /* Lock SFRSTSH in share update mode */ static void lock_sfrstsh(void) { EXEC SQL LOCK TABLE SFRSTSH IN SHARE UPDATE MODE; POSTORA; } /* **************************************************************** */ static void get_scps_comments(void) { switch(*dead_ind) { case 'Y': tmstrcpy( scps_comments, TM_NLS_Get("0032", "Deceased" ) ); numrev++; lineno++; count++; break; default: switch ( *scps_tmst_maint_ind ) { case 'U': tmstrcpy( scps_comments, TM_NLS_Get("0033", "MUST be updated manually" ) ); numrev++; lineno++; count++; break; default: if ( !tmstrcmp( scps_tmst_new, _TMC( "99" ) ) ) { tmstrcpy( scps_comments, TM_NLS_Get("0034", "ERROR - Must be resolved" ) ); numrev++; } else { tmstrcpy( scps_comments, TM_NLS_Get("0035", "**" ) ); numupd++; } lineno++; count++; } } } /* **************************************************************** */ /* Insert SCP time status history (SFRSTSH) record */ static void insstsh(void) { EXEC SQL INSERT INTO SFRSTSH (SFRSTSH_PIDM, SFRSTSH_SCPS_CODE, SFRSTSH_TMST_CODE, SFRSTSH_TMST_DATE, SFRSTSH_TMST_MAINT_IND, SFRSTSH_USER, SFRSTSH_ACTIVITY_DATE) VALUES (:pidm, :scps_code, :scps_tmst_new, SYSDATE, 'S', 'SFRTMST', SYSDATE); POSTORA; } /* scp changes end */ /* **************************************************************** */ /* Display invalid parameter message */ static void invalid_parm(void) { tmprintf (&tmBundle, TM_NLS_Get("0036","*ERROR* Parameter value is invalid, please reenter.\n")); } /* **************************************************************** */ /* Lock SFBETRM in share update mode */ static void lock_sfbetrm(void) { EXEC SQL LOCK TABLE SFBETRM IN SHARE UPDATE MODE; POSTORA; /*API Deactivated the LOCK on the SFBETRM TABLE, by request of Jan */ /*Craven and advice of Ed Delaney. If required the code can be */ /*reactivated at a later date, or completely removed. */ /************************************************************************ EXEC SQL EXECUTE DECLARE row_id VARCHAR(18); BEGIN gb_common.p_set_context(p_package_name => 'SB_ENROLLMENT', p_context_name => 'ENROLLMENT_BATCH_RULES', p_context_value => 'Y'); sb_enrollment.p_lock(p_pidm => :pidm, p_term_code => :term, p_rowid_inout => row_id); END; END-EXEC; POSTORA; *************************************************************************/ } /* **************************************************************** */ /* Lock SFRTHST in share update mode */ static void lock_sfrthst(void) { EXEC SQL LOCK TABLE SFRTHST IN SHARE UPDATE MODE; POSTORA; } /* **************************************************************** */ static void print_heading(void) { tmfprintf(&tmBundle, ofile,_TMC("{0}{1,%*s}{2,%*s} {3,number,integer}\n"),curr_date,inst_pos,inst_name,page_pos, TM_NLS_Get("0037","PAGE"),pageno); tmfprintf(&tmBundle, ofile,_TMC("{0}{1,%*s}{2,%*s}\n\n"),term,title_pos,title_var,rpt_pos,rptname); lineno = lineno + 3; count = count + 3; pageno++; } /* **************************************************************** */ static void print_subheading(void) { /* scp changes start */ /* tmfprintf(&tmBundle, ofile,_TMC("{0,%90s}Time Status Code\n"),filler); tmfprintf(&tmBundle, ofile,_TMC("ID{0,%8s}Name{1,%76s}Existing Revised Comments\n"),filler,filler); tmfprintf(&tmBundle, ofile,_TMC("--------- ----------------------------------------")); tmfprintf(&tmBundle, ofile,_TMC("--------------------------------------- ----------------")); tmfprintf(&tmBundle, ofile,_TMC(" -------------------------\n")); */ tmfprintf(&tmBundle, ofile, TM_NLS_Get("0038","{0,%25s} Time Status Code(Term Basis) Time Status Code(Student Centric Period Basis)\n"),filler); tmfprintf(&tmBundle, ofile, TM_NLS_Get("0039","ID/Name{0,%21s}Existing Revised Comments Existing Revised Comments\n"),filler,filler); tmfprintf(&tmBundle, ofile, TM_NLS_Get("0040","----------------------- --------------------------------")); tmfprintf(&tmBundle, ofile, TM_NLS_Get("0041","--------- -------------------")); tmfprintf(&tmBundle, ofile, TM_NLS_Get("0042","----------------------\n")); /* scp changes end */ lineno = lineno + 3; count = count + 3; } /* **************************************************************** */ static int readterm(void) { EXEC SQL SELECT GJBPRUN_VALUE INTO :term:Ind_01 FROM GJBPRUN WHERE GJBPRUN_NUMBER = '01' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); POSTORA; if (NO_ROWS_FOUND) { *term = '\0'; return FALSE; } return TRUE; } /* **************************************************************** */ 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 read_run_mode(void) { EXEC SQL SELECT GJBPRUN_VALUE INTO :run_mode:Ind_01 FROM GJBPRUN WHERE GJBPRUN_NUMBER = '04' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); POSTORA; if (NO_ROWS_FOUND) { *run_mode = '\0'; return FALSE; } return TRUE; } /* **************************************************************** */ static int read_camp_code(void) { EXEC SQL SELECT GJBPRUN_VALUE INTO :camp_code:Ind_01 FROM GJBPRUN WHERE GJBPRUN_NUMBER = '02' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); POSTORA; if (NO_ROWS_FOUND) { *camp_code = '\0'; return FALSE; } return TRUE; } /* **************************************************************** */ static int read_levl_code(void) { EXEC SQL SELECT GJBPRUN_VALUE INTO :levl_code:Ind_01 FROM GJBPRUN WHERE GJBPRUN_NUMBER = '03' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); POSTORA; if (NO_ROWS_FOUND) { *levl_code = '\0'; return FALSE; } return TRUE; } /* **************************************************************** */ /* scp changes start*/ static int read_calc_scps_ind(void) { EXEC SQL SELECT NVL(GJBPRUN_VALUE,'N') INTO :calc_scps_ind:Ind_01 FROM GJBPRUN WHERE GJBPRUN_NUMBER = '05' AND GJBPRUN_JOB = UPPER(:rptname) AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); POSTORA; if (NO_ROWS_FOUND) { tmstrcpy(calc_scps_ind,_TMC("N")); return FALSE; } return TRUE; } /* scp changes end */ /* **************************************************************** */ /* Parse the job submission control line */ static void _rptopen1(TMCHAR *upass,int argc,TMCHAR *argv[]) { /* parse the command line parameters */ for ( cnt=1 ; cnt 'SB_ENROLLMENT', p_context_name => 'ENROLLMENT_BATCH_RULES', p_context_value => 'Y'); sb_enrollment.p_update(p_term_code => :term, p_pidm =>:pidm, p_tmst_code => :tmst_new, p_tmst_date => SYSDATE, p_tmst_maint_ind => 'S', p_user => 'SFRTHST', p_data_origin => gb_common.DATA_ORIGIN); END; END-EXEC; POSTORA; /* if(POSTORA_API) TO BE IMPLEMENTED IF NEEDED. { printf ("The API generated error string is: %s\n", api_error_long); for(j = 0; j < api_error_count; j++) printf("Message = %d %s\n", j, api_error_list[j]); }*/ } /* **************************************************************** */ /* Check for valid job sequence number */ static int validate_one_up_no(void) { EXEC SQL SELECT distinct 'Y' /* 44403 */ INTO :valid_ind:Ind_01 FROM GJBPRUN WHERE GJBPRUN_JOB = :rptname AND GJBPRUN_ONE_UP_NO = TO_NUMBER(:rpt_one_up_no); POSTORA; if (NO_ROWS_FOUND) { *valid_ind = '\0'; return FALSE; } return TRUE; } /* **************************************************************** */ /* Check for valid campus code */ static int validate_camp(void) { EXEC SQL SELECT 'Y' INTO :valid_ind:Ind_01 FROM STVCAMP WHERE STVCAMP_CODE = :camp_code; POSTORA; if (NO_ROWS_FOUND) { *valid_ind = '\0'; return FALSE; } return TRUE; } /* **************************************************************** */ /* Check for valid level code */ static int validate_levl(void) { EXEC SQL SELECT 'Y' INTO :valid_ind:Ind_01 FROM STVLEVL WHERE STVLEVL_CODE = :levl_code; POSTORA; if (NO_ROWS_FOUND) { *valid_ind = '\0'; return FALSE; } return TRUE; } /* **************************************************************** */ /* Check for valid term code */ static int validate_term(void) { EXEC SQL SELECT 'Y' INTO :valid_ind:Ind_01 FROM STVTERM WHERE STVTERM_CODE = :term; POSTORA; if (NO_ROWS_FOUND) { *valid_ind = '\0'; return FALSE; } return TRUE; } /*TMCI18N BEGIN GLOBAL STRING INITIALIZATION*/ #ifndef ORA_PROC void tmInitGlobS_sfrtmst(void){ TMCHARPTR_GLOB_INIT(default_ext); #ifdef _DEBUG puts("*** Initialisation tmInitGlobS_sfrtmst OK ***\n"); #endif } #endif /* not defined ORA_PROC*/ /*TMCI18N END GLOBAL STRING INITIALIZATION*/