|
Jim, if you look at the command language, you will see that it only lets you define a value as *DEC, i.e. a packed value. To use a command, you will need to change your parameters to packed decimal. Commands do not support zoned decimal. That is why your program is still blowing up. You are passing packed decimal data to a field defined in your program as zoned. The command language allows you to specify the type, size and precision of a value but you are still responsible for making sure that the value match between the command and the program. ILE partially solves this problem with prototypes but ILE does not apply to the OPM. They still use the trust me method. Since the AS/400 is a packed decimal machine, everything should be defined where possible as packed decimal. This is the most efficient type for the AS/400 to handle. The only time I ever use a zoned value is in a data structure to split a numeric value apart. If there was some reason you needed to split an incoming parameter apart or load into a zoned value, the following works fine. d ZonedValue s 6s 0 d InPackedValue s 7s 0 c *ENTRY PLIST c ZonedValue PARM InPackedValue The program will receive the value in packed and then move to ZonedValue as soon as the program receives control. Hope this helps. -----Original Message----- From: Jim Langston [mailto:jlangston@conexfreight.com] Sent: Thursday, January 20, 2000 9:10 AM To: RPG400-L@midrange.com Subject: Re: Entry Parameters Hmm... Okay, it was my assumption that when passing variables to an RPGLE program from the command line with parameters, that the system checked the data types of the parameters to make sure they were the same, I guess not. Which is good in this case. And, yes, I understand why it works, but didn't think to try it given my experience with parameter types in other things. Yes, negative numbers could be a pain, but I actually have the list written down as to what symbol is what negative number. It is actually not that hard to remember. } is 0, J is 1 and it goes to R is 9. Capital J and Capital R. Okay, this is doable, although I could not expect my users to know how to put in a negative number, in this case it doesn't matter since there will never be a negative number for the parameters. Er, or there should never be a negative number <g> Hmm... this being the case, it seems that any number passed as a parameter to an RPG program will always have to be passed as a character? I attempted to do a CMD for the program, but it failed with same error, but at that point it is possible that I had the variables defined differently that 15P 2. Regards, Jim Langston Simon Coulter wrote: > Hello Jim, > > Despite Buck's very well explained append, because you are expecting Zoned Decimal values you > can simply invoke the program with: > > CALL PGM(JIMCONEX/CHGAPOPEN) PARM('51' '990110' '51' '000120') > > Note the 'quotation' marks -- yeah, I know they're apostrophes. > Note that no 'conversions' are neccessary. The character values 'magically' become numbers. > > Why does this work? > > Regards, > Simon Coulter. +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | 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.