Hello All,
Could any one with .ec or .c experience help me what the following codes mean ?
I need to understand why my i4gl programs are crushing>
#include <sqlfm.h>
_FORM *_FMi_userable;
_EFwindow *_Wwin_userable;
#include <decimal.h>
#include <locator.h>
#include <datetime.h>
#include <stdio.h>
#include <stdlib.h>
#include <fglrep.h>
#define I4GL_SQLCA /* I4GLC1 */
$extern struct
{
int4 sqlcode;
char sqlerrm[72];
char sqlerrp[8];
int4 sqlerrd[6];
char sqlawarn[8];
} sqlca;
$extern int4 status;
extern mint ibm_efm_statusCode;
extern mint ibm_lib4gl_expressionCode;
extern int2 ibm_lib4gl_anyError;
$extern int4 int_flag;
$extern int4 quit_flag;
static char fgl_modname[] = "/srs-prps/ppsys/phaseI/src/CeaseUser.4gl";
$extern char g_runyear[5];
$extern short g_runmonth;
$extern char g_runind[2];
$extern short g_payrollmonth;
$extern short payrollmonth;
$extern char g_yearmonth[7];
$extern date g_paydate;
$extern short g_taxmonth;
$extern short g_run_number;
$extern decimal(20,2) g_taxcredit;
$extern decimal(20,2) g_taxcredit_tm;
$extern decimal(20,2) g_taxcredit_ytd;
$extern char g_prevtaxyear[5];
$extern char g_prevtaxyr_end[11];
$extern short g_staff_count;
$extern short g_negpay_count;
$extern datetime year to second g_lastlog_time;
$extern short g_neg_pays;
$extern decimal(25,2) g_payroll_cost;
$extern decimal(20,3) g_commission;
$extern char g_longrunmth[10];
$extern char g_shortrunmth[4];
$extern struct
{
short band;
decimal(20,2) width;
decimal(12,2) rate;
} ga_taxbands[4];
$extern char g_manno[7];
$extern decimal(20,2) g_min_levy_salary;
$extern decimal(20,2) g_max_levy;
$extern decimal(20,2) g_max_znpf;
$extern datetime year to second g_recent_log;
$extern int4 g_chequeno;
$extern short g_levymonth1;
$extern short g_levymonth2;
$extern char g_salarycode[4];
$extern char g_c2000bal[2];
$extern short getinput;
$extern char question[81];
$extern char answer[2];
$extern short invalidresponse;
$extern short stringsearch;
$extern short foundind;
$extern short w_matches;
$extern short w_valid;
$extern char partentry[81];
$extern char h1line[133];
$extern char h2line[133];
$extern char h3line[133];
$extern char h4line[133];
$extern char h5line[133];
$extern char h6line[133];
$extern char h7line[133];
$extern char selecttext[1201];
$extern char w_reportname[21];
$extern char printer[11];
$extern char cmdline[81];
$extern short copies;
$extern short getprinter;
$extern char esc[2];
enabledisableuser(fgl_pcnt)
int fgl_pcnt;
$char w_userid[16];
$char w_username[31];
$short w_valid;
$char w_endisable[2];
ibm_lib4gl_anyError = 0;
ibm_lib4gl_recordTssAndHwmState((char *)0);
ibm_lib4gl_recordDynArrStack();
if (fgl_pcnt != 0) ibm_lib4gl_fglFatalError(fgl_modname, 9, -1318);
{
ibm_efm_openWindow(&_Wwin_userable, (char*)0, 5, 2, 19, 77, 1, -1, -1, -1, -1, -1,0);
status = ibm_efm_statusCode;
if (status < 0)
{
ibm_lib4gl_fglFatalError(fgl_modname, 11, status);
}
}
/*
* $ open form i_userable from "/srs-prps/ppsys/phaseI/forms/i_userable";
*/
{
ibm_efm_openForm(&_FMi_userable, "/srs-prps/ppsys/phaseI/forms/i_userable");
}
status = ibm_efm_statusCode;
if (status < 0)
{
ibm_lib4gl_fglFatalError(fgl_modname, 12, status);
}
/*
* $ display form i_userable;
*/
{
ibm_efm_displayForm(_FMi_userable, (mlong)-1);
}
status = ibm_efm_statusCode;
if (status < 0)
{
ibm_lib4gl_fglFatalError(fgl_modname, 14, status);
}
/*
* $ input $w_userid , $w_endisable without defaults from userid , endisable;
*/
{
_EFICB _sqicb;
_EFFIELD _sqfldlst[3];
struct sqlvar_struct _sqobind[3];
_sqfldlst[0]._EFfldname = ".userid";
_sqfldlst[0]._EFfldsub = 0;
_sqfldlst[1]._EFfldname = ".endisable";
_sqfldlst[1]._EFfldsub = 0;
byfill(&_sqfldlst[2], sizeof(_EFFIELD), 0);
byfill(&_sqobind[0], sizeof(struct sqlvar_struct), 0);
_sqobind[0].sqltype = 100;
_sqobind[0].sqllen = sizeof(w_userid);
byfill(&_sqobind[1], sizeof(struct sqlvar_struct), 0);
_sqobind[1].sqltype = 100;
_sqobind[1].sqllen = sizeof(w_endisable);
byfill(&_sqobind[2], sizeof(struct sqlvar_struct), 0);
_sqobind[0].sqldata =(w_userid);
_sqobind[1].sqldata =(w_endisable);
byfill(&_sqicb, sizeof(_EFICB), 0);
_sqicb._EFflags = ICB_INIT;
_sqicb._EFaction = 0;
_sqicb._EFoattr = -1;
_sqicb._EFiattr = -1;
_sqicb._EFextattr = 0;
_sqicb._EFbatab = NULL;
_sqicb._EFmaxcount = 0;
for (;;)
{
switch (_sqicb._EFaction)
{
case -2: /* error */
if (1) goto _ef1exit;
default:
/*
* $ after field userid;
*/
break;
case 1:
ibm_lib4gl_anyError = 0;
ibm_lib4gl_pushQuotedStr(w_userid,15);
ibm_lib4gl_pushQuotedStr( " " , 1);
ibm_lib4gl_doOperNotEqualto();
{
/*
* $ close form i_userable;
*/
{
ibm_efm_closeForm(&_FMi_userable);
}
status = ibm_efm_statusCode;
if (status < 0)
{
ibm_lib4gl_fglFatalError(fgl_modname, 83, status);
}
ibm_efm_closeWindow(&_Wwin_userable);
status = ibm_efm_statusCode;
if (status < 0)
{
ibm_lib4gl_fglFatalError(fgl_modname, 84, status);
}
ibm_lib4gl_pushInt2(w_valid);
CeaseUser.c
#define SQLCA_INCL /* I4GLC4 */
#include <sqlhdr.h>
#include <sqliapi.h>
#line 1 "CeaseUser.ec"
#include <sqlfm.h>
_FORM *_FMi_userable;
_EFwindow *_Wwin_userable;
#include <decimal.h>
#include <locator.h>
#include <datetime.h>
#include <stdio.h>
#include <stdlib.h>
#include <fglrep.h>
#define I4GL_SQLCA /* I4GLC1 */
/*
* $extern struct
* {
* int4 sqlcode;
* char sqlerrm[72];
* char sqlerrp[8];
* int4 sqlerrd[6];
* char sqlawarn[8];
* } sqlca;
*/
#line 12 "CeaseUser.ec"
#line 12 "CeaseUser.ec"
extern struct
{
int4 sqlcode;
char sqlerrm[72];
char sqlerrp[8];
int4 sqlerrd[6];
char sqlawarn[8];
} sqlca;
/*
* $extern int4 status;
*/
#line 20 "CeaseUser.ec"
#line 20 "CeaseUser.ec"
extern int4 status;
extern mint ibm_efm_statusCode;
extern mint ibm_lib4gl_expressionCode;
extern int2 ibm_lib4gl_anyError;
/*
* $extern int4 int_flag;
*/
{
ibm_efm_openWindow(&_Wwin_userable, (char*)0, 5, 2, 19, 77, 1, -1, -1, -1, -1, -1,0);
status = ibm_efm_statusCode;
if (status < 0)
{
ibm_lib4gl_fglFatalError(fgl_modname, 11, status);
}
}
/*
* $ open form i_userable from "/srs-prps/ppsys/phaseI/forms/i_userable";
*/
{
ibm_efm_openForm(&_FMi_userable, "/srs-prps/ppsys/phaseI/forms/i_userable");
}
status = ibm_efm_statusCode;
if (status < 0)
{
ibm_lib4gl_fglFatalError(fgl_modname, 12, status);
}
/*
* $ display form i_userable;
*/
{
ibm_efm_displayForm(_FMi_userable, (mlong)-1);
}
status = ibm_efm_statusCode;
if (status < 0)
{
ibm_lib4gl_fglFatalError(fgl_modname, 14, status);
}
/*
* $ input $w_userid , $w_endisable without defaults from userid , endisable;
*/
{
_EFICB _sqicb;
_EFFIELD _sqfldlst[3];
struct sqlvar_struct _sqobind[3];
_sqfldlst[0]._EFfldname = ".userid";
_sqfldlst[0]._EFfldsub = 0;
_sqfldlst[1]._EFfldname = ".endisable";
_sqfldlst[1]._EFfldsub = 0;
byfill(&_sqfldlst[2], sizeof(_EFFIELD), 0);
byfill(&_sqobind[0], sizeof(struct sqlvar_struct), 0);
_sqobind[0].sqltype = 100;
_sqobind[0].sqllen = sizeof(w_userid);
byfill(&_sqobind[1], sizeof(struct sqlvar_struct), 0);
_sqobind[1].sqltype = 100;
_sqobind[1].sqllen = sizeof(w_endisable);
byfill(&_sqobind[2], sizeof(struct sqlvar_struct), 0);
_sqobind[0].sqldata =(w_userid);
_sqobind[1].sqldata =(w_endisable);
byfill(&_sqicb, sizeof(_EFICB), 0);
_sqicb._EFflags = ICB_INIT;
_sqicb._EFaction = 0;
_sqicb._EFoattr = -1;
_sqicb._EFiattr = -1;
_sqicb._EFextattr = 0;
_sqicb._EFbatab = NULL;
_sqicb._EFmaxcount = 0;
for (;;)
{
switch (_sqicb._EFaction)
{
case -2: /* error */
if (1) goto _ef1exit;
default:
/*
* $ after field userid;
*/
break;
case 1:
ibm_lib4gl_anyError = 0;
ibm_lib4gl_pushQuotedStr(w_userid,15);
ibm_lib4gl_pushQuotedStr( " " , 1);
ibm_lib4gl_doOperNotEqualto();
{
int fgl_if1;
ibm_lib4gl_popBoolean(&fgl_if1);
ibm_lib4gl_relUnwantedTssEntries();
if (fgl_if1)
{
{
;
{
int fgl_if1;
ibm_lib4gl_popBoolean(&fgl_if1);
ibm_lib4gl_relUnwantedTssEntries();
if (fgl_if1)
{
/*
* $ prompt $w_userid , "Does not access the PPS System - Press Return "
*/
{
_EFICB _sqicb;
struct sqlvar_struct _sqobind[2];
struct sqlvar_struct _sqibind[3];
byfill(&_sqobind[0], sizeof(struct sqlvar_struct), 0);
_sqobind[0].sqltype = 100;
_sqobind[0].sqllen = sizeof(answer);
byfill(&_sqobind[1], sizeof(struct sqlvar_struct), 0);
byfill(&_sqibind[0], sizeof(struct sqlvar_struct), 0);
_sqibind[0].sqltype = 100;
_sqibind[0].sqllen = sizeof(w_userid);
byfill(&_sqibind[1], sizeof(struct sqlvar_struct), 0);
_sqibind[1].sqltype = 109;
_sqibind[1].sqllen = 0;
byfill(&_sqibind[2], sizeof(struct sqlvar_struct), 0);
_sqobind[0].sqldata =(answer);
_sqibind[0].sqldata =(w_userid);
_sqibind[1].sqldata =("Does not access the PPS System - Press Return ");
byfill(&_sqicb, sizeof(_EFICB), 0);
_sqicb._EFflags |= ICB_FORCHAR;
_sqicb._EFaction = 0;
_sqicb._EFoattr = 196608;
_sqicb._EFiattr = -1;
_sqicb._EFextattr = 0;
_sqicb._EFbatab = NULL;
_sqicb._EFmaxcount = 0;
for (;;)
{
switch (_sqicb._EFaction)
{
case -2: /* error */
if (1) goto _ef2exit;
default:
/*
* $ end prompt;
*/
break;
case -1:
if (1) goto _ef2exit;
}
{
ibm_efm_promptC(2, _sqibind, 1, _sqobind, &_sqicb);
}}}
_ef2exit:;
;
/*
* $ next field endisable;
*/
{
_sqicb._EFnext = ".endisable";
if (1) goto _ef1continue;
}
}
}
ibm_lib4gl_anyError = 0;
}
else
{
ibm_lib4gl_anyError = 0;
/*
* $ prompt "Please Enter Userid - Press Return" attribute ( bold ) for
*/
{
_EFICB _sqicb;
struct sqlvar_struct _sqobind[2];
struct sqlvar_struct _sqibind[2];
byfill(&_sqobind[0], sizeof(struct sqlvar_struct), 0);
_sqobind[0].sqltype = 100;
_sqobind[0].sqllen = sizeof(answer);
byfill(&_sqobind[1], sizeof(struct sqlvar_struct), 0);
byfill(&_sqibind[0], sizeof(struct sqlvar_struct), 0);
_sqibind[0].sqltype = 109;
_sqibind[0].sqllen = 0;
byfill(&_sqibind[1], sizeof(struct sqlvar_struct), 0);
_sqobind[0].sqldata =(answer);
_sqibind[0].sqldata =("Please Enter Userid - Press Return");
byfill(&_sqicb, sizeof(_EFICB), 0);
_sqicb._EFaction = 0;
_sqicb._EFoattr = 196608;
_sqicb._EFiattr = -1;
_sqicb._EFextattr = 0;
_sqicb._EFbatab = NULL;
_sqicb._EFmaxcount = 0;
for (;;)
{
ibm_lib4gl_anyError = 0;
/*
* $ close form i_userable;
*/
{
ibm_efm_closeForm(&_FMi_userable);
}
status = ibm_efm_statusCode;
if (status < 0)
{
ibm_lib4gl_fglFatalError(fgl_modname, 83, status);
}
ibm_efm_closeWindow(&_Wwin_userable);
status = ibm_efm_statusCode;
if (status < 0)
{
ibm_lib4gl_fglFatalError(fgl_modname, 84, status);
}
ibm_lib4gl_pushInt2(w_valid);
{
int fgl_if1;
ibm_lib4gl_popBoolean(&fgl_if1);
ibm_lib4gl_relUnwantedTssEntries();
if (fgl_if1)
{
ibm_lib4gl_pushQuotedStr(w_endisable,1);
ibm_lib4gl_pushQuotedStr( "E" , 1);
ibm_lib4gl_doOperEqualto();
{
int fgl_if1;
ibm_lib4gl_popBoolean(&fgl_if1);
ibm_lib4gl_relUnwantedTssEntries();
if (fgl_if1)
{
/*
* $ update userrec set accountstate = "Y" where userid = $w_userid;
*/
#line 906 "CeaseUser.ec"
{
#line 906 "CeaseUser.ec"
static const char *sqlcmdtxt[] =
#line 906 "CeaseUser.ec"
{
#line 906 "CeaseUser.ec"
" update userrec set accountstate = \"Y\" where userid = ?",
0
};
#line 906 "CeaseUser.ec"
static ifx_statement_t _SQ0 = {0};
static ifx_sqlvar_t _sqibind[] =
{
{ 100, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
#
I would quite grateful if some one can interpret it for me.
Thanking you in advance
Bye
Felix Mwango Mutale
University of Zambia