{*--------------------------------------------------------------------*} {* This demo uses htmSQL directives to retrieve and display the *} {* results of a survey mailer. *} {*--------------------------------------------------------------------*} htmSQL Demo: Survey Respondents Ages {&ager} with Household Incomes from {&incr}

htmSQL Demo: Survey Respondents Ages {&ager} with Household Incomes from {&incr}

This page lists the names and addresses of survey respondents who are ages {&ager} and have incomes of {&incr}.

To see the the htmSQL input file from which this page was produced, click here.


{*--------------------------------------------------------------------*} {* The first task is to write a query that selects the data from a *} {* SAS data set. This query is contained in the SQL section. Then the *} {* results set is formatted in the eachrow section. *} {* *} {* Both the SQL and eachrow sections are contained in the query *} {* section. The query section also specifies the data source that is *} {* used. This demo uses a data source named demos. *} {*--------------------------------------------------------------------*} {query datasrc="demos"} {*--------------------------------------------------------------------*} {* The following SQL section contains an SQL query that retrieves *} {* name and address information for all of the respondents in a given *} {* age group and income range; the age group and income range are *} {* input parameters that are required for htmSQL to properly process *} {* this input file. The SAS data set that contains the survey results *} {* is named DEF.MAILRESP. *} {*--------------------------------------------------------------------*} {sql} select name, address, city, zip from def.mailresp where incr="{&incr}" and ager="{&ager}" order by city, zip {/sql} {*--------------------------------------------------------------------*} {* The following eachrow section prints each row of the results set *} {* in a standard mailing list style, with name, street address, and *} {* city/state/zip on separate lines. The

tag puts vertical space *} {* between the respondents in the list. *} {*--------------------------------------------------------------------*} {eachrow} {&name}
{&address}
{&city}, NC {&zip}

{/eachrow} {*--------------------------------------------------------------------*} {* End the query section. *} {*--------------------------------------------------------------------*} {/query}

Note: The names, addresses, incomes, and ages depicted in this sample are fictitious. No association with any real person, address, or income is intended or should be inferred.