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


  • Subject: COBOL and varying argument lists, etc.
  • From: "Simon Coulter" <shc@xxxxxxxxxxxxxxxxx>
  • Date: Fri, 10 Nov 00 18:32:59 +1100


Hello,

I have spent a few hours with the manual and example code but haven't been able 
to 
determine satisfactory answers.

Question 1.
Does COBOL support a mechanism to determine the number of parameters passed in 
to the 
program or ILE procedure?  (Something like *PARMS or %PARMS in RPG IV)  I know 
COBOL 
programs can be called with a varying argument list but how does the program 
know how 
many parameters it received?  I expected a SPECIAL-NAME would be available but 
can't find 
one.  Must I test the parameter comparing the ADDRESS OF to NULL?

Question 2.
I have an RPG procedure in a service program with the following interface:
D getDay          PR             5I 0                                    
D   aDate                         D   DATFMT(*ISO) CONST OPTIONS(*NOPASS)

I am invoking that procedure from COBOL using the following methods:
     call linkage procedure "GETDAY"                  
          returning day-nbr       

     call linkage procedure "GETDAY"      
          using a-date           
          returning day-nbr       

Both procedure calls are in the same program and the parameters are defined 
thus:
01  a-date                  FORMAT DATE "@Y-%m-%d". 
01  day-nbr                 pic s9(04) binary.      

Would you expect both procedure calls to work assuming that the getDay 
procedure 
functions correctly?

Question 3.
Would you expect the %PARMS value to be set correctly in getDay after each of 
the above 
calls?  That is:
     call linkage procedure "GETDAY"                  
          returning day-nbr       

and %PARMS should be zero

     call linkage procedure "GETDAY"      
          using a-date           
          returning day-nbr       

and %PARMS should be one

Question 4.
Not strictly a COBOL question but it strikes me as useful to define the above 
RPG 
prototype with both *NOPASS and *OMIT options.  The nett result is the same but 
the 
caller can choose the call construct that suits them.  Comments?

Regards,
Simon Coulter.

«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
«» FlyByNight Software         AS/400 Technical Specialists       «»
«» Eclipse the competition - run your business on an IBM AS/400.  «»
«»                                                                «»
«» Phone: +61 3 9419 0175      Mobile: +61 0411 091 400           «»
«» Fax:   +61 3 9419 0175      mailto: shc@flybynight.com.au      «»
«»                                                                «»
«» Windoze should not be open at Warp speed.                      «»
«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
+---
| This is the COBOL/400 Mailing List!
| To submit a new message, send your mail to COBOL400-L@midrange.com.
| To subscribe to this list send email to COBOL400-L-SUB@midrange.com.
| To unsubscribe from this list send email to COBOL400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---END


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.