Step 9: Add the Dependency to the CodeTemplate Element

Now you need to update the CodeTemplate element to reflect these dependencies.
First remove the highlighted line of code.
<CodeTemplate>
   <![CDATA[

   #set($charvar=$invarname.get(0))

  #set($informat = "${informatType}${informatWidth}.")

   data $outputDSName;
   #if ($samename=='1')
      #set($newCol = "${charvar}_old")
      set $inlibname(rename=$charvar=$newCol);
      $charvar = input($newCol,$informat);
      drop $newCol;
   #else
      #set($newCol = "${charvar}_new")
      set $inlibname;
      $newCol = input($charvar,$informat);
   #end

   run;
   ]]>
</CodeTemplate>
 
Then add the highlighted code to account for the new dependency.
<CodeTemplate>
   <![CDATA[

   #foreach($item in $invarname) #set($charvar = $item)#end

   #if($informatType == "numericChoice")
      #set($informat = "${numericInformat}${informatWidth}.")
#else
   #set($informat = "${dateInformat}${informatWidth}.")
#end

   data $outputDSName;
   #if ($samename=='1')
      #set($newCol = "${charvar}_old")
      set $inlibname(rename=$charvar=$newCol);
      $charvar = input($newCol,$informat);
      drop $newCol;
   #else
      #set($newCol = "${charvar}_new")
      set $inlibname;
      $newCol = input($charvar,$informat);
   #end

   run;
   ]]>
</CodeTemplate>
Click Save Icon to save your CTM code.