× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



A simple CMD object, without any of the great bells and whistles capable 
of within a CMD object can be created quite easily from a CL program.  For 
example, take the following:

             PGM        PARM(&WSIDX &JBTYPE)

             DCL        VAR(&WSID)    TYPE(*CHAR) LEN(10)
             DCL        VAR(&WSIDX)   TYPE(*CHAR) LEN(10)
             DCL        VAR(&JOBQ)    TYPE(*CHAR) LEN(10)
             DCL        VAR(&JOBQLBR) TYPE(*CHAR) LEN(10)
             DCL        VAR(&JOBD)    TYPE(*CHAR) LEN(10)
             DCL        VAR(&JBTYPE)  TYPE(*CHAR) LEN(1)
...

Just copy this from QCLSRC to QCMDSRC.
Change the type from CLP to CMD.
Drop all lines except the PGM and any variables that appear on the PGM 
statement.
             PGM        PARM(&WSIDX &JBTYPE)

             DCL        VAR(&WSIDX)   TYPE(*CHAR) LEN(10)
             DCL        VAR(&JBTYPE)  TYPE(*CHAR) LEN(1)

Change the DCL to PARM
             PGM        PARM(&WSIDX &JBTYPE)

             PARM       VAR(&WSIDX)   TYPE(*CHAR) LEN(10)
             PARM       VAR(&JBTYPE)  TYPE(*CHAR) LEN(1)

Drop the VAR from the PARM commands
             PGM        PARM(&WSIDX &JBTYPE)

             PARM       (&WSIDX)   TYPE(*CHAR) LEN(10)
             PARM       (&JBTYPE)  TYPE(*CHAR) LEN(1)

Drop the ampersand, and maybe the parenthesis
             PGM        PARM(&WSIDX &JBTYPE)

             PARM       WSIDX   TYPE(*CHAR) LEN(10)
             PARM       JBTYPE  TYPE(*CHAR) LEN(1)

And, now that you got the variables down, change the PGM to a CMD and drop 
the parameters
             CMD

             PARM       WSIDX   TYPE(*CHAR) LEN(10)
             PARM       JBTYPE  TYPE(*CHAR) LEN(1)

This will compile successfully and work just fine.  This is a quick and 
dirty way to convert a SBMJOB CMD(CALL ...  that's getting you into all 
sorts of trouble because of parameters lengths to a nice SBMJOB 
CMD(MYCMD...   that won't have that trouble.

Now, there's a lot more potential there.  Like keyword prompting, default 
values, multiple list items, indents like library/object and so on.  But 
this will do that fast conversion.

Rob Berendt
-- 
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.