QCMDEXC error

1150 pts.
Tags:
CL/400
CVTDAT
QCMDEXC
RPG
RPGLE
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 getting error saying this command can't be issued in this set...is my approach true what else should I do to get this right? Please advice... thanks

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

The CVTDAT command can only be used from a CL program or REXX procedure, this is because it is passed variables from the command line (not as parameters from a call) and expects to return the resulting variable to the CL program/REXX procedure.

You could use a small CL program to receive the parameters from your RPG program, execute the CVTDAT command and return the result to your RPG program. Although you may be able to achieve the same result using the built in functions of ILE/RPG. It depends what you’re trying to do.

Regards,

Martin Gilbert.

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • ten2008
    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
    1,150 pointsBadges:
    report
  • Gilly400
    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.
    23,730 pointsBadges:
    report
  • ten2008
    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
    1,150 pointsBadges:
    report
  • Gilly400
    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.
    23,730 pointsBadges:
    report
  • graybeard52
    What kind of date conversion could you possibly need that CL can do, but RPG can't ? RPG has very powerful date support.
    3,115 pointsBadges:
    report
  • WoodEngineer
    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?
    6,365 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following