8 static const char *
_Cn1 =
"stncursor";
16 #line 1 "/opt/informix/incl/esql/sqlca.h"
102 extern long * ifx_sqlcode();
103 extern struct sqlca_s * ifx_sqlca();
106 #define SQLCODE (*(ifx_sqlcode()))
107 #define SQLSTATE ((char *)(ifx_sqlstate()))
108 #define sqlca (*(ifx_sqlca()))
111 #define SQLNOTFOUND 100
114 #line 97 "/opt/informix/incl/esql/sqlca.h"
353 int mday[]={31,28,31,30,31,30,31,31,30,31,30,31} ;
354 void main(
int argc,
char **argv)
375 char dbuf[80],ts1[80];
377 char zbuf[1000],abuf[100];
379 int zdate[10],ztime[10];
381 char *add,file[50],*key;
385 extern int optind,opterr,optopt;
390 char *directory,fname[50];
396 int itemp,itemp1,itemp2,ival,len;
401 fp=fopen(
"junkfile",
"w");
409 while((c=getopt(argc,argv,
"d:h:n:f:q:v"))!=-1){
415 strcpy(fname,optarg);
430 dtn_values=calloc(1000,
sizeof(
struct stn_values));
431 qtn_values=calloc(1000,
sizeof(
struct stn_values));
436 btim.year=gmtim->tm_year+1900;
437 btim.month=gmtim->tm_mon+1;
438 btim.day=gmtim->tm_mday;
439 btim.hour=gmtim->tm_hour;
454 etim2.
year=gmtim->tm_year+1900;
455 etim2.
month=gmtim->tm_mon+1;
456 etim2.
day=gmtim->tm_mday;
467 _iqdcopen(_iqlocate_cursor((
char *)
_Cn1, 100), (
struct sqlda *) 0, (
char *) 0, (
struct value *) 0, 0, 0);
478 for(i=0;i<5000;i++) {
489 static struct sqlvar_struct _sqobind[] =
491 { 100, 6, 0, 0, 0, 0, 0, 0, 0 },
492 { 100, 9, 0, 0, 0, 0, 0, 0, 0 },
493 { 100, 51, 0, 0, 0, 0, 0, 0, 0 },
494 { 100, 41, 0, 0, 0, 0, 0, 0, 0 },
495 { 100, 9, 0, 0, 0, 0, 0, 0, 0 },
496 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
497 { 100, 8, 0, 0, 0, 0, 0, 0, 0 },
498 { 102,
sizeof((
btn_rec).elev), 0, 0, 0, 0, 0, 0, 0 },
499 { 100, 3, 0, 0, 0, 0, 0, 0, 0 },
500 { 100, 9, 0, 0, 0, 0, 0, 0, 0 },
501 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
502 { 100, 5, 0, 0, 0, 0, 0, 0, 0 },
503 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
504 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
505 { 102,
sizeof((
btn_rec).post), 0, 0, 0, 0, 0, 0, 0 },
506 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
509 static struct sqlda _SD0 = { 16, _sqobind, {0}, 16, 0 };
510 static _FetchSpec _FS1 = { 0, 1, 0 };
512 _sqobind[0].sqldata = (
btn_rec).
id;
514 _sqobind[1].sqldata = (
btn_rec).plat;
516 _sqobind[2].sqldata = (
btn_rec).des;
518 _sqobind[3].sqldata = (
btn_rec).det;
520 _sqobind[4].sqldata = (
btn_rec).init;
522 _sqobind[5].sqldata = (
btn_rec).lat;
524 _sqobind[6].sqldata = (
btn_rec).lng;
526 _sqobind[7].sqldata = (
char *) &(
btn_rec).elev;
528 _sqobind[8].sqldata = (
btn_rec).stat;
530 _sqobind[9].sqldata = (
btn_rec).huc;
532 _sqobind[10].sqldata = (
btn_rec).cou;
534 _sqobind[11].sqldata = (
btn_rec).zon;
536 _sqobind[12].sqldata = (
btn_rec).hsa;
538 _sqobind[13].sqldata = (
btn_rec).cwa;
540 _sqobind[14].sqldata = (
char *) &(
btn_rec).post;
542 _sqobind[15].sqldata = (
btn_rec).dbsource;
544 _iqcftch(_iqlocate_cursor((
char *)
_Cn1, 100), (
struct sqlda *) 0, &_SD0, (
char *) 0, &_FS1);
659 static const char *sqlcmdtxt[] =
663 " select * from sens where id = ? and pe1 = 'P' and pe2 = 'P' and dur = 'D' and t = ? and s = 'R' and e = 'Z' and p = 'Z'",
667 static _SQCURSOR _SQ0 = {0};
668 static struct sqlvar_struct _sqibind[] =
670 { 100, 6, 0, 0, 0, 0, 0, 0, 0 },
671 { 108, 1, 0, 0, 0, 0, 0, 0, 0 },
674 static struct sqlvar_struct _sqobind[] =
676 { 100, 6, 0, 0, 0, 0, 0, 0, 0 },
677 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
678 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
679 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
680 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
681 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
682 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
683 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
684 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
685 { 100, 51, 0, 0, 0, 0, 0, 0, 0 },
686 { 100, 41, 0, 0, 0, 0, 0, 0, 0 },
687 { 102,
sizeof((
bens_rec).post), 0, 0, 0, 0, 0, 0, 0 },
688 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
689 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
690 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
691 { 102,
sizeof((
bens_rec).obstime), 0, 0, 0, 0, 0, 0, 0 },
692 { 100, 10, 0, 0, 0, 0, 0, 0, 0 },
693 { 100, 10, 0, 0, 0, 0, 0, 0, 0 },
694 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
695 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
696 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
697 { 100, 8, 0, 0, 0, 0, 0, 0, 0 },
698 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
699 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
700 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
701 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
702 { 100, 9, 0, 0, 0, 0, 0, 0, 0 },
703 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
709 _sqibind[1].sqldata = &
t;
711 _sqobind[0].sqldata = (
bens_rec).
id;
729 _sqobind[9].sqldata = (
bens_rec).des;
731 _sqobind[10].sqldata = (
bens_rec).det;
733 _sqobind[11].sqldata = (
char *) &(
bens_rec).post;
735 _sqobind[12].sqldata = (
bens_rec).new_report;
737 _sqobind[13].sqldata = (
bens_rec).active;
741 _sqobind[15].sqldata = (
char *) &(
bens_rec).obstime;
743 _sqobind[16].sqldata = (
bens_rec).prod;
745 _sqobind[17].sqldata = (
bens_rec).prod2ary;
747 _sqobind[18].sqldata = (
bens_rec).obsag;
749 _sqobind[19].sqldata = (
bens_rec).obsloc;
751 _sqobind[20].sqldata = (
bens_rec).prov_avail;
753 _sqobind[21].sqldata = (
bens_rec).final_avail;
755 _sqobind[22].sqldata = (
bens_rec).ownag;
757 _sqobind[23].sqldata = (
bens_rec).ownloc;
759 _sqobind[24].sqldata = (
bens_rec).maintag;
761 _sqobind[25].sqldata = (
bens_rec).maintloc;
763 _sqobind[26].sqldata = (
bens_rec).init;
765 _sqobind[27].sqldata = (
bens_rec).dbsource;
767 _iqslct(&_SQ0, (
char **) sqlcmdtxt, 2, _sqibind, 28, _sqobind, 0);
805 itemp1=ival-itemp*100;
807 flat=(float)itemp+(
float)itemp1/60;
812 else if(ival > 10000) {
816 itemp1=(ival-itemp*10000)/100;
818 itemp2=ival-itemp*10000-itemp1*100;
820 flat=(float)itemp+(
float)itemp1/60 + (float)itemp2/3600;
842 itemp1=ival-itemp*100;
844 flng=(float)itemp+(
float)itemp1/60;
849 else if(ival >=100000) {
853 itemp1=(ival-itemp*10000)/100;
855 itemp2=ival-itemp*10000-itemp1*100;
857 flng=(float)itemp+(
float)itemp1/60 + (float)itemp2/3600;
874 printf(
"%s %s %f %f %d %d %s\n",
struct data_rec data_record
void main(int argc, char **argv)
struct pro_dly_rec dly_rec
struct pro_hrly_rec hrly_rec
printf("pcp %d\n", pcp_in_use[103])
struct sqlca_s::sqlcaw_s sqlwarn