mapunit /* mu is a temporary abbreviation for mapunit
info /* identifies the type of data being manipulated
muid /* defines the "relate item"
muid /* defines table location where new items will be added
ordered /* ordered relate type
rw /* read/write access
<Return>
/*
/* the following set of commands determine the total A%, B%, C%,and D% for
/* a mapunit by respectively reselecting the "comp" records with
/* specific values for the hydgrp field, summing the values of the comppct
/* fields for those records, and dynamically storing the result in the
/* mapunit items A%, B%, C%, and D%. This process is repeated for each
/* value of hydgrp.
/*
reselect hydgrp = 'A'
calc mu//A_pct = mu//A_pct + comppct
select comp
reselect hydgrp = 'B'
calc mu//B_pct = mu//B_pct + comppct
select comp
reselect hydgrp = 'C'
calc mu//C_pct = mu//C_pct + comppct
select comp
reselect hydgrp = 'D'
calc mu//D_pct = mu//D_pct + comppct
quit
/*
/* All of the attributes of mapunit, including the newly determined A%, B%,
/* C%, and D%, are then added to the soilshed polygon attribute table
/* through use of the joinitem command. The relate item muid (mapunit id)
/* is used to associate the two tables. The data from mapunit is enterred
/* into soilshed.pat immediately following the item muid.
/*
joinitem soilshed.pat mapunit soilshed.pat muid muid
/*
/* In the event that the watershed coverage includes boundaries of
/* subwatersheds, the statsgo polygons may also be desired on a subwatershed
/* basis. Use of the intersect command creates a new coverage (soilstat)
/* that defines soil type data within subwatershed boundaries:
/*
intersect soilshed covname soilstat
&return
/**********end of AML************************************************
Go to AML Listing