In V5R2, you can do this: Date8s0 = %Uns(%Char(%Date():*ISO0)); In V5R1, you can't use %UNS like this, so you have to overlay an 8a with an 8s0. Chris Ringer RingerContracting@yahooo.com
In V5R2, you can do this: Date8s0 = %Uns(%Char(%Date():*ISO0)); In V5R1, you can't use %UNS like this, so you have to overlay an 8a with an 8s0. Chris Ringer RingerContracting@yahooo.com
We run V5R1, and to get the current date into an 8,0P field I generally use something like this...
Code
Thanks Chris & Kev. We just went to V5R2 a few months ago and the %Uns is just the type of solution I was looking for.
I think I missed something. The example that Kevin gave you didn'tt reference %UNS at all. How would you use it to convert to CCYYMMDD for a date? Thanks!
I need to get the current date into a numeric field, in format CCYYMMDD, with no separators. I am trying to do this in /Free so moving the date field to the numeric field is out. (That would be the easiest in my mind.) But since the 'Move' instruction is not allowed, I am struggling to find the easiest solution in /Free format. Any ideas would be appreciated. TIA Bryan
The request is to get the current system date into a numeric field in /FREE. I get the current system date into a numeric field like this: Date8s0 = %Uns(%Char(%Date():*ISO0)); 1. %Date() gets the current system date in ISO format YYYY-MM-DD. 2. %Char() converts ISO date into 8a character field like this 'YYYYMMDD' 3. %Uns or %Int converts a character field to a numeric field like 'YYYYMMDD' to YYYYMMDD Chris