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




I don't know that I agree with the statement that "converting a parm to
hex is BETTER"  I'd say that it depends entirely on your specific
application.

However, the reason for passing it as hex is this:

  OS/400 will convert a numeric literal on the command line to a PACKED
   data type, 15 positions long with 5 decimal places.  (i.e. 15P 5)

By passing it as x'9F' instead of just 9, OS/400 doesnt think its a
numeric literal anymore.  So it simply passes a byte with a hex value
of 9F, which happens to be the value for a 1-character packed decimal
field that represents the number 9.

However, if you use the hex technique, you must be very careful to always
pass the full length of the variable, and you need to understand the way
packed numbers work.   

So, this technique is fine for a programmer thats testing a program,
provided that the program will eventually be getting its parameter from
another program.    However, in other circumstances, it'd be better to
either define a command interface for it, or to pass the parameter as
15P 5, so that the operating system can handle the translation for you.

Thats my 2 cents, anyway.  


On Thu, 23 Mar 2000, Joel Harvell wrote:

> Why would converting a parm to hex be better?  Maybe that's a dumb question
> but I really don't understand that.
> 
> jbh
> 

+---
| 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 thread ...

Follow-Ups:
Replies:

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.