Numeric to packed

I need to read a table and pick out those records that were updated on the current date. In this table, the field that contains the date is a descriptor field, but it is also a packed field - depending on the table, it’s either (p12.0) or (p8.0). Since it’s a packed field, I’d like to convert the date (say, *datn) to a packed field so that I can do the read directly, instead of reading each record in the table, converting the packed date to a n8.0 or n12.0, and then comparing that number with today’s date.

READ table_name BY packed_date = #today_packed
END READ

So how might I go about converting a number to a packed number? Or is there a better way to go about this?

Thanks in advance for the help.

#today_packed (p8) := DATN
read table_name by packed_date = #today_packed /
or find…
etc…

You don’t need to convert to unpacked to do the comparison.

How is the field that contains the date “encoded”? P8 I can understand, something like YYYYMMDD; but what is the coding for a P12 field?

steve