|
rpg400-l-request@xxxxxxxxxxxx wrote:
1. SBMJOB ~ RQSDTA (Captain Jerry) *Can anyone explain (maybe in layman's terms!) what the difference in the two CL Statements below is? Is one better then the other? More functionality? Different System Impacts? Anything?* ** * SBMJOB JOB(WPC8060) RQSDTA('CALL WPC8060 ') SBMJOB CMD(CALL PGM(WPC8060)) JOB(WPC8060)
Jerry: Probably only an IBM developer can really explain, but they remain pretty quiet on this even though it's regularly discussed. The difference that was _apparently_ intended by IBM is that the CMD() parameter is useful for humans and the RQSDTA() parameter is better suited for programs. The CMD() parameter allows for prompting of commands. This is _FAR_ less useful when the command is CALL because the PARM() list on the CALL command is practically unstructured. Each parm element can be a different data type and length from each of the others. There is no external indication of what each element should be. For anything but CALL, prompting makes sense. But for CALL, RQSDTA() is much better. When you write an RPG program that builds a SBMJOB command (submitting a CALL command), you have total control over the RQSDTA() string. You can place any sequence of characters within it and the string that you build is what gets used. The same is not necessarily true for the CMD() parm. Although it's much easier to use, it doesn't guarantee that what gets submitted is what you build. One significant issue involves truncation of trailing spaces for CALL parms longer than 32 characters. Another issue is how numeric parms are handled -- they are very likely to end up with a definition that isn't what you wanted. The guideline might be as simple as "CMD() is easy, but RQSDTA() is reliable." For your example, it doesn't make any difference since your CALL command has no parms. If you go with a more complex CALL, the difference could appear at a very unexpected moment. When I write a program that uses SBMJOB to submit a CALL, I always use RQSDTA(). Even better, never submit a CALL. Create a *CMD definition that prototypes the CALL and submit the *CMD. Then it pretty much makes no difference between CMD() and RQSDTA(). Tom Liotta
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.