Hello!
Can I use the DECODE function (or some similar function) for variables?
My basic problem is that I want to say:
if any of the variables &MONTH1, &MONTH2, &MONTH3, &MONTH4, &MONTH5, &MONTH6 equal '01' then set &SMONTH1, &SMONTH2, &SMONTH3, &SMONTH4, &SMONTH5, &SMONTH6 to 'January'
if the first variables equal '02' then set &SMONTH1, &SMONTH2, &SMONTH3, &SMONTH4, &SMONTH5, &SMONTH6 to 'February'
etc.
Of course &MONTH1, &MONTH2, &MONTH3, &MONTH4, &MONTH5, &MONTH6 are all different.
So my idea was to use something like DECODE. But I guess DECODE con only be used for data rows and not for variables?
Does anybody know how to do this?
Thanx a lot
Eva
Can I use the DECODE function (or some similar function) for variables?
My basic problem is that I want to say:
if any of the variables &MONTH1, &MONTH2, &MONTH3, &MONTH4, &MONTH5, &MONTH6 equal '01' then set &SMONTH1, &SMONTH2, &SMONTH3, &SMONTH4, &SMONTH5, &SMONTH6 to 'January'
if the first variables equal '02' then set &SMONTH1, &SMONTH2, &SMONTH3, &SMONTH4, &SMONTH5, &SMONTH6 to 'February'
etc.
Of course &MONTH1, &MONTH2, &MONTH3, &MONTH4, &MONTH5, &MONTH6 are all different.
So my idea was to use something like DECODE. But I guess DECODE con only be used for data rows and not for variables?
Does anybody know how to do this?
Thanx a lot
Eva