As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at firstname.lastname@example.org and provide your corporate email address, company, and name.
I recently (sometime after our 82x upgrade) noticed that the following code will work:
WHERE RUN_DATE GE '&YYMD'
RUN_DATE defined as HYYMDS. The SQL that gets produced is:
WHERE (T1."RUN_DATE" >= CAST('20201125 00:00:00' AS DATETIME));
This test is against SQL Server, but I am pretty sure it also works versus DB2. I am pretty sure that this did not always work, but it does now. Use of a literal, instead of the & variable, also works.