• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • There’s Power in Edit Words

    December 3, 2008 Hey, Ted

    I am trying to use an edit word to insert hyphens into an account number. I must be doing something wrong, because leading zeros don’t show up. I’ve used edit codes for years, but rarely edit words. Can you help?

    –Laurie

    You’re not doing anything wrong. That’s the way edit words work, Laurie. The system blanks out everything before the first non-zero digit, including editing characters. The good news is there’s a way around it.

    Let’s illustrate with an example that many of your fellow readers will be familiar with: those nine-digit Social Security numbers without which Americans can’t do anything.

    The usual way to edit a Social Security number is to place hyphens after the third and fifth digits, like this: 123-45-6789. I don’t know if any Social Security numbers begin with zero or not, but that’s irrelevant to this illustration, so I’ll assume they can.

    The following code uses an edit word to insert the hyphens, as you are trying to with your account numbers.

    D SSN             s              9p 0 
    D EditedSSN       s             11a   
                                          
     /free                                
         EditedSSN = %editw(SSN:'   -  -    ');
    

    This code works fine if the first digit is not zero, but fails otherwise. Look at the edited values in the following table.

    Unedited number

    Edited number

    123456789

    123-45-6789

    12345678

      12-34-5678

    12345

         1-2345

     

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    Focal Point Solutions Group

    A CloudSAFE Company

    The Power of Services:
    IBM Cloud and Managed Solutions

    Upgrade your business processes, and save time and resources with specialized, best-in-class IT solutions.

    Managed, Cloud, and Custom Solutions

    Managed Services

    • Infrastructure Monitoring & Management
    • Server Patching
    • Application Patching
    • Managed Backup
    • High Availability/Disaster Recovery Monitoring
    • Cloud Environment Monitoring
    • Office 365 Management
    • Endpoint Management
    • Managed Colocation

    Cloud Infrastructure

    • IBM i Private Cloud
    • IBM AIX Private Cloud
    • VMware Private Cloud
    • VMware Cloud Director
    • Multi-Tenant Cloud
    • Desktop as a Service

    Data Protection & High Availability

    • Disaster Recovery as a Service
    • Backup as a Service
    • IBM i Vaulting

    Security

    • Security Consulting
    • Remote Security Awareness Training & Education
    • Onsite Security Awareness Training & Education
    • Phishing Tests
    • Penetration Tests
    • Mail Security
    • Managed Detection & Response
    • Managed Firewall
    • Endpoint Protection
    • Vulnerability Management
    • Vendor Risk Assessments
    • Security Risk Assessments

    Professional Services

    • Server Virtualization
    • Data & Infrastructure Migrations
    • Hardware & Software Installation
    • Microsoft Office 365 Implementation & Migration
    • Infrastructure Assessments
    • IBM i Consulting
    • IBM AIX Consulting

    Focal Point provides all the tools you need to protect your data, ensure the integrity of your IT infrastructure, and keep your business running.

    Contact Focal Point to Learn More About Our IBM Solutions and Partnerships

    Follow us on LinkedIn

    focalpointsg.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    ACOM Adds Md2 Systems to Sales Channel Soltis Exiting IBM, But He’s Not Leaving the ‘400

    Leave a Reply Cancel reply

Volume 8, Number 41 -- December 3, 2008
None

Table of Contents

  • There’s Power in Edit Words
  • SQL and Conversion Strategies
  • Admin Alert: Tuning i5/OS Storage Pools for Performance

Content archive

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

Recent Posts

  • Getting [Stuff] Done Done With Briteskies
  • Thoroughly Modern: Practical Ways IBM i Developers Can Use AI Today
  • IBM i Momma Bear Retires
  • IBM Pushes Storage Limits With Storage Scale 6000
  • IBM i PTF Guide, Volume 25, Number 48
  • IBM i Development Is Getting A Fresche Start With Some Ground-Breaking Subscriptions
  • CloudSAFE And Focal Point Solutions Group Combine Services, Unify Brands
  • Guru: Partitioning Result Sets Using SQL
  • As I See It: Elusive Connections
  • IBM i PTF Guide, Volume 25, Number 47

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