+ Reply to Thread
Results 1 to 6 of 6

Thread: Zoned Decimal array in RPG III

  1. #1
    Guest.Visitor Guest

    Default Zoned Decimal array in RPG III

    How do I define a zoned decimal array in RPG III? "Help" in SEU says to leave the "type" field blanks for zoned decimal but a compile always generates a packed numeric array. Why Do I need this? Because the array is a parm to an RPG IV program that defines the array as signed numeric. Can I change the RPG IV program? Sure - but my original question persists. Thanks. Chris

  2. #2
    D.Handy Guest

    Default Zoned Decimal array in RPG III

    Chris, "How do I define a zoned decimal array in RPG III?" I believe if you create a DS and name the array within it (ie from 1 thru x where x = entries * zoned length) that you can achieve what you want. Doug

  3. #3
    Guest.Visitor Guest

    Default Zoned Decimal array in RPG III

    The help is referring to the data type in a file, if the array was being read from a file. To actually get a zoned array, you have to also code it as a subfield in a data structure. In the DS, code the from and to positions for the entire zoned array (if it's 7 elements of 4 zoned digits each, code it as 28 bytes). I remember scratching my head over this one once ... I hate the E spec - the array part is complicated enough without throwing the RAF stuff in too. Barbara Morris

  4. #4

    Default Zoned Decimal array in RPG III

    RPG III will convert any zoned numeric into packed for internal processing. You can verify this by using the DUMP opcode in debug mode. The resulting dump will show that even database fields defined as zoned have been converted into packed fields. Dave

  5. #5
    Guest.Visitor Guest

    Default Zoned Decimal array in RPG III

    David, When you pass a packed array as a parm to a program that defines the array as zoned decimal (which is what i was doing), the elements are not received properly in the called program. Chris

  6. #6
    Guest.Visitor Guest

    Default Zoned Decimal array in RPG III

    Wow, I'm having flashbacks to my S/36 RPG II days! Thanks. Chris

+ Reply to Thread

Similar Threads

  1. Replies: 1
    Last Post: 02-24-2006, 08:22 AM
  2. Packed vs. Zoned
    By David Abramowitz in forum RPG
    Replies: 2
    Last Post: 05-17-2005, 03:19 PM
  3. Reading data queue containing a zoned decimal field
    By Guest.Visitor in forum Visual Basic
    Replies: 6
    Last Post: 09-29-2003, 07:34 AM
  4. Decimal vs Zoned fields in RPGLE
    By Guest.Visitor in forum RPG
    Replies: 1
    Last Post: 01-24-2002, 08:32 AM
  5. Packed vs Zoned
    By bibarnes@yahoo.com in forum Application Software
    Replies: 32
    Last Post: 10-14-1999, 02:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts