Using single quotes ' ' I am not able to get any value of variable and the error for column not allowed here is still coming as,

SQL> TO_DATE ("$DATEGEN","YYYYMMDD")
*
ERROR at line 8:
ORA-00984: column not allowed here

Please help me out.