Another Informix programming snag....Need help, please :-)
Posted in 1994
I am stumped as to how to progress with this problem. I have a set of launch
points that get written into a sql script using awk. (see select.sql script
below for example) The number of launch points can vary from 1 to 20. Each
select statement represents a separate launch point. The selection represents
the location and type of endangered species within a given radius of the launch
site. I need to print out (preferably using ACE report) something like the
report below. How can I group the select statements so that the selections from
each launch site may be listed separately in the report ? Also, each launch
point must be identified by its easting and northing UTM, if possible.
select.sql
-----------------------------
SELECT *
FROM sites WHERE
( ( ( ( easting - 368345 ) * ( easting - 368345 ) +
( northing - 3586176 ) * ( northing - 3586176 )
) < ( 5700 ) * ( 5700 )
) AND easting > 0 AND northing > 0
);
SELECT *
FROM sites WHERE
( ( ( ( easting - 368306 ) * ( easting - 368306 ) +
( northing - 3586195 ) * ( northing - 3586195 )
) < ( 5700 ) * ( 5700 )
) AND easting > 0 AND northing > 0
);
SELECT *
FROM sites WHERE
( ( ( ( easting - 370284 ) * ( easting - 370284 ) +
( northing - 3585720 ) * ( northing - 3585720 )
) < ( 5700 ) * ( 5700 )
) AND easting > 0 AND northing > 0
);---------------------
report format (ideally)
Endangered Species Within Given Radius of Launch Sites
Launch Point Species Species Species Document Document Document
UTM Name Easting Northing Name Type Date
(368345,3586176) birda x1 y1 doca typea 12/12/93
birdb x2 y2 docb typeb 12/12/92
birdc x3 y3 docc typec 1/1/91
(368306,3586195) birdd x4 y4 docd typea 3/3/93
birdf x5 y5 docf typeb 5/5/92
birdc x3 y3 docc typec 1/1/91
(370284,3585720) birda x1 y1 doca typea 12/12/93
birdg x6 y6 docg typeb 6/6/92
birdc x3 y3 docc typec 1/1/91
--------------------------------------------
Please Note: Launch point UTM is NOT in Informix Database "sites". The UTM
data has been taken from the Where statement in the sql script (these UTM's will
vary each time the report is run). This could be substituted for launch 1,
launch 2, launch 3 if necessary.
I realize this may have to be done using something besides the ACE report, but
I'd prefer using ACE if possible. I know a little awk and originally had each
select statement output to a separate file, but I couldn't figure out how to
read them all back into a single awk script with launch UTM data attached.
Nothings ever easy. Sigh.
Any suggestions would be welcome.
Thanks in advance
e-mail prefered but posting okay
weller@zorro.cecer.army.mil
Bonnie