• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Odds and Ends

    July 19, 2002 Timothy Prickett Morgan

    Dear Readers:

    Here are yet more short answers to a variety of questions. I hope you find something of use.

    Question:

    When I run the Create Java Program (CRTJVAPGM) command, where does the compiled code go?

    Answer:

    The optimized program becomes part of the class, jar, or zip file. You can verify this with the Work with Object Links (WRKLNK) command.

    Use WRKLNK to display the directory in which the class, jar, or zip file resides. Use option 8 to display the file attributes and page to the second panel. Note the allocated size of object. Run CRTJVAPGM, then view the class file attributes again. You should see a difference.

    Question:

    In the June 28, 2002 issue of Midrange Guru, you explained how to make a physical file created with SQL have different file and record names. I have the same question pertaining to Query rather than SQL.  I create the file with Query and the file and record format name are the same. How can I give them different names?

    Answer:

    Make the query create a file with the desired record name. After the query runs, use the Rename Object (RNMOBJ) command to rename the file. The record format will not be renamed.

    For example, Query builds a file called CUSTREC1Q.  The format also has the name CUSTREC1Q.

    Run RNMOBJ:

    RNMOBJ CUSTREC1Q *FILE CUST1Q
    

    Now the file has the name CUST1Q, but the record format is still CUSTREC1Q.

    Question:

    I’m working with some numeric data that gets placed into alpha data, and I need go the opposite route—from alpha to numeric.

    The numeric data is in an alpha array of one-character elements. I need to process the array elements, and then move the array back to a six-position packed decimal field. I tried to use the MOVEA operation to the packed field, and the compile failed.  I tried to move it to a zoned numeric field, and likewise the compile failed. Yet I could swear I have used the MOVEA op code in situations like this in the past. Am I getting senile?

    Answer:

    You remember correctly. You’re thinking of your System/36 days. RPG II has a very liberal MOVEA opcode, even allowing you to move numeric to alpha and vice versa. RPG III and RPG IV are not so generous.

     

    I use a data structure that overlays a zoned decimal field and a character field.  I move the data into the character field, and then I use the zoned decimal field, as per my example:

    D arr             s              1    dim(6)      
    D alpha           ds             6                
    D   number                1      6s 0             
    
    C                   movea     arr           alpha 
    C                   if        number >= 300000    
    

    Question:

    How do I access the local data area and other data areas in COBOL?

    Answer:

    In the special-names paragraph of the configuration section of the environment division, define a mnemonic to represent the environment name data-area.

    In the procedure division, use the accept statement, specifying the data-area mnemonic in the from clause and the data-area name in the for clause.

    The syntax of the accept verb is summarized as follows:

    ACCEPT identifier
    FROM mnemonic-name
    FOR identifier | literal
    IN LIBRARY identifier | literal
    AT identifier | literal
    WITH LOCK
    ON EXCEPTION imperative-statement
    NOT ON EXCEPTION imperative-statement
    END-ACCEPT.
    

    The following table further explains the clauses:

    FROM required mnemonic associated with DATA-AREA in SPECIAL-NAMES
    FOR required data-area name
    IN LIBRARY optional library in which data area resides
    AT optional starting position from which text is taken; default is 1
    WITH LOCK optional places a “lock exclusive allow read” on the data area
    ON EXCEPTION optional code to be executed if an error occurs
    NOT ON EXCEPTION optional code to be executed if data area access succeeds
    END-ACCEPT optional terminates scope of the ACCEPT command

    Here’s a short example program to get you started:

     identification division.                            
     program-id.  cobdtaara.                             
                                                         
     environment division.                               
     configuration section.                              
     special-names.                                      
         local-data is lda
         data-area is da.                                
                                                         
     data division.                                      
     working-storage section.                            
     01  number-of-pages   pic s999     packed-decimal.  
     01  plant-info        pic x(80).                    
     01  plant-name        pic x(30).                    
     01  logical-data      pic x.                        
     01  local-data-area    pic x(1024).   
                                                         
     procedure division.                                 
     main-logic.                                    
    * read the LDA
         accept local-data-area from lda.     
    * read a decimal data area
         accept number-of-pages from da for 'HOLDPAGES'. 
    * read a character data area
         accept plant-info from da for 'PLANTINFO'. 
    * read part of a character data area
         accept plant-name from da for 'PLANTINFO'  
             at 5.                      
    * read a logical data area            
         accept logical-data from da for 'NITEJOB'
             in library 'THOLTS'.                   
         goback.  
    

    For more information, see Chapter 14 of the ILE COBOL reference at http://publib.boulder.ibm.com/html/as400/v5r1/ic2924/books/c0925392.pdf .

    And here are a few Internet Explorer tips, just for fun:

    • To quickly and easily page down a Web page in Internet Explorer, press the spacebar. To page up, use Shift + spacebar.
    • There are other ways to move backward and forward through Web pages besides clicking on the Back and Forward icons. One method is to use Alt with the left and right cursor-movement arrows. Another is to use Shift with the mouse wheel.
    • To open a Web page in a new window, hold down Shift while clicking on the link.
    • Use Control and the mouse wheel to increase or decrease font size on a Web page. (I guess I’m getting old; I use this technique a lot.)

    — Ted

    Sponsored By
    ADVANCED SYSTEMS CONCEPTS

    SEQUEL meets all your iSeries and AS/400 data access needs in a single, integrated solution:

    • Windows, Web or host user interfaces

    • Convert AS/400 data into PC file formats

    • E-mail or FTP query results, reports and spool files
    • Run-time prompted queries and reports for end users

    • IF-THEN-ELSE logic in queries and reports

    • Report, form and label formatting second to none

    • Easily convert date fields, character-to-numeric, numeric-to-character and other data manipulation

    • SORT or JOIN using a calculated field

    • Quick summarization of data with Tabling function

    • Run multiple SEQUEL requests as one with the SEQUEL Scripting function

    • OLAP Business Intelligence at a fraction of the cost of comparable solutions

    Take 6 minutes to view a SEQUEL ViewPoint ScreenCam movie to see how simple Windows-based AS/400 and iSeries data access can be! In just a few short minutes, you can find out ways to make your job easier and improve data access throughout your organization. Download the ViewPoint movie here .

    For more information or a FREE trial of SEQUEL, call 847/605-1311 or visit Advanced Systems Concepts.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags: Tags: mgo_rc, Volume 2, Number 54 -- July 19, 2002

    Sponsored by
    DRV Tech

    Get More Out of Your IBM i

    With soaring costs, operational data is more critical than ever. IBM shops need faster, easier ways to distribute IBM applications-based data to users more efficiently, no matter where they are.

    The Problem:

    For Users, IBM Data Can Be Difficult to Get To

    IBM Applications generate reports as spooled files, originally designed to be printed. Often those reports are packed together with so much data it makes them difficult to read. Add to that hardcopy is a pain to distribute. User-friendly formats like Excel and PDF are better, offering sorting, searching, and easy portability but getting IBM reports into these formats can be tricky without the right tools.

    The Solution:

    IBM i Reports can easily be converted to easy to read and share formats like Excel and PDF and Delivered by Email

    Converting IBM i, iSeries, and AS400 reports into Excel and PDF is now a lot easier with SpoolFlex software by DRV Tech.  If you or your users are still doing this manually, think how much time is wasted dragging and reformatting to make a report readable. How much time would be saved if they were automatically formatted correctly and delivered to one or multiple recipients.

    SpoolFlex converts spooled files to Excel and PDF, automatically emailing them, and saving copies to network shared folders. SpoolFlex converts complex reports to Excel, removing unwanted headers, splitting large reports out for individual recipients, and delivering to users whether they are at the office or working from home.

    Watch our 2-minute video and see DRV’s powerful SpoolFlex software can solve your file conversion challenges.

    Watch Video

    DRV Tech

    www.drvtech.com

    866.378.3366

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Using Timestamps as Unique Keys Scheduling a Job to Run More than Once a Day

    Leave a Reply Cancel reply

MGO Volume: 2 Issue: 54

This Issue Sponsored By

    Table of Contents

    • Deleting a Badly Named IFS File
    • Odds and Ends
    • Populating JavaBeans from Database Values

    Content archive

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

    Recent Posts

    • 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
    • Big Blue Raises IBM i License Transfer Fees, Other Prices
    • Keep The IBM i Youth Movement Going With More Training, Better Tools
    • Remain Begins Migrating DevOps Tools To VS Code
    • IBM Readies LTO-10 Tape Drives And Libraries
    • IBM i PTF Guide, Volume 27, Number 23

    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