how to dynamically create upper bounds of vector declaration

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

how to dynamically create upper bounds of vector declaration

Krampner, John

I am trying to use the value of a variable to define the upper bounds of the declaration of a vector. The variable being used has been created as the result of the Count function in a CasesToVars function.  The code I am using looks like this (the “187” figure is put in for simplicity--In the actual program #UpperBounds would get its value from a variable):

 

compute #UpperBounds=187.

 

DEFINE HotDeckMacro (arg1 = !TOKENS(1))

            Vector Dupersid = dupersid1 to !CONCAT("dupersid",RTRIM(LTRIM(STRING( !arg1, F8.0))),'.' ).

!ENDDEFINE.

HotDeckMacro arg1 = #UpperBounds.

 

I keep getting an error message saying:

 

>Error # 6839 in column 57.  Text: (

>In a macro expression, a left parenthesis immediately follows an operand.

>This command not executed.

 

I want the line of syntax inside the macro to ultimately read “Vector Dupersid = Dupersid1 to Dupersid187.”

 

Can anyone tell me what I am doing wrong?

 

John Krampner

Center for Economic Opportunity / HRA

180 Water Street

212-331-4708