As a follow up to my previous response, here is the way to do this type of report using the CMD function. This simplifies the programming and potentially reduces errors by having only one place to change the current month and year of the report.
Jamie
*AIDSP1.PGM *Generates Monthly AIDS Surveillance Report of CMC.
set echo=off cls close logclose define inftype __ global define infname ___________________ global
Read aids logopen "Monthly AIDS Surveillance Report of CMC.htm" /replace Set table design=box TYPE "\LTable (v) Opportunistic inftypes"
* This cmd function creates one table based on the value of global variable inftype * if there are data. Change month and year below. cmd report1 select monthr=12 select yearr=2008 select @inftype = "Y" count imif $count > 0 then tables C2bsex @inftype else type "No case reported with @infname (@inftype)" endif select end
inftype = "i1" infname = "Tuberculosis" report1 inftype = "i2" infname = "Candidiasis" report1 inftype = "i3" infname = "Herpes Zoster" report1 inftype = "i4" infname = "Toxoplasmosis" report1 inftype = "i5" infname = "Bacterial infections" report1 inftype = "i6" infname = "PCP" report1 inftype = "i7" infname = "Cryptococcal Meningitis" report1 inftype = "i8" infname = "Kaposi Saracoma" report1 inftype = "i9" infname = "Parasitic infections" report1