Newsletters Subscriptions Forums Media Kit About Us Contact Search Home

mgo
OS/400 Edition
Volume 3, Number 84 -- December 17, 2003

Odds and Ends


Dear Readers:

To end the year 2003, here are some miscellaneous tips. I hope you find something useful. Even more, I hope that 2004 will be the best year ever for all of us.

--Ted


Question:

I am trying to avoid the output from the RUNSQLSTM command. I searched on the Internet and found your issue from October 5, 2001. I execute the RUNSQLSTM from within a CL ILE program. I have created the output queue and put the OVRPRTF before the RUNSQLSTM, but the problem is that RUNSQLSTM outputs to a file whose name is that of the source member. If you look for that file, you find it does not exist, so I think that processing of the command involves some kind of override.

Answer:

You have an override problem, but not because the spool file bears the same name as the SQL source member. Look at the report that is produced when RUNSQLSTM runs and you will see that the system is using printer file QSYSPRT.

The problem is that your program is an ILE program, but program QSYS/QSQCHEM, the command-processing program for the RUNSQLSTM command, is an OPM program. When you mix ILE and OPM programs, you have to account for the differences in activation groups. You did not tell me what activation group your program was compiled to run in, but it's obviously something other than the default activation group.

To fix your problem, you need to make your ILE program issue the type of override that an OPM program would issue. You do this by adding parameter OVRSCOPE(*CALLLVL) to the override in your ILE CL program.

OVRPRTF QSYSPRT OUTQ(QUSRSYS/GARBAGE) OVRSCOPE(*CALLLVL)

Question:

There is a way to force the user to press F3 or F12 to exit PDM. I have seen it done. Can you tell me how?

Answer:

Within PDM, press F18 to display the defaults. Scroll to the second display and change the Exit Lists on Enter option to N.


Question:

What is the trick to reading a source physical file from an RPGLE program? I'm receiving an undefined record type message when I read in the first record.

Answer:

Describe the file internally; that is, use input specs or a data structure. The system won't check the record format name to make sure it matches the file your program was compiled against.

I prefer to use a data structure rather than input specs. The source code begins in position 13 (the first 12 bytes are reserved for the sequence number and date). The following code snippets should help you get started.

Fsrcin     if   f 1024        disk    usropn

D dsin            ds          1024    qualified  
D   srcseq                       6s 0            
D   srcdat                       6s 0            
D   srcdta                    1012a              
                                                 
C                   read      srcin         dsin

Notice that Factor 2 of the READ operation names the data structure into which the data is placed.

For output, you can specify a data structure name in Factor 2 of the UPDATE and WRITE op codes.


Question:

How do I include deleted records when making a copy of a file?

Answer:

Specify FROMRCD(1) and COMPRESS(*NO) in the CPYF command. The FROMRCD parameter forces an arrival sequence copy.

CPYF FROMFILE(A) TOFILE(B) FROMRCD(1) COMPRESS(*NO)

Question:

How do I force someone to key a numeric value into a Qshell script?

Answer:

In V5R2, you can use the declare utility to assign a data type to a variable. The following command declares n to be an integer variable.

declare -i n

If a user enters a value that does not fit the assigned data type, Qshell throws and error and sets the return code ($?) to 1.


Question:

I am trying to test the validity of a date in a free-format RPG specification, but it's not working.

test(de) *usa0 %subst(s2NewOvr:1:8);

The error says, "*RNF5507 30 a 037600 A semi-colon is not specified at the end of a free-format specification." Do you know what's wrong?

Answer:

What you're doing is logical, but is not allowed. The problem is that you've used a built-in function, %subst, in Factor 2. I know it appears that there is no Factor 2 in free-format RPG, but there is: It's a free-format Factor 2. Use EVAL to copy the data into a temporary variable. Test the variable.

TempDate = %subst(s2NewOvr:1:8);
test(de) *usa0 TempDate;

Question:

Why would I ever want to specify a value other than *NOMAX in the MAXPOS parameter of the Create Command (CRTCMD) command?

Answer:

Users will be forced to enter the keywords for parameters past the last one represented by the value in MAXPOS. That gives you the flexibility to insert new parameters in front of existing ones at a later time. A rule of thumb is to put the required parameters at the beginning of the command and make them keyword-optional, but put optional parameters at the end of the command and make them keyword-required. Keep in mind that that is just a rule of thumb.


Question:

I am new to the CODE editor and am having trouble doing things that seem so simple to me in SEU. Is it just me, or is CODE less intuitive? For example, how do you insert a new first line in a source member? If I put the cursor on the first line and press Enter, CODE inserts a new second line.

This brings me to my Christmas wish list. I'd like Santa Claus to bring me a cross reference of SEU and CODE commands.

Answer:

CODE is definitely a different animal. I hesitate to compare it to SEU, since what seems so obvious when using SEU may be nothing more than having used that editor since the 1980s.

Anyway, to answer your question, press the Escape key to move the cursor to the command entry box at the bottom of the screen. Type splitjoin and press Enter. Press Escape to return to the source member. I think a case could be made that this process is less intuitive than its SEU counterpart, but I wouldn’t give up on CODE. I like the Undo feature too much.

By the way, when you get to the LPEX editor, you'll get to learn another set of commands. Instead of splitjoin, you'll type add before.


Sponsored By
GST

AIT Backup for iSeries

GST, Inc.
Phone: 866-478-4621 or 949-900-1090 (for sales x 300)
Web: http://www.gstinc.com
Email: sales@gstinc.com

---------------------------------------------------------------------

SUMMARY

Compact, modular and reliable backup solution at unbeatable prices

· Powerful 3lb drive in small form factor
· LCD module for backup effiency
· Capacity up to 260GB
· Speed up to 112GB/hour
· LVD, HVD, and fibre connectivity
· Starts at $2,000 USD

---------------------------------------------------------------------

THE BIG PICTURE

· A single AIT tape drive in external, modular, stackable enclosure.
· Capacity: AIT-3 100GB native (260 GB compressed).
· Speed: AIT-3 43GB/hour native (112GB/hour compressed).
· Single subsystem is field-upgradeable to dual drive subsystem.
· LCD display panel improves backup efficiency.
· Supports AIT-1, AIT-2 and AIT-3.
· Roadmap to AIT-4, AIT-5, AIT-6.
· AIT range: single drive to enterprise-wide libraries.
· Supports LVD and HVD SCSI connections directly.
· Supports Fibre Channel via our bridges and routers.

The Single AIT Tape Subsystem is part of GST's EntryDR™ family. Single AIT Tape Subsystems are housed in upgradeable modular enclosures. This subsystem delivers high-performance and high reliability at cost-effective pricing to meet basic backup needs for the small to medium range of servers.

Building-block modularity enables the Single AIT Tape Subsystem to be upgraded to GST's Dual AIT Tape Subsystem to strengthen disaster recovery protection. An LCD panel provides an advanced operator interface for visibility over the backup operation.

The Single AIT Tape Subsystem can backup IBM eServer family members: iSeries, pSeries and xSeries servers. They connect natively with LVD (low voltage differential) and HVD (high voltage differential) SCSI connections, and with Fibre Channel (FC) through our BridgeLink™ family of bridges and SanMatrix™ family of routers. Model overview.

GST's Single AIT Tape Subsystem is available in a variety of models. Each AIT technology (AIT-1, AIT-2, AIT-3) is available in two server-to-SCSI Adapter interfaces:

LOW VOLTAGE DIFFERENTIAL (LVD). Connectivity with eServer family. iSeries uses IBM SCSI Adapter feature code: FC 5702, 5705. pSeries and xSeries servers use a variety of LVD SCSI adapters.

HIGH VOLTAGE DIFFERENTIAL (HVD). Connectivity with eServer family. iSeries uses IBM SCSI Adapter feature code: FC 2729, 2749, 6501, 6534. pSeries and xSeries servers use a variety of HVD SCSI adapters.

AIT TECHNOLOGY

AIT tape technology has evolved through three generations: AIT-1, AIT-2 and AIT-3 and provides outstanding capacity and performance with a highly stable technology roadmap. AIT cartridges utilize Memory-in-Cassette (MIC) architecture providing rapid time-to-data and multiple load points for partitioning data.

Native cartridge capacities for AIT-1, AIT-2 and AIT-3 are 35GB, 50GB and 100GB (91GB, 130GB, 260GB compressed) with speeds of 14GB/hour, 22GB/hour and 43GB/hour (37GB/hour, 56GB/hour and 112GB/hour compressed). Scalability is planned to a 6th generation product with native capacity of 800GB (2TB compressed) and a speed of 345GB/hour (900GB/hour compressed). A 2-to-1 compression ratio is achieved with Adaptive Lossless Data Compression (ALDC) technology.

KEY BENEFITS

DUAL DRIVE UPGRADE - A second modular drive and controller can be added later to upgrade to a Dual AIT Tape Subsystem as backup needs evolve that require DR protection, fault tolerant backup or greater unattended backup capacity.

HARDWARE INVESTMENT PROTECTION - The modular design of the Single AIT Tape Subsystem protects user investment by permitting the original single drive unit to be retained unmodified as part of the upgraded Dual AIT Tape Subsystem.

SPACE SAVER - The small dimensions and weight of the modular configurations facilitate the optimum use of datacenter space.

MEDIA INVESTMENT PROTECTION - For IT sites with an investment in AIT-1 media and drives, the newer AIT-2 and AIT-3 technologies are backward-read compatible, and forward-read compatible to future generations.

SERVICEABILITY - Modularity of design permits individual drives to be easily replaced in building-block fashion by the user.

KEY FEATURES

STACKABLE ENCLOSURES - Individual modular enclosures enable each drive and the mirrored backup controller to be handled as separate building blocks; facilitates field upgrade from single to dual drives.

LCD DISPLAY PANEL - Multi-function LCD continuously displays drive and backup status.

CONVENIENT DRIVE INTERFACE - RS232 interface for updating firmware and optimizing drive performance.

SERVICE AND SUPPORT - A variety of support programs provide installation and onsite service; includes GST's Accelerated Ship Program (GASP) to get replacement units on the scene rapidly.

WARRANTY - Purchase price includes a built-in manufacturer's warranty of three years.

GST, Inc.
Phone: 866-478-4621 or 949-900-1090 (for sales x 300)
Web: http://www.gstinc.com
Email: sales@gstinc.com



Editors: Howard Arner, Joe Hertvik, Ted Holt, David Morris,
Managing Editor: Shannon Pastore
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.


THIS ISSUE
SPONSORED BY:

Advanced Systems Concepts
GST


BACK ISSUES

TABLE OF
CONTENTS

Returning Result Sets and Parameters Using ADO

Odds and Ends

Reader Feedback and Insights: Thanks for DST Password Tip



Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.