• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Editing Numbers in CL, Take Two

    November 30, 2005 Hey, Ted

    I just read Cletus’ tip on the editing of numbers in CL procedures, called Editing Numbers in CL. I will add these techniques to my tool kit. As always, thanks for the great stuff. Here’s another method I’ve used to remove leading blanks from numbers in CL.

    –Russ

    Russ’s method uses a message description that has a four-byte binary variable. Here’s how it works. (This following code is mine, not his, so any mistakes are also mine.)

    Let’s use the example from the previous article. Variable &CustOrders contains the number of orders that have been added to a database file. Our job is to load the number of orders, without leading blanks, into the &AlphaNum variable.

    First, a few variable declarations.

    dcl  &CustOrders   *dec      10 
    dcl  &AlphaNum     *char     10 
    dcl  &BinVar       *char      4 
    

    Second, a message description that defines a four-byte binary variable.

    CrtMsgf    Msgf(Qtemp/TempMsg)      
    MonMsg     MsgID(CPF2112)           
    AddMsgd    MsgID(TMP1001) Msgf(QTEMP/TEMPMsg) Msg('&1') +  Fmt((*BIN 4)) 
    MonMsg     MsgID(CPF2412) 
    

    The MONMSG message commands keep the CL procedure from erroring out during a rerun.


    As before, variable &CustOrders has the number of orders. Convert the number of orders to binary format.

    RtvMbrd    File(ORDERS) NbrCurRcd(&CustOrders)  
    ChgVar     Var(%BIN(&BinVar)) Value(&CustOrders) 
    

    Now, retrieve the message description into a CL variable. In the process, the system applies the number of orders to the message.

     RtvMsg     MsgID(TMP1001) Msgf(Qtemp/TempMsg) + 
                 MsgDta(&BinVar) Msg(&AlphaNum)
    

    At this point, &AlphaNum contains the number of records in the ORDERS file, left-adjusted.

    Thanks to Russ for submitting this editing technique.

    –Ted

    RELATED STORY

    Editing Numbers in CL

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    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

    Ipedo Seeks to Bridge Web Services with Business Intelligence NetManage Cuts Complexity and Cost of iSeries Product

    Leave a Reply Cancel reply

Volume 5, Number 44 -- November 30, 2005
THIS ISSUE
SPONSORED BY:

Advanced Systems Concepts
WorksRight Software
Guild Companies

Table of Contents

  • Everything You Ever Wanted to Know About Converting Dates
  • Editing Numbers in CL, Take Two
  • Selectively Deleting OS/400 Spool Files

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