Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Variable in CALL cmd

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Variable in CALL cmd

    Both CL and RPG support calling with a variable name. dcl &var type(*char) len(21) chgvar &var 'MYPGM' call &var chgvar &var 'MYLIB/MYPGM' call &var c eval pgmname = 'MYPGM' c call pgmname c eval pgmname = 'MYLIB/MYPGM' c call pgmname d pgm pr extpgm(pgmname) c eval pgmname = 'MYPGM' c callp pgm c eval pgmname = 'MYLIB/MYPGM' c callp pgm or C MOVEL'MYPGM' PGMNAM C CALL PGMNAM C MOVEL'MYLIB/PGM'PGMNAM C CALL PGMNAM

  • #2
    Variable in CALL cmd

    We used variable CALLs in sleeper jobs written in CL long ago when we had no concept of job scheduler. Now a days I still see many complex applications who run a stream of programs by reading their names from a database file. These files are either updated by the operators manually or by programs capturing certain events. We also used variable CALLs in validation programs written in RPG. They read a file we called "Business Rules File". e.g. we chained a field to this file and it told us what program needs to be called to pop up a selection window, or what program needs to be called to validate this field against many arguments.

    Comment


    • #3
      Variable in CALL cmd

      Hi to all I am wondering if there is a way to use a variable in a CALL command. I have a database which has program name and parm values. I would like to read that DB and use CALL cmd to run the program within CL/RPGIV. I do not want to use QCMDEXEC. Is there any other way of doing this? Thanks Sarvan

      Comment


      • #4
        Variable in CALL cmd

        Thanks you all... I was not thinking properly. I created one long field which had the[*]libl/PGMNAME. When I called using this value, CL did not work. I separated both LIB and PGM NAME. It works fine. Thanks Sarvan

        Comment

        Working...
        X