?
Solved

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

Posted on 2004-11-12
7
Medium Priority
?
734 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:dpalme
  • 4
  • 3
7 Comments
 
LVL 1

Author Comment

by:dpalme
ID: 12580645
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.                                  
0
 
LVL 14

Expert Comment

by:daveslater
ID: 12582280
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
0
 
LVL 1

Author Comment

by:dpalme
ID: 12585755
Actually we are at V5R2 although I believe there is a plan to upgrade it to V5R3 very soon.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 14

Expert Comment

by:daveslater
ID: 12586456
Hi
You can then use

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

Dave
0
 
LVL 1

Author Comment

by:dpalme
ID: 12586467
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.                                          
0
 
LVL 14

Accepted Solution

by:
daveslater earned 400 total points
ID: 12586645
Hi
What you have done is define              
APPDATE
as a date field in the database
and a numeric field on the screen.

Change the screen definition name to
MYDATE
recompile then chnage the rpg to

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

dave
0
 
LVL 1

Author Comment

by:dpalme
ID: 12586675
Ok but won't that give me the same problem when reading a record from the database?

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

LinkedIn blogging is great for networking, building up an audience, and expanding your influence as well. However, if you want to achieve these results, you need to work really hard to make your post worth liking and sharing. Here are 4 tips that ca…
Tech giants such as Amazon and Google have sold Alexa and Echo to such an extent that they have become household names. And soon they are expected to be used by commoners in their homes, ordering takeout, picking out a song, answering trivia questio…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question