2 Replies Latest reply: Sep 8, 2011 2:55 AM by Shafvan B RSS

    How does the '$' work. for eg: $(vTodaysDate) ???

      Thanks in advance...

        • How does the '$' work. for eg: $(vTodaysDate) ???
          s j

          When using a variable for text replacement in the script or in an expression, the syntax

          $( variablename )     

          is used. $(variablename) expands to the value in variablename. If variablename does not exist the expansion will be the empty string.

          For numeric variable expansions, the syntax

          $( variablename )     

          is used. $( variablename ) always yields a legal decimal-point reflection of the numeric value of variablename, possibly with exponential notation (for very large/small numbers). If variablename does not exist or does not contain a numeric value, it will be expanded to 0 instead.

          Example:

          After execution of the following script:

          SET DecimalSep=',';

          LET X = 7/2;

          $(X ) will expand to 3,5 while $(#X ) will expand to 3.5.

          Examples:

          set Mypath=C:\MyDocs\Files\

          ...

          load * from $(MyPath)abc.csv;

          set CurrentYear=1992;

          ...

          select * from table1 where Year=$(CurrentYear);