• 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
    Focal Point Solutions Group

    Comprehensive Data Protection from Focal Point SG

    Your organization needs to be thinking differently about your backup & disaster recovery strategy

    Concerns of the Industry

    • Inefficient manual backup processes
    • Effectively storing data offsite
    • Developing and testing a concrete disaster recovery plan
    • Efficient access to data in a disaster scenario for necessary users
    • Risk of cyber security attack
    • Declining IT staff and resources

    The true cause of the above concerns is an organization’s status quo – 80% of IBM i users currently backup to tape and 40% of companies have no DR plan at all. Don’t wait for a disaster to take action.

    The new way to ensure cost-effective safety

    • Automated cloud backup
    • Two (2) remote sites – redundant storage, power, internet pipe, firewalls, etc.
    • Data encryption at all times – in-flight and at-rest
    • Fully managed remote hardware DR, including remote VPN access for necessary users
    • Regularly simulated phishing tests and cyber security training

    Potential “landmines” in solutions to avoid

    • Single point of storage – no redundancy
    • Misleading data analysis, compression/de-dup ratios, sizing of necessary computer resources for backup and DR
    • Large-scale cloud storage with difficult recovery
    • Inability to meet RTO/RPO

    Don’t get caught like the many organizations we’ve seen with inefficient exposed backup data and no DR plan!

    What VAULT400 has to offer

    Backup

    • Native software agent schedules backups to the Focal Point SG cloud based on your retention scheme
    • Client data is backed up to two data centers in US or two data centers in Canada
    • 256-bit AES encryption in-flight and at rest – only the client has the encryption key
    • Detailed data analysis to ensure proper sizing

    Disaster Recovery as a Service (DRaaS)

    • Focal Point SG provides “hands-off” DR – fully managed recovery
    • 60 days of remote VPN access available to unlimited users in event of a disaster
    • Documented reports to ensure defined SLAs are met

    Managed Service Cyber Security Training

    • Fully managed phishing tests
    • Detailed reporting of results
    • Fully managed administration of custom online cyber security training

    VAULT400 Cloud Backup & DRaaS is an IBM Server Proven Solution.

    VAULT400.com/proposal for FREE analysis & proposal

    813.513.7402 | ContactUs@FocalPointSg.com

    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

    • 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