Hi:
Sadly there's not a good point and click way to build a macro program. So you'll have to do it the old-fashioned way -- with code and you'll have to learn the code the old-fashioned way -- by reading the documentation on the SAS Macro facility.
However, as much as I am a fan of the Macro documentation, I also think this is the best paper for learning general macro processing concepts and the programs are not so long that you could NOT make up your own test programs based on the examples in this paper. It even covers conditional processing:
http://www2.sas.com/proceedings/sugi28/056-28.pdf
Then, here are some links to other forums postings that you may find useful:
http://support.sas.com/forums/thread.jspa?messageID=9165⏍
http://support.sas.com/forums/thread.jspa?messageID=7089᮱
http://support.sas.com/forums/thread.jspa?messageID=6402ᤂ
http://support.sas.com/forums/thread.jspa?messageID=5697ᙁ
http://support.sas.com/forums/thread.jspa?messageID=2664੨
http://support.sas.com/forums/thread.jspa?messageID=9438ⓞ
http://support.sas.com/forums/thread.jspa?messageID=9165⏍
since they either deal with macro issues directly, or with finding out how many observations are in a table and creating a macro variable.
Do not, I repeat, do NOT attempt to change the EG-generated code for your task with macro programs/processing/variables until you understand how and where to make the appropriate changes. That's because, behind the scenes, EG uses and inserts some of its own macro programs and processes into your task code.
If you have trouble figuring out where your EG task code needs to change, then your best bet for help is to contact SAS Technical Support for help with your task.
cynthia