Using *SYSTEMVAL
Rich `Lego-Man' Jesse - 7633
RJESSE@QTIWORLD.COM
Wed, 07 Jan 1998 15:12:46 -0600 (CST)
David Frederick replies:
DF> Something else I just thought of... your DEFINE idea would probably work
DF> if you made sure to reference the defined variable somewhere. For
DF> example:
DF>
DF> OUTPUT datafilename ADD IF DUMMY_VALUE = " "
DF>
DF> I believe QTP will not evaluate defined items that are never referenced,
DF> which probably explains why your logical name was not set. A potential
DF> downside is that the logical name may be set for each transaction (I may
DF> be wrong on that).
DF>
DF> Another idea, which may be the best and more flexible than a GLOBAL
DF> TEMP, is to use a TEMPORARY and ITEM statement within the request you
DF> want the defined value in. Example:
DF>
DF> TEMPORARY DUMMY_VALUE CHAR*1
DF> ITEM DUMMY_VALUE = "1" IF SETSYSTEMVAL("DCL_LOGNAME, "VALUE")
DF>
DF> I haven't tried this, but it should work.
DF>
DF> To answer your last question, I believe I found the solution through
DF> experimenting. You're right... the manuals are pretty vague on the
DF> topic.
We have a winner! Thanks, David! :) The explanation of the way QTP may not
evaluate an unreferenced defined item seems to be a valid one. After some more
RTFMing, I found the reason QUIZ and QTP act differently here. QTP only
calculates DEFINEd items as they are referenced, whereas QUIZ calculates them
per record complex. The TEMP/ITEM combo works like a charm for QTP.
On to the next hurdle... ;) THANKS AGAIN! :)
Rich Jesse Programmer/Analyst
rjesse@qtiworld.com Quad/Tech International, Sussex, WI USA