• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • LIKE is Like, Confusing, Man!

    December 4, 2002 Timothy Prickett Morgan

    Hey, Ted:

    IBM is doing it again, and I’m about to pop a vein. I’m getting a data decimal error in an RPG IV program when I access the contents of a data area subfield. The subfield is called PPLANT and it’s defined on the D spec with the LIKE keyword. PPLANT is based on a database file field named IPLANT, which is zoned.

    D PlantDS         ds
    D  PPlant                             like(iplant)
    

    The compiler listing shows IPLANT in the file input and output buffers as being in zoned-decimal format. However, the cross reference shows IPLANT as being in packed-decimal format. Since IPLANT is defined as packed, so is PPLANT. The data in the data area is passed as zoned from another program, so I need PPLANT to be defined as zoned.

    Do you know what’s going on or have any solutions besides hard coding the subfield definition?

    — John

    With the help of IBM’s Barbara Morris, I have an answer for you.

    File definitions, whether internally described with I specs or externally described with DDS or SQL, are not field definitions, but descriptions of data in an I/O buffer. When you define a database field as zoned, you are telling the compiler that the field is stored in a zoned format in the file. (In the case of a zoned field in a logical file, the data may be in some other format in the physical file, but the logical file presents it to the program in zoned format.) Note that you are not telling the compiler how the data should be stored in the computer’s memory while the program is running.

    The compiler allocates space for each field of each file. If you define a storage format for a field, the compiler allocates the field according to your definition. The following line defines IPLANT as zoned:

    D IPlant          s              4s 0
    

    But if you do not define a storage format for a field, the compiler uses a default storage format. For numeric fields, the default format is packed decimal. That is why you see IPLANT defined as packed decimal in the cross reference. When your program reads the file, the zoned-decimal value in the buffer is copied to a packed-decimal workspace for IPLANT.

    To solve your problem, IBM recommends that you code an externally described data structure for the externally described file that contains IPLANT.

    Fchfile    uf   e             disk
    D ChFileDS      e ds                  extname(chfile)
    D PlantDS         ds
    D  PPlant                             like(iplant)
    

    The IPLANT field, which is found in file CHFILE, is zoned, so IPLANT is defined as zoned in data-structure CHFILEDS. Since PPLANT is defined to be like IPLANT, PPLANT is also zoned.

    — Ted

    Sponsored By
    CENTERFIELD TECHNOLOGY

    Do your iSeries batch jobs always finish before the results are needed by your business?

    IT departments are responsible for much more than just keeping the system running . . . they also must answer to financial, marketing, HR, and sales managers who need data analysis NOW. If there were a way for you to deliver the data much faster without going through the intricacies of re-configuring your batch jobs by hand, the expense of more CPU and memory capacity, and finding out how much difference the right tool makes without a lengthy evaluation, wouldn’t you do it?

    Click now to sign up!

    Centerfield Technology batch/ACCELERATOR

    Timely and accurate data analysis depends on large reports, check runs, consolidations, data warehouse extracts and the like–running in batch mode to avoid conflicts between complex, CPU-intensive processing and vital interactive functions. Today, vital interactive applications must be available more hours because of systems consolidations, constant web access, and worldwide operations spanning all 24 hours of every day.

    Increased data storage requirements, user access, and complexity are making high availability more and more difficult to achieve. Batch processes have become even more important, more resource intensive, and more time consuming. Even with the most powerful iSeries hardware, many shops are finding that batch jobs are taking longer while their batch windows are shrinking.

    The purpose of batch/ACCELERATOR is to help alleviate the pressure on system and application availability through the use of advanced, automated techniques to reduce batch job elapsed time. Centerfield Technology has developed batch/ACCELERATOR to speed this processing so that business users will get their data quicker, without affecting transaction performance.

    batch/ACCELERATOR is designed to address application and systems management challenges that include:

    • Processes that must run back-to-back (single threaded) due to data dependencies.
    • Programs that process large amounts of data and tend to be I/O bound in the disk subsystem.
    • The inability to tune batch jobs due to lack of knowledge or fear of “breaking” an existing process.
    • Underutilization of system CPU and memory capacity.

    batch/ACCELERATOR is fully automated, does not require coding changes to applications, or changes to system configuration, and it adapts to processing changes without human intervention. Centerfield will even pre-configure batch/ACCELERATOR, through a unique data-collection process, so that you’ll barely have to lift a finger to substantially reduce the elapsed time of your most challenging batch processes.

    Give us a call right away if you have any questions or concerns . . 507-287-8119.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags: Tags: mgo_rc, Volume 2, Number 90 -- December 4, 2002

    Sponsored by
    VISUAL LANSA 16 WEBINAR

    Trying to balance stability and agility in your IBM i environment?

    Join this webinar and explore Visual LANSA 16 – our enhanced professional low-code platform designed to help organizations running on IBM i evolve seamlessly for what’s next.

    🎙️VISUAL LANSA 16 WEBINAR

    Break Monolithic IBM i Applications and Unlock New Value

    Explore modernization without rewriting. Decouple monolithic applications and extend their value through integration with modern services, web frameworks, and cloud technologies.

    🗓️ July 10, 2025

    ⏰ 9 AM – 10 AM CDT (4 PM to 5 PM CEST)

    See the webinar schedule in your time zone

    Register to join the webinar now

    What to Expect

    • Get to know Visual LANSA 16, its core features, latest enhancements, and use cases
    • Understand how you can transition to a MACH-aligned architecture to enable faster innovation
    • Discover native REST APIs, WebView2 support, cloud-ready Azure licensing, and more to help transform and scale your IBM i applications

    Read more about V16 here.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Get Rid of Old IFS Files Reader Feedback and Insights: One-Row Table Still Needed

    Leave a Reply Cancel reply

MGO Volume: 2 Issue: 90

This Issue Sponsored By

    Table of Contents

    • Reader Feedback and Insights: RPG II
    • Protecting HTML Page Elements with JavaScript and CSS
    • LIKE is Like, Confusing, Man!

    Content archive

    • The Four Hundred
    • Four Hundred Stuff
    • Four Hundred Guru

    Recent Posts

    • Liam Allan Shares What’s Coming Next With Code For IBM i
    • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
    • VS Code Will Be The Heart Of The Modern IBM i Platform
    • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
    • IBM i PTF Guide, Volume 27, Number 25
    • Meet The Next Gen Of IBMers Helping To Build IBM i
    • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
    • Will Independent IBM i Clouds Survive PowerVS?
    • Now, IBM Is Jacking Up Hardware Maintenance Prices
    • IBM i PTF Guide, Volume 27, Number 24

    Subscribe

    To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

    Pages

    • About Us
    • Contact
    • Contributors
    • Four Hundred Monitor
    • IBM i PTF Guide
    • Media Kit
    • Subscribe

    Search

    Copyright © 2025 IT Jungle