• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Data Structure Parameters in RPG Prototypes

    November 15, 2002 Hey, Ted

    Hey, Ted:

    Back in my RPG III (RPG/400) days, it was easy to define an entry parameter as a data structure.

    IPARM1      DS 
    I                                       1   8 ACTION 
    I                                       9  10 CODE   
    I                                      11  120RTNVAL 
    I* 
    C          *ENTRY    PLIST
    C                    PARM           PARM1
    

    I used this same method in RPG IV before I started prototyping entry parameters.

    D Parm1          DS 
    D  Action                1      8  
    D  Code                  9     10  
    D  RtnVal               11     12  0 
    I*  
    C     *entry       plist                        
    C                  parm                    Parm1
    

    Now I prototype entry parameters, as you described in the November 16, 2001 issue of Midrange Guru. Since the D-spec for …

    Read more
  • Reader Feedback and Insights: Modernizing RPG II Programs

    November 13, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I am writing in response to your article, “Help with RPG Programs,” that appeared in the November 1 issue of Midrange Guru. There’s one additional “gotcha” to look out for when removing apparently unused indicators in RPG II programs.

    A program that uses a WORKSTN file may set indicators that control field attributes (reverse image, blink, etc.) or format attributes (i.e., blink cursor, sound alarm.) on the display. The compiler listing falsely indicates that these indicators are not being used.

    — John













    Sponsored By
    WORKSRIGHT SOFTWARE

    CASS Certification

    What is it? Why do you need

    …

    Read more
  • Using Grep to Search Source Physical Files

    November 13, 2002 Timothy Prickett Morgan

    Editor’s Note: You can find an update on this article here on the IT Jungle website.

    Hey, Ted:

    Thank you for your great tips. I devour them every time they arrive in my e-mail. Every question is like a mini-mystery novel. The case is out there, and I always want to know how the crime (ahem, the problem) is resolved. Even if I know the answer, it’s gratifying to see you provided a different approach to it.

    Today, however, I have a case for you.

    I want to use grep’s wonderful search capabilities from my CL programs to search source

    …

    Read more
  • Compiler Directives for RPG Programs and Modules

    November 13, 2002 Ted Holt

    Hey, Ted:

    I would like to define a standard set of H specs for my RPG source members so that all will compile with the same options. However, some RPG source members are compiled as modules and others are compiled as standalone programs. This means I can’t include the DFTACTGRP and ACTGRP keywords in the standard H specs because RPG doesn’t allow them when compiling modules. Do you have any tips that will help me solve the problem?

    — Tony

    In V5R1 IBM added some new predefined compiler conditions that will help you solve this problem. The new conditions are

    …

    Read more
  • Reader Feedback and Insights: Overlooking the Obvious

    November 8, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I have been following the SQL tips in Midrange Guru (“SQL to the Rescue!” and “SQL’s One-Row, One-Column Table“) that use a one-row, one-column table to execute SQL functions.

    There’s an easier way.

    Use the SET statement instead.

    The following code is equivalent to the first tip on this subject, which was published in the October 25 issue.

    d found           s              1
    d field1          s              5u 0 inz(5)
    d field2          s              5u 0 inz(15)
    d field3          s              5u 0 inz(30)
    
    C/EXEC SQL
    C+ set :found =
    C+  case when max(:field1, :field2, :field3) > 25
    
    …

    Read more
  • Odds and Ends

    November 8, 2002 Timothy Prickett Morgan

    Dear Readers:

    Here, by popular demand, are more “Odds and Ends.” I hope you find something here you like.

    — Ted

    Question:

    I’m trying to read a table by key in a CL program, and I am having trouble. I know there has to be a way to do this, but I keep getting either the first record in the table or an error message that states ‘key not found.’ Can you provide an example of a CL program that reads a file randomly by key?

    Answer:

    It sounds as if the Receive File (RCVF) command didn’t find a matching

    …

    Read more
  • Omitting Parameters in RPG Programs and Modules

    November 8, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I have a program that can receive four parameters. The first one is mandatory, and the last three are optional. If I call the program and pass parameters 1, 2, and 4 to it, the %parms built-in function tells me that three parameters were passed. How does the program know which three it is getting? Thanks!

    — Doug

    You can’t skip a parameter. If you pass three parameters, they are parameters 1, 2, and 3; number 4 will be undefined.

    The only way to skip parameter 3 is to specify OPTIONS(*OMIT) in its D spec. The value *OMIT

    …

    Read more
  • Reader Feedback and Insights: We Want More RPG

    November 6, 2002 Timothy Prickett Morgan

    Hey, Ted:

    It was good to see some RPG stuff in Midrange Guru. It’s been absent lately. from my experience, there’s still more old code out there than new.

    I’ve done much to modernize our old code. It’s native now. I’ve written programs to change programs–for instance, moving user messages from compile-time arrays to message subfiles–but there are still lots of indicators! Even though my files are externally defined, the old code refers to them internally. Changing that would be overwhelming.

     

    The one nice thing, though, is that in native mode, I can increase the record length of a

    …

    Read more
  • Going from a True Date to a JDE Date

    November 6, 2002 Timothy Prickett Morgan

    Hey, Howard:

    The function you wrote in the Midrange Guru article, “JD Edwards Dates, Revisited ,” does a great job of converting a JDE date to a ‘true’ date. But what about converting a true date to a JDE date? Suppose I have a true date, for example the ‘current date’ and I want to convert that to a JDE date?

    — Andy

    Wow, I did not even think of the reverse, and now that you brought it up I see what a gaping hole that is. I can image a lot of situations where you need to go

    …

    Read more
  • Use the Full-Screen Debugger with OPM Programs

    November 6, 2002 Timothy Prickett Morgan

    Hey, Ted:

    Can I debug RPG III (also known as RPG/400) programs using the Start Debug (STRDBG) command instead of the Start Interactive Source Debugger (STRISDB) command?

    — Robert

    Yes, and I recommend you do so. I have not used ISDB in years. If anyone out there prefers ISDB to the system debugger, please let me know why .

    When you compile the RPG program, specify OPTION(*SRCDBG) on the Create RPG Program (CRTRPGPGM) command.

    When you’re ready to debug, specify OPMSRC(*YES) on the STRDBG command.

    This also works for OPM COBOL and CL programs. Specify OPTION(*SRCDBG) on the Create a

    …

    Read more

Previous Articles Next Articles

Content archive

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

Recent Posts

  • IBM Unveils Manzan, A New Open Source Event Monitor For IBM i
  • Say Goodbye To Downtime: Update Your Database Without Taking Your Business Offline
  • i-Rays Brings Observability To IBM i Performance Problems
  • Another Non-TR “Technology Refresh” Happens With IBM i TR6
  • IBM i PTF Guide, Volume 27, Number 18
  • Will The Turbulent Economy Downdraft IBM Systems Or Lift It?
  • How IBM Improved The Database With IBM i 7.6
  • Rocket Celebrates 35th Anniversary As Private Equity Owner Ponders Sale
  • 50 Acres And A Humanoid Robot With An AI Avatar
  • IBM i PTF Guide, Volume 27, Number 17

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