Maximum number of CL variables with IBM i 6.1

10 pts.
CL programming
CL variables
DCL command
IBM i 6.1
IBM iSeries
System i
What is the maximum number of variables that you may define using the DCL command in a CL program on an IBM i version 6.1 system? Also: Where is this documented, if you know? I couldn't find it in the online help, Information Center, or CL Programming PDF. Thanks!

Answer Wiki

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

I couldn’t find it either from a quick scout round the usual suspects.

Why do you want to know?

It’ll be a big number – I’ve never heard of anyone running out of DCL’s – they are, after all, only a tag for the compiler.

I struggle to comprehend what you’d be doing in a JCL language that would validly be a big enough single function to run this risk.

Still – I’d be interested in the answer.

(and yes, I do know how much you can accomplish in CLLE and it’s no longer a mere JCL…)

Discuss This Question: 2  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.
  • TomLiotta
    Are you really looking for the maximum DCLs? Or do you need to know the maximum number of parameters (which must be DCL'd)? Maximum parameters would make more sense -- 255, as far as I know. As others have noted, maximum number of DCL'd variables is probably in the thousands. I've also never heard of anyone running out. Since every DCL would have to have some additional statement such as a CHGVAR in order to make use of the variable and CLLE can't have more than 255 PARM() variables, you could start by checking what the maximum number of statements is that a CLLE can have. Just keep doubling your CHGVARs until the compiler hurls. (Just repeat the same ones.) Then see if adding new DCLs pushes you past the limit. Tom
    125,585 pointsBadges:
  • bvining
    I doubt (which means I don't know for sure) that there is a fixed maximum to the number of DCLs within a CL program. All language compilers run through a common, system provided, back end which generates the actual program. This back end would have maximums based on the control structures being used to identify variables within the generated program. This system maximum however would NOT be tied to the number of DCLs you declare. The CL compiler would, based on the CL commands and built-ins you use in the running of the program, also be declaring internal, temporary variables. I would expect that it's the sum of your explicit DCLs and the compilers implicit declares (both of which would appear as variable declares to the back end) that would run into this maximum. As the compilers do not document their use of temporary variables you don't have a good way to determine how many "left-over" variables you might be able to declare explicitly. As Tom suggested, the number of DCLs you can use is undoubtedly in the thousands (and I would expect -- at least for ILE -- in the tens of thousands as I found hints in OPM of back end support for a bit over 65.000 -- though again this number would include compiler generated variables). Bruce VIning
    7,070 pointsBadges:

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.

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


Share this item with your network: