Removing non-printable characters with RPG

Non-printable characters often find their way into the database. This often occurs due to EDI and manual copy/paste data entry from sources such as web-pages. These intanace of “bad-data” can be dealt with using the translate built in function (%xlate). This could take place as a scheduled data cleansing exercise or be added to the […]

Display the IP address of a host using a RPGLE program

The following program can display the IP address of local or remote hosts as well as web urls. h dftactgrp(*no) actgrp(*new) d GETIPADDR pr ExtPgm(‘GETIPADDR’) d 32a d GETIPADDR pi d host 32a d inet_addr pr 10U 0 ExtProc(‘inet_addr’) d address_str * value options(*string) d INADDR_NONE c CONST(4294967295) d inet_ntoa pr * ExtProc(‘inet_ntoa’) d internet_addr […]

Retrieve the IP address of the local iSeries using a CL program

The following program uses the PING command to generate a message with the IP address. The IP address is then extracted from the message text and displayed on screen. PGM DCL VAR(&SYSNAME) TYPE(*CHAR) LEN(8) DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(100) DCL VAR(&IPADDR) TYPE(*CHAR) LEN(16) DCL VAR(&COMP) TYPE(*CHAR) LEN(12) + VALUE(‘0123456789. ‘) DCL VAR(&SPOS) TYPE(*UINT) LEN(2) DCL VAR(&EPOS) […]

How to find the IP Address of IBM AS/400 iSeries

How to find the IP address of a remote iSeries system? Method 1. Use the PING command, either on the iSeries or from Windows command prompt: > PING AMS600 Verifying connection to host system AMS600 at address 12.240.18.87. Method 2. Use the Verify TCP/IP Connection (VFYTCPCNN) command on the iSeries > VFYTCPCNN AMS600 Verifying connection […]

Using SQL on file with multiple members

Query for iSeries was designed with multiple member files in mind and will allow you to specify the member name. However, SQL will not allow you to access a specific database member directly. When you run SQL on an iSeries file, it will always use the first member in the file. Let’s assume we have […]