19
Fri, Apr
5 New Articles

TOP TIPS: Connectivity September 1998

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

 

Allow for Plenty of Users in Prestart Jobs

 

AS/400 ODBC and Java Database Connectivity (JDBC) toolbox users can encounter slow database connect times. Often, this is because of the low number of default prestart job entries for the QZDASOINIT (TCP/IP) and QZDAINIT (SNA) jobs. When the initial number of prestart active jobs reaches a threshold, additional jobs are started, but the ODBC user who trips the threshold pays the response time price of waiting for the additional number of jobs to start.

To avoid this, set the initial number of prestart jobs to a higher number (such as some number greater than the number of users), and then restart the prestart jobs as in Figure 1.

— Lance A. Amundsen IBM Rochester

 

Enable the Ruler Function of Client Access

 

The Client Access/400 for Windows 95/NT client’s PC5250 emulation program comes with a ruler function that provides horizontal and vertical guide lines to help you align columns in RPG. You can also use the ruler to select records. The problem with this feature is that it’s annoying to keep the ruler visible all the time when you need it only for certain functions. However, an easy fix will allow you to toggle the ruler on and off during your emulation session. Here’s the procedure:

1. Pull down the Assist menu in a session.
2. Choose Keyboard Setup... from the dropdown menu.
3. Click the Customize button on the Keyboard Setup window.
4. On the Customize Keyboard Setup window, click on the picture of the F12 key.
5. On the lower right corner of the Customize Keyboard Setup screen, you will now see a box labeled Change Current Actions for Selected Key. In that box, find the line labeled Alt. To the right of that line is a box that says [dead]. Click on that box, and replace [dead] with [rule].

6. Click on the Change Key button.

Editor’s note: In the PC5250 emulator that comes with the new Client Access V3R2 client, there is no Change Key button. Changes are posted to the key and file when

you save the keyboard file in the next step.

7. Pull down the File menu and choose Exit. When asked if you want to save changes, choose the Yes button. The system will ask you to provide a name for the keyboard map. Enter a name of your choice.

8. You will be returned to the Keyboard Setup window. Change Current Keyboard to User-defined and fill in the name of the keyboard map you just saved.

9. Press the OK button on the Keyboard Setup window. Ta-da! Pressing Alt-F12 will toggle the ruler line on your PC5250 screen on and off.

— Drew Dekreon, CCP This email address is being protected from spambots. You need JavaScript enabled to view it. Anchorage, Alaska

 

Put Client Access Macros to Work for You

 

The PC5250 emulator that comes with the Client Access/400 for Windows 95/NT client has the ability to record and play macros. Macros can be created with limited prompting by using the Assist menu in PC5250, or they can be created manually by using the Windows Notepad program. PC5250 requires you to save macros to the program files ibmclient accessemulatorprivate folder, and they must be saved with the .MAC file type.

The macro script shown in Figure 2 can be run inside the SEU while you are working on an RPG or RPGLE program. It excludes the C-specs within subroutines, resulting in a cleaner display when doing maintenance on a complex program. To run a macro, click on Assist from the PC5250 menu bar and select Keyboard/macro function from the dropdown menu.

— Drew Dekreon, CCP This email address is being protected from spambots. You need JavaScript enabled to view it. Anchorage, Alaska

 

PC Downloads Made Easy with FTP

 

I often have reason to download AS/400 source physical file members to my PC. And just as often, I need to upload a PC file to the AS/400. Maybe I want to put the text from a lengthy AS/400 source member in a word document, or maybe I want to use a PC editor to write the source for what will become an AS/400 program. I performed these tasks years ago with the source for C programs, and now I’m doing them with Java source. At any rate, here is my streamlined process to use FTP for upload or download of source members:

1. From a DOS window on your PC, execute FTP.EXE with the TCP/IP address of your AS/400; a DOS window will come up requesting your user profile name and password.

2. Enter your user profile name and password.
3. Change your current directory to be the library where your source member resides; for example, to set the current directory to my personal AS/400 library, I’d enter the following:

cd DENONCOURT

4. Change your local directory to be the PC directory that you are copying your source member to; for example, to set the local directory to my working PC directory for MC’s September issue, I would enter the following:

lcd C:WorkMCSeptember

5. To copy an AS/400 source file member to your PC, use FTP’s GET command. For example, to copy the source member called CUSTMAINT from the QRPGLESRC source file in FTP’s current directory (DENONCOURT) to a file in my local PC directory called CustMaint.rpg, I used the following:

get QRPGLESRC.CUSTMAINT CustMaint.rpg

This command uses the current directory for the library qualifier of the source file and the local directory for the PC to copy the source member to.

get DENONCOURT/QRPGLESRC.CUSTMAINT

C:WorkMCSeptemberCustMaint.rpg This code fully qualifies the location of the library, file, and member to copy and the location of the PC directory and file name to copy it to.

6. To copy a PC text file to an AS/400 source file member, use FTP’s PUT command. For example, to copy a file from my local PC directory called CustMaint.rpg to a source member called CUSTMAINT from the QRPGLESRC source file in FTP’s current directory (DENONCOURT), I used the following:

put CustMaint.rpg QRPGLESRC.CUSTMAINT

For a complete listing of the FTP command set, type help (in lowercase). For a detailed description of one of the FTP commands, type help followed by the command name help get. Note that OS/400’s FTP help is superior to the PC’s FTP help.

— Don Denoncourt Editor AS/400 NetJava Expert

 

Multiprotocol Network Tips

 

If you’re using a multiprotocol network, maybe these tips will help.
• For standard SDLC networks, use a block size of 512 or 1024 bytes for best throughput on clean digital lines. When SNA runs through Internet Protocol (IP) routers, smaller block sizes are preferable because of the buffers in the routers.

• As with standard SDLC networks, window sizes should be set to six or seven on clean digital lines. It really cuts the acknowledgement overhead.

• If you put the AS/400 on the LAN and let the IP routers control the link, remember that a serially attached controller at remote sites is still an SDLC device. You must have the remote router poll the controller and convert the SDLC to LLC2 (data link switching) so that the AS/400 can communicate with the remote devices.

• When you attach an SDLC controller to a serial port on an IP router, you must use a crossover cable. Both ports are data terminal equipment (DTE); i.e., they both expect to receive clocking.

• OS/400 has an implementation that allows you to run SNA over IP “natively”: It is called Anynet. IBM hasn’t pushed it, but it really helps avoid bottlenecks where you are most vulnerable—the IP routers.

— M. Michael Drummer MCI Communications This email address is being protected from spambots. You need JavaScript enabled to view it.

 

Start Host Servers at IPL

 

In order to sign on to an AS/400 through TCP/IP, you must start the IP Host servers. Otherwise, you will get the dreaded “Communications error occurred while validating security information” message.

To avoid this problem, add the code in Figure 3 to the bottom of your startup program (the one referred to in the QSTRUP system value).

This is a small gotcha that had me stumped for days! — Jeff Ford
AS/400 Client Server Specialist Canadian Tire Acceptance Limited

 

FTP Files Directly to AS/400 Folders

 

Q: Is it possible to FTP a file from an NT workstation directly to an AS/400 folder ?

A: The answer to your question is yes and—according to IBM’s AS/400 manuals—you should be able to FTP to a number of different directories in the AS/400 Integrated File System (FTS) directory structure. I looked in the online OS/400 TCP/IP Configuration and Reference V4R2 manual (http://AS400BKS. rochester.ibm.com:80/cgibin/bookmgr/Book Mgr.cmd/BOOKS/QB3anl01/CCONTENTS) and found that OS/400 supports FTP for the following AS/400 file systems (this information is quoted from chapter nine of the manual):

• QSYS.LIB Library file system—libraries, files, members FTP supports the transfer of save files and members in physical files, logical files, DDM files, and source physical files.

• QDLS Document library services—folders and documents The QDLS file system is registered with the hierarchical file system (HFS) on an AS/400 system.

FTP transfers files that reside in registered HFS file systems that are accessed using the HFS APIs. In addition to the QDLS file system, HFS file systems include:

• QOPT optical file system See “Transferring HFS Files” in topic 9.12.54.4 and “Transferring QDLS Documents” in topic 9.12.54.5 for additional information. For further information about HFS APIs, see the System API Reference book.

• “root’’ The / file system. This file system is designed to take full advantage of the stream file support and hierarchical directory structure of the integrated file system. It has the characteristics of the DOS and OS/2 file systems.

• QOpenSys The open systems file system. This file system is designed to be compatible with UNIX-based open system standards, such as POSIX** and XPG. Like the root file system, it takes advantage of the stream file and directory support provided by the integrated file system. It supports case-sensitive names.

• QLANSrv The LAN Server file system. This file system provides access to the same directories and files that are accessed through the LAN Server licensed program. It allows users of the OS/400 file server and AS/400 applications to use the same data as LAN Server clients.

• QFileSvr.400

The OS/400 file server file system. This file system provides access to other file systems that reside on remote AS/400 systems. Access to QSYS.LIB, QDLS, and QOPT using QFileSvr.400 is not supported by FTP.

There are also some tricks with FTPing to an AS/400 regarding whether you want to FTP to the OS/400 file system (QSYS.LIB) or to other directories on the AS/400 IFS system. That manual will answer most of your questions about how to configure your AS/400 as an FTP server, the configuration settings that need to be set, and the syntax for transferring files up and down. In particular, you’ll want to read over the parts that discuss the FTP server NAMEFMT parameter because that will affect the FTP file syntax.

If you’re not on V4R2 and want to read the TCP/IP manual for your particular operating system, you can go to the AS/400 Online Library for all versions (http://as400bks. rochester.ibm.com/bookmgr/home.htm) and look up the TCP/IP manual for your particular OS version. It’s a great online reference that has all the OS/400 manuals as well as the Redbooks. In addition, if you’re running a slow modem connection or want to bypass the online manual, you can download the RISC machine manuals as Portable Data Format (PDF) files and use Adobe Acrobat to read them.

— Joe Hertvik Editor Client Access/400 Expert

 

Assigning a Unique Workstation ID to a TCP/IP PC5250 Session

 

Until now, running a PC5250 session over TCP/IP has been problematic because you were unable to specify a static and unique work-station ID for your display session. This was because AS/400 TCP/IP uses a dynamic device name assignment algorithm that automatically assigns any one of a number of virtual devices (beginning with the literal ‘QPADEV’) to your PC5250 session. Dynamic assignment causes problems for application programmers and AS/400 administrators because there is no easy way to identify that a specific device belongs to a specific user or location. This hampers application development and system troubleshooting.

With the V3R1M3 release of Client Access for Windows 95/NT, this problem has been solved. On the Configure PC5250 screen (see Figure 4), you can now specify a unique workstation ID name for your TCP/IP sessions. When you enter a workstation ID, OS/400 bypasses dynamic device name assignment and creates a new device with that name for your PC5250 TCP/IP session to use. This new feature can be used for both PC5250 display and printer sessions. This field is optional, and—if you leave it blank—OS/400 will return to using dynamic assignment for your sessions.

PC5250 TCP/IP Workstation ID assignment is available only in Client Access for Windows 95/NT V3R1M3 running Service Pack SF46891 and above. According to IBM, it is compatible only with OS/400 V3R2, V3R7, V4R1, V4R2, and above with the appropriate PTFs installed. For a list of AS/400 PTFs that need to be installed and other considerations in using this feature, consult APAR II10918 from the Client Access Web page at http://AS400. rochester.ibm.com/clientaccess.

— Joe Hertvik Editor Client Access/400 Expert

 

Using WINIPCFG to Find Your PC’s IP Address

 

Want a quick way to tell what your PC’s IP address is? Windows 95/NT provides a command, WINIPCFG, that will display information about your IP configuration. To run this command, first connect to your IP host. Then, click on the Windows 95/NT Start button, and click RUN. Type in WINIPCFG and click OK. You’ll see information such as your IP address, subnet mask, and connection type. For more detailed information, click on the More Info> button.

— Shannon O’Donnell Technical Editor Midrange Computing

 

How to Run PC Commands from Your AS/400

 

To run a PC command from an AS/400, users can use either Start PC Command (STRPCCMD) or Run Remote Command (RUNRMTCMD). The connection type will, in general, determine which command to use. If the PC is connected to the AS/400 through a router (such as NS/Router from NetManage), STRPCCMD is the command to use. If the PC is connected through TCP/IP, RUNRMTCMD is the right choice. Each command has its own unique requirements that must be met before users can successfully use it.

To use STRPCCMD (Figure 5), users must be enrolled in the AS/400 system directory. You can enroll them by using the Work with Directory Entries (WRKDIRE) command.

Before users attempt to use STRPCCMD, you need to ensure, by either of two methods, that the Start PC Organizer (STRPCO) command has been run once.

The first method is to add the STRPCO command to the user’s initial program so it executes at sign-on. Unfortunately, if the user’s PC is connected through TCP/IP instead of a router, the command will end abnormally with the message “PCO must be run from a programmable workstation.”

The second method is to add a macro to the user’s Client Access/400 session on the PC connected by a router. To use this approach, start a PC5250 session on the user’s PC. Click on the ASSIST option from the menu at the top of the 5250 panel and select Macro Setup from the drop-down menu. With the Macro Name window empty, click on the Customize button. Enter the following script in the Macro Statements window:

[wait app]

“User ID

[field exit]

inputnd Please enter your Password

[enter]

[wait app]

“strpco

[enter]

“Wait app” means wait until the 5250 session starts before continuing. “User ID” will be the User ID of the person logging into this session. “Field exit” causes the cursor to move to the next input-capable field. “Inputnd Please enter your Password” causes an input box to be displayed with the message “Please enter your Password” on it. The password will not be displayed when it is typed in. “Enter” will send the Enter key escape sequence to the session. “STRPCO” will start the PC Organizer.

Save this macro under some descriptive name, and the next time a 5250 session is started on that PC, this macro will automatically run. The problem with this approach is that you’re expecting the same user to sign on to this workstation each time.

Now, you can run the STRPCCMD from that PC to execute PC applications. The syntax of STRPCCMD is extremely simple. All you need to pass it is the path to the PC

command you want to run. For example, the following command will start the Microsoft Paint program:

C:PROGRA~1ACCESS~1MSPAINT.EXE

You can also suspend the AS/400 program while the PC program is running by using the default *YES on the STRPCCMD PAUSE parameter. A value of *NO will cause the AS/400 program and the PC application to run at the same time.

The Run Remote Command (RUNRMTCMD) command (see Figure 6) can be used with IP connections as well as SNA connections. For this example, I’ll concentrate on using RUNRMTCMD for IP connections.

RUNRMTCMD works like the STRPCCMD in that you enter the path to the PC command or program you want to execute. In addition, you specify the connection type, either *SNA or *IP. In this case, you would enter *IP. For all IP connections, you also must enter the IP address. Each PC connected via IP will have its own unique address. Sometimes, that address is dynamically assigned by the host server. Other times, the address may be specified on the PC under the IP configuration.

You can determine the PC’s IP address in a couple of ways. The first way is to run the WINIPCFG command on the PC after connecting to the AS/400 (see previous tip, “Using WINIPCFG to Find Your PC’s IP Address”). This command displays the network connection type as well as the PC’s IP address. The other method requires a bit of programming on the AS/400, but basically it uses the Retrieve Device Description (QDCRDEVD) API to retrieve the IP address from within an RPG IV or CL program. For more on how to use this command as well as a code example, see “Building the Bridge Between RPG IV and PC Programs,” MC, July 1998.

Running RUNRMTCMD over an IP connection also requires that the target PC is running the IBM Remote Command Daemon, the CWBRXD.EXE program that resides in the Client Access/400 directory on your PC. To run this program in Windows 95, you can type CWBRXD.EXE on the Windows 95 Run command screen, or you can click the Automatically Start Remote Command box from the Remote Command panel of the Client Access/400 Properties icon. The latter method places the CWBRXD.EXE program in your Windows 95 Registry, and the program will start each time you start Windows 95. For Windows NT, the CWBRXD.EXE program is run as a service called Client Access Remote Command Services, and the Windows NT Security Manager is used to control access (for more information on sending remote commands to Windows NT computers using RUNRMTCMD, see the “Email, Pointers, and Advice” section in the September/ October 1998 issue of Client Access/400 Expert).

— Shannon O’Donnell Technical Editor Midrange Computing

CHGPJE SBSD(QSYS/QSERVER) PGM(QIWS/QZDASOINIT) INLJOBS(50)
CHGPJE SBSD(QSYS/QSERVER) PGM(QIWS/QZDAINIT) INLJOBS(50)

ENDPJ SBS(QSERVER) PGM(QIWS/QZDASOINIT) OPTION(*IMMED)
ENDPJ SBS(QSERVER) PGM(QIWS/QZDAINIT) OPTION(*IMMED)

STRPJ SBS(QSERVER) PGM(QIWS/QZDASOINIT)
STRPJ SBS(QSERVER) PGM(QIWS/QZDAINIT)

Figure 1: Increasing the initial number of users in prestart jobs

[home]
[home]
[home]
; replace the following two lines with [tab field] to have body excluded as
well
“f begsr
[enter]
[tab field]

“x999999
[enter]
[home]
“t
[enter]
[home]

[wait inp inh]
“f begsr
[enter]

:top1
[pf16]
wait 1 second until “String begsr found”
goto continue1 on timeout
goto top1
:continue1

[home]
“t
[enter]
“f endsr
[enter]

:top2
[pf16]

wait 1 second until “String endsr found”

goto continue2 on timeout
goto top2
:continue2

[home]
“t
[enter]
“f exsr
[enter]

:top3
[pf16]
wait 1 second until “String exsr found”
goto continue3 on timeout
goto top3
:continue3

[home]
[home]
“t
[enter]
:alldone

Figure 2: This Client Access macro, Shrink.mac, hides the details of RPG subroutines and excludes all C-specs except for begsr, endsr, and exsr tags

STRTCP (with whatever parameters you normally use)
MONMSG MSGID(CPF0000)

STRHOSTSVR SERVER(*ALL)
MONMSG MSGID(CPF0000)

Figure 3: Start host servers when you IPL




Figure 4: You can now specify workstation IDs for your PC5250 TCP/IP sessions with V3R1M3 Client Access for Windows 95/NT


 

STRPCCMD PCCMD(‘C:PROGRA~1ACCESS~1MSPAINT.EXE’)

PAUSE(*YES)


 

Figure 5 This is an example of using the STRPCCMD


 

RUNRMTCMD CMD(‘C:PROGRA~1ACCESS~1MSPAINT.EXE’)

RMTLOCNAME(‘104.122.56.19’ *IP)

Figure 6: This is an example of using the RUNRMTCMD


TOP_TIPS-_Connectivity09-00.png 900x675

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$0.00 Raised:
$

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: