Link to home
Start Free TrialLog in
Avatar of dpalme
dpalme

asked on

Frustrated with this one passing a DATE value to a display file

I have a display file with a field called APPDATE, it is a numeric O field with a length of 8.  It is formatted to display the date in DD/MM/YYYY format.

I am trying to pass it the system date in a sub-routine with the following statement

EVAL APPDATE = *DATE

But the compiler is complaining, everything I try keeps giving me trouble.

Suggestions?

Dogulas
Avatar of dpalme
dpalme

ASKER

Anyone have any suggestions on this?

The compiler error is the following:

 *RNF7406 30     33 000008  Data-Format entry does not match the definition of the input field APPDATE.                                  
Hi
I am assuming you are running V5.1. It is not as easy in 5.1 as it is in 5.2 because the %dec function does not convert characters to numeric.

This is about the easiest way.

d DDMMYY          ds                                                
d APPDATE                                                            
d                                                                    
c                   eval      DDMMYY = %char(%date() : *Eur0)        
c                                                                    

Dave
Avatar of dpalme

ASKER

Actually we are at V5R2 although I believe there is a plan to upgrade it to V5R3 very soon.
Hi
You can then use

c                   eval      APPDATE = %dec(%char(%date() : *Eur0) )

Dave
Avatar of dpalme

ASKER

I added what you suggested Dave, but I am still getting the same error and I am also getting another error:

 *RNF7416 30     65 000703  The types of the right and left hand side do not match in    
                            the EVAL operation.                                          
ASKER CERTIFIED SOLUTION
Avatar of daveslater
daveslater
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dpalme

ASKER

Ok but won't that give me the same problem when reading a record from the database?