04
Mon, Nov
5 New Articles

TechTalk October 1998

General
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

QEZDATVL and Security Level 40

If you use program QSYS/QEZDATVL to convert, edit, and verify dates, you shouldn’t. This program will not run under security level 40 because it resides in the system domain. If you move to security level 40, as IBM recommends, your programs will fail when they call QEZDATVL.

One alternative is to write a CL program to replace it, as in Figure 1. — Bruce Vining
IBM Rochester

What Causes a “Receiver Too Small” Error?

Q: No matter how large I define result, the RPG IV code in Figure 2 produces error MCH1210 (“Receiver value too small to hold result”), followed by RNQ0103 (“The target for a numeric operation is too small to hold the result”). However, if I replace the eval with a mult operation, as in Figure 3, it works fine. What gives?

— Dale Monti This email address is being protected from spambots. You need JavaScript enabled to view it.

A: Both operands are integers, so the result of a * b is put into a temporary integervariable. Since 2255288 * 1024 doesn’t fit in an integer, an overflow error occurs on the assignment to the temporary variable.

You can avoid the error by forcing the compiler to use a temporary packed decimal variable. Figure 4 shows a couple of ways. The first introduces a packed value (0.0) into the expression, so a packed temp must be used. The second uses the %dec built-in function (available with V3R7 and above) to explicitly “declare” a packed temporary.

— Barbara Morris IBM Toronto RPG Compiler Development

Looking for AS/400 Information Offline?

If you’re looking for a replacement for your old hardcopy programming manuals, try visiting the IBM AS/400 Online Library at

http://as400bKS.rochester.ibm.com:80/bookmgr/home.htm (shown in Figure 5). This is a fairly complete site that contains online IBM Redbooks as well as HTML manuals for the last CISC-based AS/400 (V3R2) and for all RISC-based AS/400s (V3R6, V3R7, V4R1, and V4R2).

IBM has converted many V4R1 and V4R2 manuals to the PDF file format, which can be read with the Adobe Acrobat Reader. This format allows you to download current manuals to view them offline or load them onto your network for shared viewing by your staff. With PDF files, you can view and print manual pages without dialing in to the Internet. You can even load a manual onto a laptop for catching up on technical reading when you can’t sign on to the Internet.

You can download a free copy of the Acrobat Reader from the Adobe Web site: http://www.adobe.com/prodindex/acrobat/readstep.html.

— Joe Hertvik Editor, Client Access/400 Expert This email address is being protected from spambots. You need JavaScript enabled to view it.

Change the Name of Your PC5250 Session in the Windows 95/NT Taskbar

Q: How can I change the name of a PC5250 Client Access/400 for Windows 95/NT session in the Windows taskbar so that it comes up with something more descriptive for my users than “Session A - [24x80]”?

— Anonymous

A: Inside your PC5250 session, click on the Appearance option from the PC5250 menu. On the drop-down menu that appears, click on Window Setup to bring up the Window Setup screen shown in Figure 6. In the Windows Title area, there are a number of options for changing the window title of your session. To remove the “Session A” literal from your title, remove the checkmark from the Long Session-ID check box. To remove the “[24x80]” window size literal, turn off the checkmark in the Sessions Dimensions check box.

To type in your own text so that something more descriptive comes up in your window title, click the Session Name check box so that it contains a check mark. Then, in the adjoining text box, type in any character string (16 characters or fewer) that you want to appear. When you click on OK to return to your PC5250 session, this new title will appear in the following places on your PC:

• The window title of your PC5250 session
• The taskbar button for your program on the Windows 95/NT taskbar
• The icon description that appears when you use the Alt-Tab key combination to choose a program to transfer to

There are other options as well, but these settings will solve your problem and make your sessions more descriptive for your users.

— Joe Hertvik Editor, Client Access/400 Expert This email address is being protected from spambots. You need JavaScript enabled to view it.

Using the Web to Find the Latest PTF

Want a quick way to find out if your AS/400 has the most current PTFs? Here’s

how.

From an AS/400 command line, type in the Display PTF (DSPPTF) command as shown here and press Enter.

DSPPTF LICPGM(*ALL) SELECT(*ALL)

You’ll be presented with a screen showing all PTFs on your system. Now, get on the Internet, and point your browser to http://as400service. rochester.ibm.com/as4sde/sline003.nsf/sline003home. You’ll find yourself on IBM’s AS/400 Preventive Service Planning Information Web page. From here, you can display the Preventive Service Planning (PSP) documents for the release of the operating system you are on. IBM uses PSPs to let you, the AS/400 operator and user, know what PTFs are currently available.

This site will also inform you of any last-minute changes or modifications that might affect system upgrades. In fact, in the Power PC Upgrade Roadmap, which is used as the checklist for doing a CISC-to-RISC migration, you are strongly encouraged to check this Web site before starting the upgrade because this information is the most up-to-date information available regarding AS/400 changes and fixes.

If you find you need to download a PTF, use the Send PTF Order (SNDPTFORD) command from your AS/400 to download or order that PTF.

— Shannon O’Donnell Midrange Computing Associate Editor This email address is being protected from spambots. You need JavaScript enabled to view it.

Transferring AS/400 Save Files with FTP

AS/400 save files are the PKZIP of the midrange. I transfer them all the time using FTP. I can quickly transfer a save file from one AS/400 to another, or I can download a save file to my PC and send it to whomever as an email include.

The process is simple, and, if you are comfortable with FTP, I can summarize it in one word: BINARY. The AS/400’s implementation of FTP assumes, unless told otherwise, that file transfers are for text files and, as such, will require EBCDIC-to-ASCII translation. Just think what that’ll do to your save file! The binary FTP directive says “don’t do that” to the AS/400.

In a nutshell, then, here’s how to FTP a save file from an AS/400 to a PC and from an AS/400 to another AS/400.

Downloading an AS/400 Save File to Your PC
1. Start FTP on your PC (FTP.EXE).
2. Type in the Open command, and FTP will prompt you for the TCP/IP address or Host Name of the AS/400 system from which you are transferring files. It will also prompt you for the user profile name and password to use when logging on to your AS/400. Enter the appropriate information.

3. Enter the BINARY directive (or the abbreviation, BIN).
4. Get your save file to the PC with the GET Library/ SaveFileName PCFileName command. For instance, to download a save file called SAVESTUFF in my DENONCOURT library to the C:workmcseptember directory on my PC, I entered the following command:

get DENONCOURT/SAVESTUFF c:workmcseptemberSaveStuff.sav

Uploading a PC File That Contains an AS/400 Save File to an AS/400
1. Create or clear the AS/400 save file that is to be uploaded. If the save file does not already exist, FTP will create a file for you, and it will not be of type *SAVF:

CRTSAVF DENONCOURT/RESTORSTUF

or

CLRSAVF DENONCOURT/RESTORSTUF

2. Start FTP on your PC (FTP.EXE).
3. Type in the Open command, and FTP will prompt you for the necessary login information, including TCP/IP address or Host Name of the AS/400 system, user profile name, and password.

4. Enter the BINARY directive (or the abbreviation, BIN).
5. Transfer the file from your PC to the AS/400 with FTP’s put command:

put c:workmcseptemberSaveStuff.sav DENONCOURT/RESTORSTUF

Transferring an AS/400 Save File Between AS/400s
1. Start FTP:

STRTCPFTP RMTSYS(Other400DomainName)

2. Enter your user profile and password.
3. Create or clear the AS/400 save file that is to be uploaded. If the save file does not already exist, FTP will create a file for you, and it will not be of type *SAVF:

CRTSAVF DENONCOURT/RESTORSTUF

or

CLRSAVF DENONCOURT/RESTORSTUF

4. Enter the BINARY directive (or the abbreviation, BIN).
5. Transfer the file from the local or current AS/400 to the host AS/400 with FTP’s put command:

put DENONCOURT/RESTORSTUF HOSTLIB/RESTORSTUF Optionally, you could transfer the file from the host AS/400 to the current or local AS/400 with FTP’s get command:

get HOSTLIB/RESTORSTUF DENONCOURT/RESTORSTUF (REPLACE

For the get command only, you need to use the (Replace parameter to clear out the save file on your AS/400 (the put command clears out the save file for you). Note that there is no closing parenthesis on this parameter.

One warning: Take care when transferring a save file from one AS/400 to another, or you might overlay an important save file. It’s easy to get confused if the library and file names are the same. FTP is so easy to use that you can easily update the new version of a library with an old version—effectively wiping out all of your updates. Just remember that the TCP/IP address that FTP uses is considered the host site. The FTP get command copies the file from the host to the local machine, the one from which you entered the Start TCP/IP FTP (STRTCPFTP) command. The FTP put command copies the file from the local machine to the host machine.

— Don Denoncourt Editor, AS/400 NetJava Expert This email address is being protected from spambots. You need JavaScript enabled to view it.

Who Took My Tools?

Q: What happened to the Edit File (EDTF), Display Stream File (DSPSTMF), and
SQL Utility (SQLUTIL) commands that shipped with PTF SF38832 on V3R7? We have two new
AS/400s running V4R2 and cannot find these commands on the machine. We can’t even find
a PTF to install them.

— David Blair

A: The source for those tools continues to be in QUSRTOOL, an optionally installed library of OS/400. The object code is in PTFs SF41518 (V4R1) and SF45296 (V4R2).

— Bruce Vining IBM Rochester

Send Messages to Groups of Users

Option 3 of OfficeVision/400’s main menu lets you send a message to a distribution group. If you don’t have OV/400, or if you need to send messages to groups from CL programs, you might want to use the Send Group Message (SNDGRPMSG) utility. This utility consists of two objects: command SNDGRPMSG and OPM CL program GRP005CL. Source code for the two is shown in Figures 7 and 8 respectively.

First, you must set up a way to define groups of users. SNDGRPMSG uses members of a source physical file called MSGGROUPS. Each member is a group, and each record in a member contains a user profile name. To create the MSGGROUPS file, see the compilation instructions for program GRP005CL. Notice that the record length is 22 bytes, which allows for the fields SRCDAT (length 6), SRCSEQ (length 6), and SRCDTA (length 10). User IDs are stored in the SRCDTA field. Use PDM or SEU to maintain the source members.

I have found this command very useful. For instance, I include it in month-end programs to let all users in a certain department know when month-end is running.

— Dan Wilson Sierra Pacific Industries This email address is being protected from spambots. You need JavaScript enabled to view it.

Editor’s note: What a great idea! If you have the TAATOOL library installed on your system, you also might want to take a look at the SNDGRPPRF (Send Group Profile Message) command.

SQL’s UNION Merges Data

Q: I need to write an SQL query that retrieves customer address information. These addresses are fields CADD1 and CADD2 in the customer master file. However, if the alternate address flag, ALTADD, has a value of Y, I want to retrieve fields AADD1 and AADD2 from the alternate address file instead. Can that be done?

A: You need to use SQL’s UNION operator. UNION combines the results of two queries into one resulting set of data. See the example in Figure 9.

— Bill Robins This email address is being protected from spambots. You need JavaScript enabled to view it.

Get the Messages You Need

When users tell me they have submitted a job that is hung up in the job queue, the first thing I do is look at the message that the job sent to QSYSOPR to determine the facts of the matter. QSYSOPR usually has a lot of messages, and I want to quickly weed through the informational messages to get to the ones that need replies (the inquiry messages). To get to those messages, I key the following command:

DSPMSG QSYSOPR MSGTYPE(*INQ)

All inquiry messages will be displayed, whether they have been answered or not. I often use this display as my starting point for finding and fixing problems. To further filter out the routine messages, I sometimes indicate a minimum severity level:

DSPMSG QSYSOPR MSGTYPE(*INQ) SEV(70)

All inquiry messages with a severity level of 70 or above will be displayed. From there, I can easily find the message that was sent by my user’s job.

— Lisa Patteson CMI Industries, Inc. efa002/efa/lzpattes%This email address is being protected from spambots. You need JavaScript enabled to view it.

Editor’s note: This is a good way to quickly find a message needing a reply, especially if you don’t know the name of the user profile under which the job is running, or the name of the subsystem in which it is running. Other good commands for locating unanswered batch job messages are Work with User Jobs (WRKUSRJOB) and Work with Subsystem Jobs (WRKSBSJOB).

PGM PARM(&DATEIN &DATEOUT)

DCL VAR(&DATEIN) TYPE(*CHAR) LEN(6)

DCL VAR(&DATEOUT) TYPE(*CHAR) LEN(8)

DCL VAR(&MSGID) TYPE(*CHAR) LEN(7)

DCL VAR(&MSGF) TYPE(*CHAR) LEN(10) VALUE(‘QCPFMSG’)

DCL VAR(&MSGFLIB) TYPE(*CHAR) LEN(10) VALUE(‘*LIBL’)

DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(256)

MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ERROR_MSG))

QSYS/CVTDAT DATE(&DATEIN) TOVAR(&DATEOUT) FROMFMT(*JOB) +

TOFMT(*JOB) TOSEP(*JOB)

RETURN

ERROR_MSG:

QSYS/RCVMSG MSGTYPE(*EXCP) MSGDTA(&MSGDTA) MSGID(&MSGID) +

MSGF(&MSGF) SNDMSGFLIB(&MSGFLIB)

MONMSG MSGID(CPF0000)

QSYS/SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) +

MSGDTA(&MSGDTA)

MONMSG MSGID(CPF0000)

ENDPGM

Figure 1: CL code that mimics QEZDATVL

D a s 10I 0 inz(2255288)

D b s 10I 0 inz(1024)

D result s 17S 0 inz(0)

C eval result = a * b

Figure 2: Using eval produces MCH1210 and RNQ0103 errors

C a mult b result

Figure 3: Using mult does not produce an error

C eval result = (a + 0.0) * b

C eval result = %dec(a * b)

Figure 4: Two ways to force a temporary packed decimal variable




Figure 5: View AS/400 manuals at the AS/400 Online Library Web site



Tech_Talk307-00.png 900x675
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: