|
>> What is the purpose of passing a variable of length 41 and in the called pgm receiving it as a parameter of length 40? What is the theory behind this? << Venu, It's important to make the distinction that the CL CALL is a command, not an operation. Since the parameter data will get truncated to the first non blank character, the non-blank positioned just past the receiving program's declared parameter length will force the intervening bytes to be blank filled. Since the parameter data is external to the program (passed by reference) the receiving program will never the see the extra byte, but will receive a blank filled value, which is what's needed anyway. This is a limitation only of the CALL command when used from a command line or in the CMD parameter of SBMJOB when the parameter length is greater than 32 bytes. When used in a CL program, parameters point to storage in the calling program's data space, so this limitation doesn't apply, and if you create your own command, you can declare the length (in the command) to be anything you like. The value passed will not be truncated. CL's CALL functions something like this: program to program - pass a pointer to the caller's data space command line - Copy the value of the caller's data to a system data space. Since the length of the data is not known (AS/400 parameters are actually system pointers and don't have data attributes), trim trailing blanks. If the length of the trimmed data is <= 32 bytes, use the minimum size of the parameter data space (32 bytes). If it's longer than 32 bytes, allocate enough storage to hold the data value. SBMJOB CMD parameter - same as command line. Anyway, that's the way I've always looked at it. hth Pete -- - Pete Hall peteh@earth.inwave.com http://www.inwave.com/~peteh/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This is the Midrange System Mailing List! To submit a new message, * * send your mail to "MIDRANGE-L@midrange.com". To unsubscribe from * * this list send email to MAJORDOMO@midrange.com and specify * * 'unsubscribe MIDRANGE-L' in the body of your message. Questions * * should be directed to the list owner / operator: david@midrange.com * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
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.