Hi,
i have built a small application using CL to convert date to required format. When i want to accomplish the same from RPGLE program with a display file to input date i wanted to call CVTDAT command from the RPG program. But i am geting error saying this command can't be issued in this set...is my approach true what else should i do to get this right? Pl advice...
thanks
Software/Hardware used:
ASKED:
August 12, 2008 10:39 AM
UPDATED:
August 13, 2008 4:50 PM
Hi Martin
thanks a lot. So i can’t use those commands which return some value i hope and similarly can’t i use the SNDPGMMSG too?
thanks
Ram
Hi,
You’re right – you can’t use SNDPGMMSG directly from the RPG program – but you can via a CL program. A lot of people make their own small CL programs for these sort of tasks – sometimes people create service programs which include a lot of the common tasks.
Regards,
Martin Gilbert.
Hi,
can’t i call them using QCMDEXC API from RPG programs?both CVTDAT and SNDMSG? Actually i am using the QCMDEXC call. But still got those error messages.
thanks again
Ram
Hi,
They won’t work from QCMDEXC (whether you use API or CALL), because they work with CL variables – QCMDEXC doesn’t use CL variables – it passes the values as parameters.
Probably best to make a couple of small CL program called CVTDATC, SNDPGMC, etc and use these from your RPG. The CL programs only have to accept/return parameters and run the commands.
Regards,
Martin.
What kind of date conversion could you possibly need that CL can do, but RPG can’t ? RPG has very powerful date support.
My recommendation after a lot of date work is to do everything in RPG.
RPG is feature rich when it comes to handling dates.
Why complicate it with a call to a CL program?