With the help of symbolic parameters, we can substitute the values dynamically in any place we want to. Say for example we are building the date, or reading the date from one input file and want to use it as a header in title or to use it in any calculation down the flow of the program while doing the condition checks like <=,>= checks. In these cases the use of symbolic fits the best.
Say like below
INPUT @01 LOWDTE $CHAR08.
@01 HEADER $CHAR06.
@10 HIGHDTE $CHAR08.
PUT "L-DATE >>>>>>>> " LOWDTE;
PUT "H-DATE >>>>>>>> " HIGHDTE;
TITLE ' test Heading' "&HEADR" ;
Here.. we are reading the input file, for the Dates and assigning the variables in INFILE DATEIN.
After that there may be several processes occurring in the program.Once done we now want to print the title taking the date read above in INFILE step. The SYMPUT parameter is used for invoking symbolic parameter in sas. Later down the line we use &variable-name as used in JCL for the value substitution.
Now ,lets see how we can use this value in sas comprison .
RETAIN CUDATE; <= Need to declare this variable as RETAIN
@01 ANO $CHAR 01
@02 BNO $CHAR02.
CUDATE = "&RUNDATE"; <<== We are assigning the symbolics here
IF EFFDATE LE CUDATE <<= Use symbolic paramter in condition check