× 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.



Here's a simple CL program:

pgm

dcl &uint *uint
dcl &int *int

chgvar &int ( 0 )

dofor &uint from( 1 ) to( 10 )
select
when ( &uint *eq 1 ) +
dmpclpgm
when ( &uint *eq 10 ) +
dmpclpgm
otherwise +
chgvar &int &uint
endselect
enddo
return

endpgm

Rather pointless except that it uses various fancy things that IBM made available in V5R3... _and_ it compiles back to and runs on V5R2!

How? By compiling it on our *V5R4* system with TGTRLS(V5R2M0). Simple.

While looking for something (which I promptly forgot about), I noticed that the QSYSV5R2M0 library on one of our V5R3 machines was different from the library on our V5R4 system. Wondering if the implication held up, I threw together the above, made sure it 'worked' on V5R4, recompiled back to V5R2, FTPd it via savefile to one of our V5R2 systems, restored... and Voila! It worked.

Nothing earth-shattering, I know. But when you have a bunch of systems that you'd like to manage with general control procedures, this can make a very nice difference.

Am I just now learning something the world has known for years? (Wouldn't be the first time.) This is 'normal' for V5R2, right?

I've often thought that CL "internal" commands such as DO, SELECT, DCL, etc., that are only valid in compiled programs should be easier to create back-level, but I never really expected to see it.

Tom Liotta


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.