• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • End-of-Year Odds and Ends

    December 14, 2011 Ted Holt

    Dear Colleagues:

    It’s hard to believe that another year is coming to an end, but it’s happening yet again. Let’s wind up 2012 with some odds and ends. I hope you find something useful.

    In response to Message Received, But Not Understood, Michael wrote:

    I have used the CMPDTA parameter on the MONMSG command to provide this filter. See CPF2817.

    Here is an illustration of Michael’s suggestion:

    CPYF       FROMFILE(&FRLIB/&FRFILE) +
                 TOFILE(&TOLIB/&TOFILE) FROMMBR(&FRMBR) +
                 TOMBR(&TOMBR) MBROPT(*REPLACE) CRTFILE(*NO)
    MONMSG     MSGID(CPF2817) CMPDTA(CPF2861) EXEC(DO)
       /* to-file doesn't exist */
       /* do something */
    ENDDO
    MONMSG     MSGID(CPF2817) CMPDTA(CPF2869) EXEC(DO)
       /* from-file is empty */
       /* do something */
    ENDDO
    MONMSG     MSGID(CPF2817) EXEC(DO)
       /* catch all */
       /* do something */
    ENDDO
    

    It is true that the message data of CPF2817 contains the ID of the diagnostic message that tells why CPYF failed, but putting the ID of a diagnostic message in the first seven bytes of the message data of an escape message is not a convention of IBM i. Since looking at the comparison data works for CPF2817, there’s no reason not to use that technique in this case. I think the RCVMSG technique I published is better because it works in all situations.

    In response to VALUES: A Truly Useless DDS Keyword, Skip Marchesani wrote:

    Just in case you are not aware, you can also use ALTER TABLE on the physical file created using DDS to add the check constraint to the PF.

    Thanks for letting me know, Skip. I was not aware.

    Faithful reader Duane wrote:

    Maybe when you are looking for something to write about, you could give us a refresher on the difference between CA and CF command keys. There are still people who use display files and not a GUI.

    Duane had written earlier, asking why he was having a certain problem with a display file. In a certain case, the data that he had entered into an input field was being lost. The problem turned out to be that he had defined the F2 key as CA02, not CF02.

    I have always used CF unless I had a reason to use CA. The only time that CF has not worked for me is when I was using validity-checking keywords, such as COMP and RANGE, and did not want to save data when bailing out of a screen. CA ignores validity-checking, but CF requires that keyed data be valid, even if you don’t intend to do anything with the keyed data. Let me illustrate.

    Here’s a display file.

    A                                      DSPSIZ(24 80 *DS3)
    A          R SCREEN01
    A                                      CF03(03)
    A                                  1 35'Some Screen'
    A                                      COLOR(WHT)
    A                                  3  5'Type something:'
    A            SOMETHING      8   I  3 21
    A                                      RANGE('A' 'B99999')
    A                                  5  5'Or press F3 to exit.'
    

    Here’s a CL program to drive it.

    pgm
    
    dclf qad3090d
    
    dountil &in03
       sndrcvf rcdfmt(screen01)
    enddo
    
    endpgm
    

    If you call this program and press F3 without keying anything, the program will shut down. However, if you key anything at all, the system will check the validity of the data, and if whatever you keyed (even if you only keyed blanks) does not fit in the specified range, the program will not end.

    Whenever you want to exit a screen without saving any of the keyed data, use CA, not CF.

    On December 2, Mike wrote:

    I just wanted to let you know that I was looking for a way to pass parameters to RUNSQLSTM. I found your article, and it’s EXACTLY what I needed! Thank you so much! The sed example was especially helpful. I’m not a Unix guy, so it would have taken me days to figure out on my own. You guys are a great resource.

    It was good of Mike to write, since the article to which he refers was published in 2002. That’s over nine years ago! I am proud of the amount of material we’ve built up over the past 10 years. I frequently Google for tips that I’ve run when I can’t remember how to do something or when someone asks me a question that I know we’ve answered.

    In response to Wow! I Could Have Had Long Column Names!, Richard wrote:

    I did know the aliases, but it was news to me that IBM i had a free built-in graphical debugger. No, not the Rational one, but a free, built-in debugger. You could have knocked me down with a feather, as they say. Anyway, if it’s news to you or not, there is a lovely article on the Developerworks i microsite here. Enjoy!

    We’ve not written a lot about that debugger, Richard, and I much prefer it to the green-screen debuggers. Kevin Vandever wrote about the graphical debugger in 2003 in the old Midrange Programmer newsletter. (See The Java-Based iSeries System Debugger. We really should write more about it. Does anybody out there have some good tips for the graphical debugger?

    I’d like to end with a personal note. After all, anything fits in an odds-and-ends article, right?

    It’s been a hard year for the Holts. As if the everyday challenges of being an IT manager and raising teenagers weren’t enough, both my wife and I had serious medical problems. While I was trying to deal with all this drama, someone whom I had never harmed decided to send out spam that appeared to come from the contact page of www.itjungle.com. Gmail picked up spam and decided that anything from that email address, including your correspondence, was unworthy of my attention. I noticed that the volume of email coming from readers had dropped, but with so much real life going on, I didn’t think to look into it.

    On December 7, I discovered that your responses were going to my spam folder. I don’t know how long it had been going on. Talk about kicking a guy when he’s down. I felt heartbroken, because I really do appreciate and look forward to your comments, questions, and feedback. (Those of you who never hear back from me may find that a little hard to believe. I don’t blame you.)

    Your email is what keeps this newsletter going. I can’t answer all the questions I receive. I try to find other people to answer the ones I can’t answer, but that doesn’t always work out. But I can find answers to enough questions to fill Four Hundred Guru twice a week, which is sufficient.

    So, if you’ve sent me a question within the past few months, didn’t hear back from me, and still need some help, please send your question again. I will do my best to help as many people as I can, and if I can publish your question and the answer to it, your fellow professionals will benefit as well.

    I wish all of you the merriest of Christmases (or whatever holiday you celebrate). May 2012 be the best year ever for all of us.

    RELATED STORIES

    Wow! I Could Have Had Long Column Names!

    VALUES: A Truly Useless DDS Keyword

    Message Received, But Not Understood

    The Java-Based iSeries System Debugger

    Parameterized RUNSQLSTM



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    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

    Sponsored Links

    looksoftware:  Take your IBM i apps from average to amazing! FREE OnDemand webinar!
    The 400 School:  Fall Training Sale – Discounts up to 40%! RPG IV COBOL CL Admin Security
    CCSS:  Achieving Lights Out Automation in an IBM i environment. Get the Best Practice guide

    IT Jungle Store Top Book Picks

    BACK IN STOCK: Easy Steps to Internet Programming for System i: List Price, $49.95

    The iSeries Express Web Implementer's Guide: List Price, $49.95
    The iSeries Pocket Database Guide: List Price, $59
    The iSeries Pocket SQL Guide: List Price, $59
    The iSeries Pocket WebFacing Primer: List Price, $39
    Migrating to WebSphere Express for iSeries: List Price, $49
    Getting Started with WebSphere Express for iSeries: List Price, $49
    The All-Everything Operating System: List Price, $35
    The Best Joomla! Tutorial Ever!: List Price, $19.95

    Santa Faces Daunting Supply Chain Challenge The World Is Not Going To End In 2012

    Leave a Reply Cancel reply

Volume 11, Number 38 -- December 14, 2011
THIS ISSUE SPONSORED BY:

WorksRight Software
Bytware
Twin Data Corporation

Table of Contents

  • I Was Just Wondering. . .
  • End-of-Year Odds and Ends
  • Admin Alert: Hidden Parameters of the Submit Job Command

Content archive

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

Recent Posts

  • Public Preview For Watson Code Assistant for i Available Soon
  • COMMON Youth Movement Continues at POWERUp 2025
  • IBM Preserves Memory Investments Across Power10 And Power11
  • Eradani Uses AI For New EDI And API Service
  • Picking Apart IBM’s $150 Billion In US Manufacturing And R&D
  • FAX/400 And CICS For i Are Dead. What Will IBM Kill Next?
  • Fresche Overhauls X-Analysis With Web UI, AI Smarts
  • Is It Time To Add The Rust Programming Language To IBM i?
  • Is IBM Going To Raise Prices On Power10 Expert Care?
  • IBM i PTF Guide, Volume 27, Number 20

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