|
Ah yes, the dreaded 4B0 error. Okay, here's the way it works... RPGIII had what we referred to as "4-byte binary fields" and "2-byte binary fields" These field were actually "dumbed down" integer data types that allowed RPG programmers to use both digits and decimals for the field's length. For example 4B2 is valid. :( But the way you declare these puppies in RPG was by declaring their length in digits, not the size in the "buffer". So a 4B0 field is actually 4 digits, which fit in a short int, that is a 2-byte binary field. So the field size is 2-bytes. The APIs all use 4-byte integers. To declare those in RPG, you need a 9B0 field or even better, a 10i0 field. Integer data types were introduced in the early days of Version 4. They are preferred over the "B" fields which have deprecated. In RPG the way you declare a Int4 (4-byte integer) is, once again, by declaring the number of digits in the fields. I know this is confusing, but RPG is confusing nowadays. So, to declare an integer of a specific length, follow this chart: Integer Size RPG Declaration 1-byte 3I 0 2-byte 5I 0 4-byte 10I 0 8-byte 20I 0 Unlike the B data types, you can't code decimal digits with the "I" data types, and that's a good thing. Sure it would have been great if (A) IBM allowed us to code a 4-byte integer as a 4I0 field, but then again, it would have be great if IBM included prototypes for all the APIs too. :) Bob Cozzi -----Original Message----- From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com] On Behalf Of Joe Giusto Sent: Tuesday, October 29, 2002 5:20 PM To: RPG400-L@midrange. com (E-mail) Subject: Need Help With QMHRCVM - Receive Nonprogram Message API I am having trouble calling this API. I have searched for hours and can only find examples of using List type API's. Can someone tell me what I am missing in the following definition. I keep getting error CPF24B4 - Severe error while addressing parameter list. TIA 0001.00 D DS INZ 0002.00 DMSGINFO 80 0003.00 DMSGINFOLENGTH 4B 0 INZ(%SIZE(MSGINFO)) 0004.00 DMSGFORMAT 8 INZ('RCVM0100') 0005.00 DMSGQUENAME 20 0006.00 DMSGTYPE 10 0007.00 DMSGKEY 4 0008.00 DMSGWAITTIME 4B 0 0009.00 DMSGACTION 10 INZ('*SAME') 0010.00 DMSGERROR 116 0011.00 D 0012.00 DRCVM0100 DS INZ 0013.00 DRCVBYTESRETURN 4B 0 0014.00 DRCVBYTESAVAIL 4B 0 0015.00 DRCVMSGSEVERITY 4B 0 0016.00 DRCVMSGID 7 0017.00 DRCVMSGTYPE 2 0018.00 DRCVMSGKEY 4 0019.00 DRCVRESERVED 7 0020.00 DRCVCCID 4B 0 0021.00 DRCVCCID2 4B 0 0022.00 DRCVRPLLENRET 4B 0 0023.00 DRCVRPLLENAVL 4B 0 0024.00 DRCVMESSAGE 10 0025.00 D ERRORDS DS INZ 0026.00 D BYTESPROV 1 4B 0 INZ(116) 0027.00 D BYTESAVAL 5 8B 0 0028.00 D MESSAGEID 9 15 0029.00 D ERR### 16 16 0030.00 D MESSAGEDTA 17 116 0031.00 C 0032.00 C *ENTRY PLIST 0033.00 C PARM EPMSGQNAME 10 0034.00 C PARM EPMSGQLIB 10 0035.00 C PARM EPMSGTYPE 10 0036.00 C 0037.00 C MOVEL EPMSGQNAME MSGQUENAME 0038.00 C MOVE EPMSGQLIB MSGQUENAME 0039.00 C 0040.00 C CALL 'QMHRCVM' 0041.00 C PARM MSGINFO 0042.00 C PARM MSGINFOLENGTH 0043.00 C PARM MSGFORMAT 0044.00 C PARM MSGQUENAME 0045.00 C PARM EPMSGTYPE MSGTYPE 0046.00 C PARM MSGKEY 0047.00 C PARM MSGWAITTIME 0048.00 C PARM MSGACTION 0049.00 C PARM ERRORDS 0050.00 C 0051.00 C 0052.00 C EVAL *INLR = *ON Joe Giusto II Programmer/Analyst Ritz Camera Beltsville, MD 301-419-3209 x347 410-813-2812 x347 _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
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.