|
S Hello Domenico and Jon, Thanks for the example Domenico. It does appear the using ADDRESS OF is the only native COBOL way of determining passed arguments. It is also possible to use the CEETSTA API if arguments have been OMITTED. I had similar code to yours but I tested the parameter directly. Here is the sample code I used: *************** Beginning of data ********************** ID DIVISION. PROGRAM-ID. EXAMPLE. WORKING-STORAGE SECTION. LINKAGE SECTION. 01 PARM1 PIC S9(9) BINARY. 01 PARM2 PIC X(30). 01 PARM3 PIC X(10). PROCEDURE DIVISION USING PARM1 PARM2 PARM3. PARA-1. IF ADDRESS OF PARM1 = NULL DISPLAY "PARM1 is NULL". IF ADDRESS OF PARM2 = NULL DISPLAY "PARM2 is NULL". IF ADDRESS OF PARM3 = NULL DISPLAY "PARM3 is NULL". EXIT PROGRAM. ****************** End of data ************************* Jon sent me e-mail indicating that RPG always passes a minimum amount of descriptor information thus allowing %PARMS to work. COBOL doesn't pass any descriptor information unless you tell it to so do. Adding the following incantation to the SPECIAL NAMES paragraph caused the correct parameter information to be passed. LINKAGE TYPE IS PROCEDURE FOR "GETDAY" USING ALL ARE DESCRIBED. I still have a question in with IBM support regarding this because without the above incantation %PARMS is greater than zero when nothing is passed and zero when something is passed. For example: call linkage procedure "GETDAY" returning day-nbr and %PARMS should be zero but is actually greater than zero call linkage procedure "GETDAY" using a-date returning day-nbr and %PARMS should be one but is zero. This seems so wrong it is worth a PMR. 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 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.