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 […]