Guild Companies, Inc.  
 
Midrange Guru - Tech Tips
OS/400 Edition
Volume 2, Number 38 - May 17, 2002

Odds and Ends

Hey, Ted:

Question:

In the April 24, 2002, issue of the Midrange Guru , you said, "I rarely sign on to two sessions because I use group jobs." What are group jobs? I'm a multi-session-addict, and I was surprised to see that you rarely sign on to two sessions. Perhaps I'm misunderstanding something. I usually open two, three, or more Rumba windows, and in my understanding, that means that I'm working with two, three, or more 'sessions.' Perhaps I am using the term session incorrectly? How can you use group jobs instead of multiple sessions?

Answer:

Group jobs let you have 16 sessions under one sign-on. Each one has its own QTEMP library and its own library list, for example. You can only see one session at a time, however. You can't show two sessions side by side on the display at once.

Here's how I use group jobs.

First, I put the following CL commands in my initial program:

DCL        VAR(&GRPJOBNAME) TYPE(*CHAR) LEN(10)

RTVGRPA    GRPJOB(&GRPJOBNAME)     
 IF (&GRPJOBNAME *EQ *NONE) THEN(DO)
      CHGGRPA    GRPJOB(MAIN)       
 ENDDO                              

Next, I create the following attention-key program:

   PGM                                         
                                               
   MONMSG     MSGID(CPF0000) EXEC(GOTO ENDPGM) 
                                               
   TFRGRPJOB  GRPJOB(*SELECT)                  
                                               
ENDPGM:                                        
   ENDPGM                                      

Third, I assign the program I just created to the attention key in my user profile using the Change Profile (CHGPRF) command or Change User Profile (CHGUSRPRF) command:

CHGPRF ATNPGM(MYATNPGM)

Sign off and on to make the necessary changes take effect.

To start a new group job, press the Attention key. The system responds with the Transfer to Group Job panel. Press F6 to start a new group job. In the Group job prompt, fill in a meaningful name for the group job. In the Initial group program blank, type QCMD. I usually leave the Special environment attribute as *DFT, but sometimes I type *S36 for a S/36 environment job.

Once you have other group jobs running, you will be able to choose from them using option 1 on the Transfer to Group Job panel.

There are other ways to use group jobs, but this works well for programmers.



Question:

When I use option 14 within PDM to submit a compile to batch, the system sends two messages to my interactive job--PDM0018 (The compile of member SBMJOBX1C was submitted to batch.), followed by CPC1221 (Job 308270/JSMITH/MYPGM submitted to job queue MYJOBQ in library MYLIB). The second of these interests me. I would like my programs to send such a message, displaying job queue information, when they run the Submit Job (SBMJOB) command. Is this possible?

Answer:

Yes. Receive the message and send it to the *PRV message queue. Here's an example:

DCL        VAR(&MSGID) TYPE(*CHAR) LEN(7)           
DCL        VAR(&MSGDTA) TYPE(*CHAR) LEN(256)        
DCL        VAR(&MSGF) TYPE(*CHAR) LEN(10)           
DCL        VAR(&MSGFLIB) TYPE(*CHAR) LEN(10)        
                                                       
SBMJOB     CMD(whatever) JOB(whatever) 
RCVMSG     MSGTYPE(*LAST) RMV(*NO) MSGDTA(&MSGDTA) +
                MSGID(&MSGID) MSGF(&MSGF) +            
                SNDMSGFLIB(&MSGFLIB)                   
SNDPGMMSG  MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) +       
                MSGDTA(&MSGDTA) TOPGMQ(*PRV) 



Question:

I am working on a project that requires me to specify TGTRLS(*PRV) and DBGVIEW(*SOURCE) every time I compile a CL or RPG source member. First I would prompt options 14 and 15 of the Work with Members using PDM (WRKMBRPDM) command display and fill in the blanks. That got old quickly. It's not possible for me to change the defaults for the CRTxxxPGM and CRTxxxMOD commands. Do you know of any way for me to avoid keying these options every time I compile?

Answer:

On the command line at the bottom of the WRKMBRPDM screen, type dbgview(*source) tgtrls(*prv) and press the Enter key. OS/400 responds with the message CPD0033 (String beginning 'DBGVIEW ' not valid command name). This places the compile options into the log of previous commands and allows you to retrieve the options by pressing the F9 key. When you need to compile a source member, type the option 14 or 15 and press F9 until the compilation options appear on the command line.



Question:

I need to connect from one of our AS/400s to one of our NT Servers to update a table. Is there a way to do this with Java? Please help or direct me where to find information on how to do it.

Answer:

T'is a simple thing! Get a Pure Java JDBC driver for the NT database and write a JDBC application.



Question:

Is there a quick way to throw together a one-shot data entry subfile program?

Answer:

You can build subfile-type data-entry programs with DFU. I don't recommend them for production applications, but they're acceptable for one-time jobs.

Start DFU by typing STRDFU and pressing Enter. Choose option 2 to create a DFU Program.

I won't go through the process screen-by-screen. I'll just point out the two places where you must fill in certain values in order to get a subfile application.

  • On the Define General Information display, choose option 4 (Row oriented) for Display Format.
  • When you get to the Work with Record Formats display, use option 2 to select the appropriate record format and enter Y under Multiple Records.

DFU also lets you specify autoincrement, autoduplicate, and accumulation. To get those features, select option 2 (Specify extended definition) on the Work with Fields display.

DFU is not pretty, but it works and it certainly beats writing a program that will only be used once.

I've mentioned DFU because it's available on most OS/400 machines. Another alternative is to use the free WRKDBF program, which is available for download from www.wrkdbf.com . This program generates work-with screens for database files.

You can also buy programs that generate work-with programs.

Sponsored By
TRAMENCO

Learn what's over the horizon for the iSeries and AS/400, and how it will impact your career, by attending the premier training event of 2002. It's the iSeries and AS/400 Connection Conference June 16 – 19, 2002 in Naples Florida. Join 19 of the industries greatest minds including Dr. Frank Soltis, Skip Marchesani, Wayne O. Evans, Susan Gantner, Jon Paris, Marie Finnegan-Cronin, and Howard Arner, Jr. as they deliver AS/400 training and education to prepare you for the challenges of tomorrow. A full agenda of 96 sessions (including 10 hands-on labs) provide practical instruction in a full range of topics, including:

  • Understanding Websphere Development Studio

  • Accessing DB2/400 data from Linux

  • Learning how JavaBeans are used

  • Make the most of RPG IV's built in functions

  • SQL Tricks and Techniques

  • ABCs of System Management

  • And much more!
Whether you are an old pro, or just getting your feet wet, there is something for everyone during this intensive four-day conference. Best of all, your classroom is the Registry Resort and Spa, Naples Florida's premier 5-star resort. To register, or for more information, call 1 800 897.5923, or go to the web at www.tramenco.com. But hurry, you must register before May 15, 2002 to save $200 off the standard registration and be eligible for special hotel rates.
THIS ISSUE
SPONSORED BY:
Advanced Systems Concepts (ASC)
TRAMENCO
BACK ISSUES
TABLE OF CONTENTS
Avoiding Split of a File Name Containing Blanks
Odds and Ends
Reader Feedback and Insights: OV/400 Data Text Merge
  Newsletters | Subscribe | Advertise | About Us | Contact | Search | Home  
  Last Updated: 5/17/02
Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.