• 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
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    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

    • IBM i Has a Future ‘If Kept Up To Date,’ IDC Says
    • When You Need Us, We Are Ready To Do Grunt Work
    • Generative AI: Coming to an ERP Near You
    • Four Hundred Monitor, March 22
    • IBM i PTF Guide, Volume 25, Number 12
    • Unattended IBM i Operations Continue Upward Climb
    • VS Code Is The Full Stack IDE For IBM i
    • Domino Runs on IBM i 7.5, But HCL Still Working on Power10
    • Four Hundred Monitor, March 6
    • IBM i PTF Guide, Volume 25, Number 11

    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 © 2023 IT Jungle