3 static char *
_Cn1 =
"stncursor";
static _SQCURSOR *
_SQ1 = 0;
4 #line 1 "pcprpt_daily.ec"
9 #line 2 "pcprpt_daily.ec"
10 #line 1 "/usr/informix/incl/esql/sqlca.h"
84 #define SQLNOTFOUND 100
87 #line 3 "pcprpt_daily.ec"
92 #line 4 "pcprpt_daily.ec"
308 #line 227 "pcprpt_daily.ec"
336 void main(
int argc,
char **argv)
356 char dbuf[80],ts1[80];
358 char zbuf[1000],abuf[100];
360 int zdate[10],ztime[10];
366 extern int optind,opterr,optopt;
371 char *directory,fname[50];
377 char daybuf[10],daybuf1[10];
384 strcpy(fname,
"slcrr1slr");
385 directory=
"/usr/db/raw/pcprpt/data/";
389 if(gmtim->tm_hour >=18)
397 while((c=getopt(argc,argv,
"t:d:h:n:f:v:q"))!=-1){
412 printf(
"illegal type - must be 1 or 2\n");
426 strcpy(fname,optarg);
434 if(maxdays <= 0 || maxdays > 30) {
436 printf(
"illegal value - maxdays must be > 0 and < 30\n");
447 if(hour < 0 || hour > 23) {
448 printf(
"illegal value - hour must be > 0 and < 24\n");
463 printf(
"date not specified correctly\n");
472 if(month < 1 || month > 12) {
473 printf(
"illegal value - month must be > 0 and < 13\n");
484 printf(
"date not specified correctly\n");
494 if(day < 1 || day > 31) {
496 printf(
"illegal value - day must be > 0 and < 32\n");
505 if(year < 1994 || year > 2005) {
507 printf(
"illegal value - year must be > 1994 and < 2005\n");
533 dtn_values=calloc(1000,
sizeof(
struct stn_values));
534 qtn_values=calloc(1000,
sizeof(
struct stn_values));
542 sprintf(file,
"%s%s.%02d%02d%02d",directory,fname,gmtim->tm_mon+1,
543 gmtim->tm_mday,gmtim->tm_year);
546 sprintf(file,
"%s%s",directory,fname);
548 fp[i]=fopen(file,
"w");
552 printf(
"could not open %s\n",file);
561 btim.year=gmtim->tm_year+1900;
562 btim.month=gmtim->tm_mon+1;
563 btim.day=gmtim->tm_mday;
564 btim.hour=gmtim->tm_hour;
579 etim2.
year=gmtim->tm_year+1900;
580 etim2.
month=gmtim->tm_mon+1;
581 etim2.
day=gmtim->tm_mday;
586 itime[i]=
tim-i*86400;
596 #line 511 "pcprpt_daily.ec"
598 #line 511 "pcprpt_daily.ec"
599 #line 511 "pcprpt_daily.ec"
601 #line 511 "pcprpt_daily.ec"
602 _iqdcopen(
_SQ1, (
struct sqlda *)0, (
char *)0, (
char *)0, 0);
603 #line 511 "pcprpt_daily.ec"
620 for(i=0;i<5000;i++) {
628 #line 532 "pcprpt_daily.ec"
630 #line 532 "pcprpt_daily.ec"
631 static struct sqlvar_struct _sqobind[] =
633 { 100, 6, 0, 0, 0, 0, 0, 0, 0 },
634 { 100, 9, 0, 0, 0, 0, 0, 0, 0 },
635 { 100, 9, 0, 0, 0, 0, 0, 0, 0 },
636 { 100, 9, 0, 0, 0, 0, 0, 0, 0 },
637 { 100, 51, 0, 0, 0, 0, 0, 0, 0 },
638 { 100, 41, 0, 0, 0, 0, 0, 0, 0 },
639 { 100, 9, 0, 0, 0, 0, 0, 0, 0 },
640 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
641 { 100, 8, 0, 0, 0, 0, 0, 0, 0 },
642 { 102,
sizeof((
btn_rec).elev), 0, 0, 0, 0, 0, 0, 0 },
643 { 100, 3, 0, 0, 0, 0, 0, 0, 0 },
644 { 100, 9, 0, 0, 0, 0, 0, 0, 0 },
645 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
646 { 100, 5, 0, 0, 0, 0, 0, 0, 0 },
647 { 102,
sizeof((
btn_rec).post), 0, 0, 0, 0, 0, 0, 0 },
648 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
649 #line 532 "pcprpt_daily.ec"
651 static struct sqlda _SD0 = { 16, _sqobind, 0, 16, 0 };
652 static _FetchSpec _FS1 = { 0, 1, 0 };
653 #line 532 "pcprpt_daily.ec"
654 _sqobind[0].sqldata = (
btn_rec).
id;
655 #line 532 "pcprpt_daily.ec"
656 _sqobind[1].sqldata = (
btn_rec).plat;
657 #line 532 "pcprpt_daily.ec"
658 _sqobind[2].sqldata = (
btn_rec).aid;
659 #line 532 "pcprpt_daily.ec"
660 _sqobind[3].sqldata = (
btn_rec).aid2;
661 #line 532 "pcprpt_daily.ec"
662 _sqobind[4].sqldata = (
btn_rec).des;
663 #line 532 "pcprpt_daily.ec"
664 _sqobind[5].sqldata = (
btn_rec).det;
665 #line 532 "pcprpt_daily.ec"
666 _sqobind[6].sqldata = (
btn_rec).init;
667 #line 532 "pcprpt_daily.ec"
668 _sqobind[7].sqldata = (
btn_rec).lat;
669 #line 532 "pcprpt_daily.ec"
670 _sqobind[8].sqldata = (
btn_rec).lng;
671 #line 532 "pcprpt_daily.ec"
672 _sqobind[9].sqldata = (
char *) &(
btn_rec).elev;
673 #line 532 "pcprpt_daily.ec"
674 _sqobind[10].sqldata = (
btn_rec).stat;
675 #line 532 "pcprpt_daily.ec"
676 _sqobind[11].sqldata = (
btn_rec).huc;
677 #line 532 "pcprpt_daily.ec"
678 _sqobind[12].sqldata = (
btn_rec).cou;
679 #line 532 "pcprpt_daily.ec"
680 _sqobind[13].sqldata = (
btn_rec).zon;
681 #line 532 "pcprpt_daily.ec"
682 _sqobind[14].sqldata = (
char *) &(
btn_rec).post;
683 #line 532 "pcprpt_daily.ec"
684 _sqobind[15].sqldata = (
btn_rec).dbsource;
685 #line 532 "pcprpt_daily.ec"
687 #line 532 "pcprpt_daily.ec"
688 _iqcftch(
_SQ1, (
struct sqlda *)0, &_SD0, (
char *)0, &_FS1);
689 #line 532 "pcprpt_daily.ec"
719 #line 548 "pcprpt_daily.ec"
721 #line 548 "pcprpt_daily.ec"
722 static char *sqlcmdtxt[] =
723 #line 548 "pcprpt_daily.ec"
725 #line 548 "pcprpt_daily.ec"
726 " select * from sens where id = ? and pe1 = 'P' and pe2 = 'P' and dur = 'D' and t = ? and s = 'P' and e = 'Z' and p = 'Z'",
729 #line 558 "pcprpt_daily.ec"
730 static _SQCURSOR _SQ0 = {0};
731 static struct sqlvar_struct _sqibind[] =
733 { 100, 6, 0, 0, 0, 0, 0, 0, 0 },
734 { 108, 1, 0, 0, 0, 0, 0, 0, 0 },
735 #line 558 "pcprpt_daily.ec"
737 static struct sqlvar_struct _sqobind[] =
739 { 100, 6, 0, 0, 0, 0, 0, 0, 0 },
740 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
741 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
742 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
743 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
744 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
745 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
746 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
747 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
748 { 100, 51, 0, 0, 0, 0, 0, 0, 0 },
749 { 100, 41, 0, 0, 0, 0, 0, 0, 0 },
750 { 102,
sizeof((
bens_rec).post), 0, 0, 0, 0, 0, 0, 0 },
751 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
752 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
753 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
754 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
755 { 102,
sizeof((
bens_rec).obstime), 0, 0, 0, 0, 0, 0, 0 },
756 { 100, 10, 0, 0, 0, 0, 0, 0, 0 },
757 { 100, 10, 0, 0, 0, 0, 0, 0, 0 },
758 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
759 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
760 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
761 { 100, 8, 0, 0, 0, 0, 0, 0, 0 },
762 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
763 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
764 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
765 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
766 { 100, 9, 0, 0, 0, 0, 0, 0, 0 },
767 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
768 #line 558 "pcprpt_daily.ec"
770 #line 558 "pcprpt_daily.ec"
772 #line 558 "pcprpt_daily.ec"
773 _sqibind[1].sqldata = &
ty;
774 #line 558 "pcprpt_daily.ec"
775 _sqobind[0].sqldata = (
bens_rec).
id;
776 #line 558 "pcprpt_daily.ec"
778 #line 558 "pcprpt_daily.ec"
780 #line 558 "pcprpt_daily.ec"
782 #line 558 "pcprpt_daily.ec"
784 #line 558 "pcprpt_daily.ec"
786 #line 558 "pcprpt_daily.ec"
788 #line 558 "pcprpt_daily.ec"
790 #line 558 "pcprpt_daily.ec"
792 #line 558 "pcprpt_daily.ec"
793 _sqobind[9].sqldata = (
bens_rec).des;
794 #line 558 "pcprpt_daily.ec"
795 _sqobind[10].sqldata = (
bens_rec).det;
796 #line 558 "pcprpt_daily.ec"
797 _sqobind[11].sqldata = (
char *) &(
bens_rec).post;
798 #line 558 "pcprpt_daily.ec"
799 _sqobind[12].sqldata = (
bens_rec).new_report;
800 #line 558 "pcprpt_daily.ec"
801 _sqobind[13].sqldata = (
bens_rec).active;
802 #line 558 "pcprpt_daily.ec"
803 _sqobind[14].sqldata = (
bens_rec).ok;
804 #line 558 "pcprpt_daily.ec"
806 #line 558 "pcprpt_daily.ec"
807 _sqobind[16].sqldata = (
char *) &(
bens_rec).obstime;
808 #line 558 "pcprpt_daily.ec"
809 _sqobind[17].sqldata = (
bens_rec).prod;
810 #line 558 "pcprpt_daily.ec"
811 _sqobind[18].sqldata = (
bens_rec).prod2ary;
812 #line 558 "pcprpt_daily.ec"
813 _sqobind[19].sqldata = (
bens_rec).obsag;
814 #line 558 "pcprpt_daily.ec"
815 _sqobind[20].sqldata = (
bens_rec).obsloc;
816 #line 558 "pcprpt_daily.ec"
817 _sqobind[21].sqldata = (
bens_rec).prov_avail;
818 #line 558 "pcprpt_daily.ec"
819 _sqobind[22].sqldata = (
bens_rec).final_avail;
820 #line 558 "pcprpt_daily.ec"
821 _sqobind[23].sqldata = (
bens_rec).ownag;
822 #line 558 "pcprpt_daily.ec"
823 _sqobind[24].sqldata = (
bens_rec).ownloc;
824 #line 558 "pcprpt_daily.ec"
825 _sqobind[25].sqldata = (
bens_rec).maintag;
826 #line 558 "pcprpt_daily.ec"
827 _sqobind[26].sqldata = (
bens_rec).maintloc;
828 #line 558 "pcprpt_daily.ec"
829 _sqobind[27].sqldata = (
bens_rec).init;
830 #line 558 "pcprpt_daily.ec"
831 _sqobind[28].sqldata = (
bens_rec).dbsource;
832 #line 558 "pcprpt_daily.ec"
833 _iqslct(&_SQ0, sqlcmdtxt, 2, _sqibind, 29, _sqobind, 0);
834 #line 558 "pcprpt_daily.ec"
855 #line 565 "pcprpt_daily.ec"
857 #line 565 "pcprpt_daily.ec"
858 static char *sqlcmdtxt[] =
859 #line 565 "pcprpt_daily.ec"
861 #line 565 "pcprpt_daily.ec"
862 " select * from sens where id = ? and pe1 = 'P' and pe2 = 'P' and dur = 'D' and t = ? and s = 'G' and e = 'Z' and p = 'Z'",
865 #line 575 "pcprpt_daily.ec"
866 static _SQCURSOR _SQ0 = {0};
867 static struct sqlvar_struct _sqibind[] =
869 { 100, 6, 0, 0, 0, 0, 0, 0, 0 },
870 { 108, 1, 0, 0, 0, 0, 0, 0, 0 },
871 #line 575 "pcprpt_daily.ec"
873 static struct sqlvar_struct _sqobind[] =
875 { 100, 6, 0, 0, 0, 0, 0, 0, 0 },
876 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
877 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
878 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
879 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
880 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
881 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
882 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
883 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
884 { 100, 51, 0, 0, 0, 0, 0, 0, 0 },
885 { 100, 41, 0, 0, 0, 0, 0, 0, 0 },
886 { 102,
sizeof((
bens_rec).post), 0, 0, 0, 0, 0, 0, 0 },
887 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
888 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
889 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
890 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
891 { 102,
sizeof((
bens_rec).obstime), 0, 0, 0, 0, 0, 0, 0 },
892 { 100, 10, 0, 0, 0, 0, 0, 0, 0 },
893 { 100, 10, 0, 0, 0, 0, 0, 0, 0 },
894 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
895 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
896 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
897 { 100, 8, 0, 0, 0, 0, 0, 0, 0 },
898 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
899 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
900 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
901 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
902 { 100, 9, 0, 0, 0, 0, 0, 0, 0 },
903 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
904 #line 575 "pcprpt_daily.ec"
906 #line 575 "pcprpt_daily.ec"
908 #line 575 "pcprpt_daily.ec"
909 _sqibind[1].sqldata = &
ty;
910 #line 575 "pcprpt_daily.ec"
911 _sqobind[0].sqldata = (
bens_rec).
id;
912 #line 575 "pcprpt_daily.ec"
914 #line 575 "pcprpt_daily.ec"
916 #line 575 "pcprpt_daily.ec"
918 #line 575 "pcprpt_daily.ec"
920 #line 575 "pcprpt_daily.ec"
922 #line 575 "pcprpt_daily.ec"
924 #line 575 "pcprpt_daily.ec"
926 #line 575 "pcprpt_daily.ec"
928 #line 575 "pcprpt_daily.ec"
929 _sqobind[9].sqldata = (
bens_rec).des;
930 #line 575 "pcprpt_daily.ec"
931 _sqobind[10].sqldata = (
bens_rec).det;
932 #line 575 "pcprpt_daily.ec"
933 _sqobind[11].sqldata = (
char *) &(
bens_rec).post;
934 #line 575 "pcprpt_daily.ec"
935 _sqobind[12].sqldata = (
bens_rec).new_report;
936 #line 575 "pcprpt_daily.ec"
937 _sqobind[13].sqldata = (
bens_rec).active;
938 #line 575 "pcprpt_daily.ec"
939 _sqobind[14].sqldata = (
bens_rec).ok;
940 #line 575 "pcprpt_daily.ec"
942 #line 575 "pcprpt_daily.ec"
943 _sqobind[16].sqldata = (
char *) &(
bens_rec).obstime;
944 #line 575 "pcprpt_daily.ec"
945 _sqobind[17].sqldata = (
bens_rec).prod;
946 #line 575 "pcprpt_daily.ec"
947 _sqobind[18].sqldata = (
bens_rec).prod2ary;
948 #line 575 "pcprpt_daily.ec"
949 _sqobind[19].sqldata = (
bens_rec).obsag;
950 #line 575 "pcprpt_daily.ec"
951 _sqobind[20].sqldata = (
bens_rec).obsloc;
952 #line 575 "pcprpt_daily.ec"
953 _sqobind[21].sqldata = (
bens_rec).prov_avail;
954 #line 575 "pcprpt_daily.ec"
955 _sqobind[22].sqldata = (
bens_rec).final_avail;
956 #line 575 "pcprpt_daily.ec"
957 _sqobind[23].sqldata = (
bens_rec).ownag;
958 #line 575 "pcprpt_daily.ec"
959 _sqobind[24].sqldata = (
bens_rec).ownloc;
960 #line 575 "pcprpt_daily.ec"
961 _sqobind[25].sqldata = (
bens_rec).maintag;
962 #line 575 "pcprpt_daily.ec"
963 _sqobind[26].sqldata = (
bens_rec).maintloc;
964 #line 575 "pcprpt_daily.ec"
965 _sqobind[27].sqldata = (
bens_rec).init;
966 #line 575 "pcprpt_daily.ec"
967 _sqobind[28].sqldata = (
bens_rec).dbsource;
968 #line 575 "pcprpt_daily.ec"
969 _iqslct(&_SQ0, sqlcmdtxt, 2, _sqibind, 29, _sqobind, 0);
970 #line 575 "pcprpt_daily.ec"
991 #line 582 "pcprpt_daily.ec"
993 #line 582 "pcprpt_daily.ec"
994 static char *sqlcmdtxt[] =
995 #line 582 "pcprpt_daily.ec"
997 #line 582 "pcprpt_daily.ec"
998 " select * from sens where id = ? and pe1 = 'P' and pe2 = 'P' and dur = 'D' and t = ? and s = 'M' and e = 'Z' and p = 'Z'",
1001 #line 592 "pcprpt_daily.ec"
1002 static _SQCURSOR _SQ0 = {0};
1003 static struct sqlvar_struct _sqibind[] =
1005 { 100, 6, 0, 0, 0, 0, 0, 0, 0 },
1006 { 108, 1, 0, 0, 0, 0, 0, 0, 0 },
1007 #line 592 "pcprpt_daily.ec"
1009 static struct sqlvar_struct _sqobind[] =
1011 { 100, 6, 0, 0, 0, 0, 0, 0, 0 },
1012 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1013 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1014 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1015 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1016 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1017 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1018 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1019 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1020 { 100, 51, 0, 0, 0, 0, 0, 0, 0 },
1021 { 100, 41, 0, 0, 0, 0, 0, 0, 0 },
1022 { 102,
sizeof((
bens_rec).post), 0, 0, 0, 0, 0, 0, 0 },
1023 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1024 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1025 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1026 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1027 { 102,
sizeof((
bens_rec).obstime), 0, 0, 0, 0, 0, 0, 0 },
1028 { 100, 10, 0, 0, 0, 0, 0, 0, 0 },
1029 { 100, 10, 0, 0, 0, 0, 0, 0, 0 },
1030 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
1031 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
1032 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1033 { 100, 8, 0, 0, 0, 0, 0, 0, 0 },
1034 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
1035 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
1036 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
1037 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
1038 { 100, 9, 0, 0, 0, 0, 0, 0, 0 },
1039 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
1040 #line 592 "pcprpt_daily.ec"
1042 #line 592 "pcprpt_daily.ec"
1044 #line 592 "pcprpt_daily.ec"
1045 _sqibind[1].sqldata = &
ty;
1046 #line 592 "pcprpt_daily.ec"
1047 _sqobind[0].sqldata = (
bens_rec).
id;
1048 #line 592 "pcprpt_daily.ec"
1050 #line 592 "pcprpt_daily.ec"
1052 #line 592 "pcprpt_daily.ec"
1054 #line 592 "pcprpt_daily.ec"
1056 #line 592 "pcprpt_daily.ec"
1058 #line 592 "pcprpt_daily.ec"
1059 _sqobind[6].sqldata = (
bens_rec).e;
1060 #line 592 "pcprpt_daily.ec"
1061 _sqobind[7].sqldata = (
bens_rec).p;
1062 #line 592 "pcprpt_daily.ec"
1064 #line 592 "pcprpt_daily.ec"
1065 _sqobind[9].sqldata = (
bens_rec).des;
1066 #line 592 "pcprpt_daily.ec"
1067 _sqobind[10].sqldata = (
bens_rec).det;
1068 #line 592 "pcprpt_daily.ec"
1069 _sqobind[11].sqldata = (
char *) &(
bens_rec).post;
1070 #line 592 "pcprpt_daily.ec"
1071 _sqobind[12].sqldata = (
bens_rec).new_report;
1072 #line 592 "pcprpt_daily.ec"
1073 _sqobind[13].sqldata = (
bens_rec).active;
1074 #line 592 "pcprpt_daily.ec"
1075 _sqobind[14].sqldata = (
bens_rec).ok;
1076 #line 592 "pcprpt_daily.ec"
1078 #line 592 "pcprpt_daily.ec"
1079 _sqobind[16].sqldata = (
char *) &(
bens_rec).obstime;
1080 #line 592 "pcprpt_daily.ec"
1081 _sqobind[17].sqldata = (
bens_rec).prod;
1082 #line 592 "pcprpt_daily.ec"
1083 _sqobind[18].sqldata = (
bens_rec).prod2ary;
1084 #line 592 "pcprpt_daily.ec"
1085 _sqobind[19].sqldata = (
bens_rec).obsag;
1086 #line 592 "pcprpt_daily.ec"
1087 _sqobind[20].sqldata = (
bens_rec).obsloc;
1088 #line 592 "pcprpt_daily.ec"
1089 _sqobind[21].sqldata = (
bens_rec).prov_avail;
1090 #line 592 "pcprpt_daily.ec"
1091 _sqobind[22].sqldata = (
bens_rec).final_avail;
1092 #line 592 "pcprpt_daily.ec"
1093 _sqobind[23].sqldata = (
bens_rec).ownag;
1094 #line 592 "pcprpt_daily.ec"
1095 _sqobind[24].sqldata = (
bens_rec).ownloc;
1096 #line 592 "pcprpt_daily.ec"
1097 _sqobind[25].sqldata = (
bens_rec).maintag;
1098 #line 592 "pcprpt_daily.ec"
1099 _sqobind[26].sqldata = (
bens_rec).maintloc;
1100 #line 592 "pcprpt_daily.ec"
1101 _sqobind[27].sqldata = (
bens_rec).init;
1102 #line 592 "pcprpt_daily.ec"
1103 _sqobind[28].sqldata = (
bens_rec).dbsource;
1104 #line 592 "pcprpt_daily.ec"
1105 _iqslct(&_SQ0, sqlcmdtxt, 2, _sqibind, 29, _sqobind, 0);
1106 #line 592 "pcprpt_daily.ec"
1126 #line 598 "pcprpt_daily.ec"
1128 #line 598 "pcprpt_daily.ec"
1129 static char *sqlcmdtxt[] =
1130 #line 598 "pcprpt_daily.ec"
1132 #line 598 "pcprpt_daily.ec"
1133 " select * from sens where id = ? and pe1 = 'P' and pe2 = 'P' and dur = 'D' and t = ? and s = 'Z' and e = 'Z' and p = 'Z'",
1136 #line 608 "pcprpt_daily.ec"
1137 static _SQCURSOR _SQ0 = {0};
1138 static struct sqlvar_struct _sqibind[] =
1140 { 100, 6, 0, 0, 0, 0, 0, 0, 0 },
1141 { 108, 1, 0, 0, 0, 0, 0, 0, 0 },
1142 #line 608 "pcprpt_daily.ec"
1144 static struct sqlvar_struct _sqobind[] =
1146 { 100, 6, 0, 0, 0, 0, 0, 0, 0 },
1147 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1148 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1149 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1150 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1151 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1152 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1153 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1154 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1155 { 100, 51, 0, 0, 0, 0, 0, 0, 0 },
1156 { 100, 41, 0, 0, 0, 0, 0, 0, 0 },
1157 { 102,
sizeof((
bens_rec).post), 0, 0, 0, 0, 0, 0, 0 },
1158 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1159 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1160 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1161 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1162 { 102,
sizeof((
bens_rec).obstime), 0, 0, 0, 0, 0, 0, 0 },
1163 { 100, 10, 0, 0, 0, 0, 0, 0, 0 },
1164 { 100, 10, 0, 0, 0, 0, 0, 0, 0 },
1165 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
1166 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
1167 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1168 { 100, 8, 0, 0, 0, 0, 0, 0, 0 },
1169 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
1170 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
1171 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
1172 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
1173 { 100, 9, 0, 0, 0, 0, 0, 0, 0 },
1174 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
1175 #line 608 "pcprpt_daily.ec"
1177 #line 608 "pcprpt_daily.ec"
1179 #line 608 "pcprpt_daily.ec"
1180 _sqibind[1].sqldata = &
ty;
1181 #line 608 "pcprpt_daily.ec"
1182 _sqobind[0].sqldata = (
bens_rec).
id;
1183 #line 608 "pcprpt_daily.ec"
1185 #line 608 "pcprpt_daily.ec"
1187 #line 608 "pcprpt_daily.ec"
1189 #line 608 "pcprpt_daily.ec"
1191 #line 608 "pcprpt_daily.ec"
1193 #line 608 "pcprpt_daily.ec"
1194 _sqobind[6].sqldata = (
bens_rec).e;
1195 #line 608 "pcprpt_daily.ec"
1196 _sqobind[7].sqldata = (
bens_rec).p;
1197 #line 608 "pcprpt_daily.ec"
1199 #line 608 "pcprpt_daily.ec"
1200 _sqobind[9].sqldata = (
bens_rec).des;
1201 #line 608 "pcprpt_daily.ec"
1202 _sqobind[10].sqldata = (
bens_rec).det;
1203 #line 608 "pcprpt_daily.ec"
1204 _sqobind[11].sqldata = (
char *) &(
bens_rec).post;
1205 #line 608 "pcprpt_daily.ec"
1206 _sqobind[12].sqldata = (
bens_rec).new_report;
1207 #line 608 "pcprpt_daily.ec"
1208 _sqobind[13].sqldata = (
bens_rec).active;
1209 #line 608 "pcprpt_daily.ec"
1210 _sqobind[14].sqldata = (
bens_rec).ok;
1211 #line 608 "pcprpt_daily.ec"
1213 #line 608 "pcprpt_daily.ec"
1214 _sqobind[16].sqldata = (
char *) &(
bens_rec).obstime;
1215 #line 608 "pcprpt_daily.ec"
1216 _sqobind[17].sqldata = (
bens_rec).prod;
1217 #line 608 "pcprpt_daily.ec"
1218 _sqobind[18].sqldata = (
bens_rec).prod2ary;
1219 #line 608 "pcprpt_daily.ec"
1220 _sqobind[19].sqldata = (
bens_rec).obsag;
1221 #line 608 "pcprpt_daily.ec"
1222 _sqobind[20].sqldata = (
bens_rec).obsloc;
1223 #line 608 "pcprpt_daily.ec"
1224 _sqobind[21].sqldata = (
bens_rec).prov_avail;
1225 #line 608 "pcprpt_daily.ec"
1226 _sqobind[22].sqldata = (
bens_rec).final_avail;
1227 #line 608 "pcprpt_daily.ec"
1228 _sqobind[23].sqldata = (
bens_rec).ownag;
1229 #line 608 "pcprpt_daily.ec"
1230 _sqobind[24].sqldata = (
bens_rec).ownloc;
1231 #line 608 "pcprpt_daily.ec"
1232 _sqobind[25].sqldata = (
bens_rec).maintag;
1233 #line 608 "pcprpt_daily.ec"
1234 _sqobind[26].sqldata = (
bens_rec).maintloc;
1235 #line 608 "pcprpt_daily.ec"
1236 _sqobind[27].sqldata = (
bens_rec).init;
1237 #line 608 "pcprpt_daily.ec"
1238 _sqobind[28].sqldata = (
bens_rec).dbsource;
1239 #line 608 "pcprpt_daily.ec"
1240 _iqslct(&_SQ0, sqlcmdtxt, 2, _sqibind, 29, _sqobind, 0);
1241 #line 608 "pcprpt_daily.ec"
1291 #line 644 "pcprpt_daily.ec"
1293 #line 644 "pcprpt_daily.ec"
1294 static char *sqlcmdtxt[] =
1295 #line 644 "pcprpt_daily.ec"
1297 #line 644 "pcprpt_daily.ec"
1298 " select * from sens where id = ? and pe1 = 'P' and pe2 = 'P' and dur = 'Q' and t = ? and s = ? and e = ? and p = ?",
1301 #line 654 "pcprpt_daily.ec"
1302 static _SQCURSOR _SQ0 = {0};
1303 static struct sqlvar_struct _sqibind[] =
1305 { 100, 6, 0, 0, 0, 0, 0, 0, 0 },
1306 { 108, 1, 0, 0, 0, 0, 0, 0, 0 },
1307 { 108, 1, 0, 0, 0, 0, 0, 0, 0 },
1308 { 108, 1, 0, 0, 0, 0, 0, 0, 0 },
1309 { 108, 1, 0, 0, 0, 0, 0, 0, 0 },
1310 #line 654 "pcprpt_daily.ec"
1312 static struct sqlvar_struct _sqobind[] =
1314 { 100, 6, 0, 0, 0, 0, 0, 0, 0 },
1315 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1316 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1317 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1318 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1319 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1320 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1321 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1322 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1323 { 100, 51, 0, 0, 0, 0, 0, 0, 0 },
1324 { 100, 41, 0, 0, 0, 0, 0, 0, 0 },
1325 { 102,
sizeof((
bens_rec).post), 0, 0, 0, 0, 0, 0, 0 },
1326 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1327 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1328 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1329 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1330 { 102,
sizeof((
bens_rec).obstime), 0, 0, 0, 0, 0, 0, 0 },
1331 { 100, 10, 0, 0, 0, 0, 0, 0, 0 },
1332 { 100, 10, 0, 0, 0, 0, 0, 0, 0 },
1333 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
1334 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
1335 { 100, 2, 0, 0, 0, 0, 0, 0, 0 },
1336 { 100, 8, 0, 0, 0, 0, 0, 0, 0 },
1337 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
1338 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
1339 { 100, 7, 0, 0, 0, 0, 0, 0, 0 },
1340 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
1341 { 100, 9, 0, 0, 0, 0, 0, 0, 0 },
1342 { 100, 4, 0, 0, 0, 0, 0, 0, 0 },
1343 #line 654 "pcprpt_daily.ec"
1345 #line 654 "pcprpt_daily.ec"
1347 #line 654 "pcprpt_daily.ec"
1348 _sqibind[1].sqldata = &
ty;
1349 #line 654 "pcprpt_daily.ec"
1350 _sqibind[2].sqldata = &
cs;
1351 #line 654 "pcprpt_daily.ec"
1352 _sqibind[3].sqldata = &
ce;
1353 #line 654 "pcprpt_daily.ec"
1354 _sqibind[4].sqldata = &
cp;
1355 #line 654 "pcprpt_daily.ec"
1356 _sqobind[0].sqldata = (
bens_rec).
id;
1357 #line 654 "pcprpt_daily.ec"
1359 #line 654 "pcprpt_daily.ec"
1361 #line 654 "pcprpt_daily.ec"
1363 #line 654 "pcprpt_daily.ec"
1365 #line 654 "pcprpt_daily.ec"
1367 #line 654 "pcprpt_daily.ec"
1368 _sqobind[6].sqldata = (
bens_rec).e;
1369 #line 654 "pcprpt_daily.ec"
1370 _sqobind[7].sqldata = (
bens_rec).p;
1371 #line 654 "pcprpt_daily.ec"
1373 #line 654 "pcprpt_daily.ec"
1374 _sqobind[9].sqldata = (
bens_rec).des;
1375 #line 654 "pcprpt_daily.ec"
1376 _sqobind[10].sqldata = (
bens_rec).det;
1377 #line 654 "pcprpt_daily.ec"
1378 _sqobind[11].sqldata = (
char *) &(
bens_rec).post;
1379 #line 654 "pcprpt_daily.ec"
1380 _sqobind[12].sqldata = (
bens_rec).new_report;
1381 #line 654 "pcprpt_daily.ec"
1382 _sqobind[13].sqldata = (
bens_rec).active;
1383 #line 654 "pcprpt_daily.ec"
1384 _sqobind[14].sqldata = (
bens_rec).ok;
1385 #line 654 "pcprpt_daily.ec"
1387 #line 654 "pcprpt_daily.ec"
1388 _sqobind[16].sqldata = (
char *) &(
bens_rec).obstime;
1389 #line 654 "pcprpt_daily.ec"
1390 _sqobind[17].sqldata = (
bens_rec).prod;
1391 #line 654 "pcprpt_daily.ec"
1392 _sqobind[18].sqldata = (
bens_rec).prod2ary;
1393 #line 654 "pcprpt_daily.ec"
1394 _sqobind[19].sqldata = (
bens_rec).obsag;
1395 #line 654 "pcprpt_daily.ec"
1396 _sqobind[20].sqldata = (
bens_rec).obsloc;
1397 #line 654 "pcprpt_daily.ec"
1398 _sqobind[21].sqldata = (
bens_rec).prov_avail;
1399 #line 654 "pcprpt_daily.ec"
1400 _sqobind[22].sqldata = (
bens_rec).final_avail;
1401 #line 654 "pcprpt_daily.ec"
1402 _sqobind[23].sqldata = (
bens_rec).ownag;
1403 #line 654 "pcprpt_daily.ec"
1404 _sqobind[24].sqldata = (
bens_rec).ownloc;
1405 #line 654 "pcprpt_daily.ec"
1406 _sqobind[25].sqldata = (
bens_rec).maintag;
1407 #line 654 "pcprpt_daily.ec"
1408 _sqobind[26].sqldata = (
bens_rec).maintloc;
1409 #line 654 "pcprpt_daily.ec"
1410 _sqobind[27].sqldata = (
bens_rec).init;
1411 #line 654 "pcprpt_daily.ec"
1412 _sqobind[28].sqldata = (
bens_rec).dbsource;
1413 #line 654 "pcprpt_daily.ec"
1414 _iqslct(&_SQ0, sqlcmdtxt, 5, _sqibind, 29, _sqobind, 0);
1415 #line 654 "pcprpt_daily.ec"
1420 printf(
"database error\n");
1451 sprintf(daybuf,
"%02d%02d",gmtim->tm_mon+1,gmtim->tm_mday);
1453 btim1.
year=gmtim->tm_year+1900;
1454 btim1.
month=gmtim->tm_mon+1;
1455 btim1.
day=gmtim->tm_mday;
1460 gmtim=gmtime(&tim1);
1462 sprintf(daybuf1,
"%02d%02d",gmtim->tm_mon+1,gmtim->tm_mday);
1464 etim1.
year=gmtim->tm_year+1900;
1465 etim1.
month=gmtim->tm_mon+1;
1466 etim1.
day=gmtim->tm_mday;
1470 zdate[0]=etim1.
year*10000 + etim1.
month*100 + etim1.
day;
1471 zdate[1]=btim1.
year*10000 + btim1.
month*100 + btim1.
day;
1472 zdate[2]=btim1.
year*10000 + btim1.
month*100 + btim1.
day;
1473 zdate[3]=btim1.
year*10000 + btim1.
month*100 + btim1.
day;
1480 for(k=0;k<dtotal;k++) {
1482 if(dtn_values[k].zdate==zdate[3]) {
1485 qbuf[0]=dtn_values[k].
qual;
1490 sprintf(
s[4],
"%5.2f%s",dtn_values[k].value,qbuf);
1510 for(k=0;k<qtotal;k++) {
1512 if(qtn_values[k].zdate==zdate[j] &&
1513 qtn_values[k].ztime==ztime[j]) {
1516 qbuf[0]=qtn_values[k].
qual;
1521 sprintf(
s[j],
"%5.2f%s",qtn_values[k].value,qbuf);
1533 if(strstr(
s[4],
"m")==NULL) {
1535 sprintf(xbuf,
".A %s %s DH12/%s/ %s\n",
bens_rec.
id,daybuf,pc,
s[4]);
1542 sprintf(xbuf,
".E %s %s DH18/%s/DIH+6/ %s / %s / %s / %s\n",
1567 sprintf(file,
"%s%s.%02d%02d%02d",directory,fname,gmtim->tm_mon+1,
1568 gmtim->tm_mday,gmtim->tm_year);
1571 sprintf(file,
"%s%s",directory,fname);
1573 sprintf(zbuf,
"/uinta/daily_tmp/archive/opoint.%02d-%02d-%02d",
1574 gmtim->tm_mon+1,gmtim->tm_mday,gmtim->tm_year);
1576 sprintf(mbuf,
"cp %s %s",file,zbuf);
printf("pcp %d\n", pcp_in_use[103])
long ouptime(int, int, int, int, int, int)
struct data_rec data_record
void main(int argc, char **argv)
struct pro_dly_rec dly_rec
struct pro_qrtly_rec qtrly_rec
struct pro_hrly_rec hrly_rec
int pro_dly(char *hb5, char *parm, struct stim begin_date, struct stim end_date, char *qual, struct stn_values *stn_values)
int pro_qtrly(char *hb5, char *parm, struct stim begin_date, struct stim end_date, char *qual, struct stn_values *stn_values)
struct sqlca_s::sqlcaw_s sqlwarn