• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • More on TCP/IP Printing

    August 23, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I’ve been reading your articles on TCP/IP printing and I thought I’d pass on a tidbit of information that my shop recently received from Rochester support.

    One of the nagging issues with TCP/IP printer support has been the lack of Page Range support for IP printers. This means that users cannot select a range of pages to print from their spool files. We have been using a shareware tool called Spool Tool to get around this. Spool Tool copies a range of pages and creates a new spool file, which can then be printed.

     

    It appears that IBM

    …

    Read more
  • Use Monitor to Trap QCMDEXC Errors

    August 23, 2002 Timothy Prickett Morgan

    Hey, Ted:

    How do I find out why QCMDEXC failed when called in an RPG program?

    — John

    Trap the error so your program doesn’t cancel. I like the new monitor and on-error op codes for this:

    D QCmdExc         pr                  extpgm('QCMDEXC') 
    D    Cmd                       256a   const             
    D    CmdLen                     15p 5 const             
                                                            
    D Cmd             s            256                      
                                                            
    D psds           sds                                    
    D   MsgID                40     46                      
    D   Msg                  91    170                      
                                                            
    C                   eval      cmd = 'dsplib br549'      
    C                   monitor                             
    C                   callp     qcmdexc (cmd: %size(cmd)) 
    C                   on-error                            
    C* call to qcmdexc failed -- do whatever 
    C                   endmon                              
    

    If you prefer, you can add an argument of *program

    …

    Read more
  • Odds and Ends

    August 23, 2002 Timothy Prickett Morgan

    Dear Readers:

    Back by popular demand, here are more “Odds and Ends.” I hope you find something of interest.

    — Ted

    Question:

    Is there a command to get the source type of a source physical file member?

    I’ve written an automated source backup/update program, and if I could get the type of source I could then determine which command to issue to create or compile the source.

     

    Answer:

    Try Retrieve Member Description (RTVMBRD). There’s a SRCTYPE parameter that will do the trick.

    DCL  VAR(&LIB)     TYPE(*CHAR) LEN(10)                   
    DCL  VAR(&FILE)    TYPE(*CHAR) LEN(10)                  
    DCL  VAR(&MEMBER)  TYPE(*CHAR) LEN(10)                
    DCL  VAR(&SRCTYPE) TYPE(*CHAR) LEN(10)               
                                                               
    RTVMBRD  
    …

    Read more
  • OPNQRYF Bug

    August 21, 2002 Timothy Prickett Morgan

    Hey, Ted:

    Well I thought that the code below was working for us:

    OVRDBF FILE(file) SHARE(*YES)
    OPNQRYF FILE(file) RCDSLT(fld1 = 'A') 
    RTVMBRD FILE(file) NBRCURRCD(&RECS)
    IF COND(&RECS *GT 0) THEN(DO)
      CALL PGMA
    ENDDO
    

     

    But, I just did some testing and it looks like we’ve been using buggy code as you do need the CPYFRMQRYF to retrieve the correct number of records selected in the query .

    Thanks for the article and for setting me straight.

     

    — Rob

    Sponsored By
    WORKSRIGHT SOFTWARE

    On June 30, 2002,
    $$$$$$$$    Postal Rates went UP!    $$$$$$$$

    On July 1, 2002,
    $$$$$    you wanted your postage

    …

    Read more
  • Debugging Java in Eclipse

    August 21, 2002 Timothy Prickett Morgan

    Hey, David:

    We have been using VisualAge for Java to develop Java applications for over a year. Recently, we decided to make the 1.3 JDK our standard JDK. Unfortunately, VisualAge does not include support for the 1.3 JDK, so it looks like we will need to move to another IDE. We have been looking at Eclipse, but it does not have a built-in team repository and you cannot change an executing program in the debugger. Are there other IDEs that support a team repository and editing during debug?

    — Larry

    You don’t mention which version of Eclipse you tried, but

    …

    Read more
  • Validating a User Password

    August 21, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I have an application in which I would like to use electronic signatures. We are in a federally regulated industry and it is required to have this process password protected. To make things easy on the users I would like to use their normal AS/400 passwords. Is there a method for validating a user ID and password?

    — David

    Take a look at the Check Password (CHKPWD) command. It requires one parameter: the password of the user profile under which it is running. If the password is not correct, CHKPWD sends one of the following escape messages:

    CPF2362   

    …

    Read more
  • Confirm File Deletions in Qshell

    August 16, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I liked the recommendation about creating an alias. However, in the past I have burned myself by creating an alias with the same name as the command. I would get used to the alias version of the command, and when I used the command on a machine without the alias, there was no prompt.

    As a solution, I started defining new alias names that included the option such as rmi for rm -i. It takes a little time to adjust to the new command, but at least you won’t get burned later by expecting a prompt where one

    …

    Read more
  • Calling a Program from a UDF

    August 16, 2002 Timothy Prickett Morgan

    Hey, Howard:

    I have a service program on my AS/400 that I want to call that evaluates data and returns a description. I want to call the program each time a record is read from a physical file when I am doing a select statement. If fact, what I want to do is create a view so that each time the user reads the records, the program is called to return the value of the specific column so that that field in the view is calculated on the fly by the program. I know I can do this in Oracle,

    …

    Read more
  • Creating HTML Subfiles

    August 16, 2002 Timothy Prickett Morgan

    Hey, David:

    I am writing a CGI application that displays a list of purchase orders that need approval in a Web browser. I would like to show the purchase orders in a scrollable area without using HTML frames. In addition, when the user clicks on a purchase order, I want to display the detail lines for the purchase order in the same browser window. I would like to keep the purchase order list on the screen so that the next purchase order can be selected. Can this be done?

    — Mark

    The answer is, “it depends”.

    If you are able

    …

    Read more
  • Using Timestamps as Unique Keys

    August 14, 2002 Timothy Prickett Morgan

    Hey, Ted:

    In response to your article in the July 17 Midrange Guru, OS/400 Edition, the short answer is this: You can’t get there from here.

    I posed this same question to IBM several months back and got some ridiculous suggestion about writing a record to a dummy file with a timestamp in it, then read it back and use the timestamp of that record.  Huh?

    I ended up using the QWCCVTDT API. This API will return the time to milliseconds. This was close enough.

    I was disappointed to discover that there is no way to populate the

    …

    Read more

Previous Articles Next Articles

Content archive

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

Recent Posts

  • POWERUp 2025 –Your Source For IBM i 7.6 Information
  • Maxava Consulting Services Does More Than HA/DR Project Management – A Lot More
  • Guru: Creating An SQL Stored Procedure That Returns A Result Set
  • As I See It: At Any Cost
  • IBM i PTF Guide, Volume 27, Number 19
  • 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

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