|
Duplicate spooled files
CPYFRMSPLF (Written by Yakov Shapiro)
command duplicates spooled file from one outq
to another. Command does not have a limitation for a printer
device type (allow to duplicate *SCS, *IPDS, *AFPDS spoolfiles).
User has to enter spooled file name, outq for copying
spooled file, job name, user and job number (or * for current job)
and a spooled file number.
Subprocedure Example
This is a simple subprocedure example. It requires two
parameters, an input text string and an output text string.
If passed “WELcoME TO Code400 WEBsite” it will return
“Welcome To Code400 Website”
Download City/Zipcodes
We have been collecting your city and zipcodes and
are now ready to start posting the compiled lists.
Let us know if your state is missing and we will
post it. Files are in .CSV format so they can
easily be maintained with EXCEL.
User Spaces
One of the more powerful tools for iSeries programmers
is the user space. Many IBM list APIs use a user space to
hold the results of these API calls. A user space is
similar to a data area, except that it can be much larger
QUSCRTUS, QUSCHGUS, QUSPTRUS
Reroute Spooled files
These programs will reroute spooled files from
one outq to another. If you have a printer problem
and need to reroute spooled files to another outqueue
this is your tool. It also has example of using
dataqueues to communicate between programs.
(needs some TLC) Nice tool give it a try.
QUSLSPL, QUSCRTUS, QUSPTRUS, QUSDLTUS
Monitor WRKACTJOB
This program example runs in a loop looking for jobs in message
wait.(*MSGW) when one is found the program loops thru a list
of userid's and sends a break message to every interactive
device this user is logged on to. It then waits five(5) minutes
before resending the error message if still in *MSGW.
RUNSQLSTM
This program SQLRPGLE searches all tables in a library
for a selected field. It writes these fields to a table
and calls a program that writes SQL statements to a source
member then runs command RUNSQLSTM to process.
Physical file triggers
A database trigger is a predefined event that runs automatically
whenever a specified action is performed on a physical file.
A trigger program is associated with a physical file
and can be assigned to run on a read, add, change, or delete operation
against that physical file.
QLGSORT
The Sort (QLGSORT) API provides a generalized sort function that can be
directly called by any application program. This API can be used to sort
data in files or data in an input buffer with a single call. This API can
also be used to initialize a sort function where a series of calls using
the Sort Input/Output (QLGSRTIO) API is done to repeatedly add data to be
sorted as a set of records and return sorted data as a set of records.
Add color to source
Yet another example of how to color your source members.
Find Source
This tool uses SQL and QADBXREF to find all source files on
your system, then it searches each for the member of your choice.
Iseries Backup
We have put together a couple of programs and files that
can be used as a start for developing a backup(SAVOBJ) procedure.
FTP on the Iseries
We have put together a semi flexible Batch FTP program
and would love for you to try. Please let us know what you
think. Feel free to modify or give to a friend as a gift.
Data Structures (PSDS/INFDS)
A file information data structure (INFDS) can be defined
for each file to make file exception/error and file feedback
information available to the program.
File Field Description
This program shows fields in tables and with the
push of a function key shows logicals. Will also
print field report. Needs some TLC to complete and
repost on the site.
Self Submitting Program
This program displays a screen, gets input then
submits itself to batch to print a report.
Simple Auto RGZPFM
Automatic reorganize physical file program. Uses an SQLRPGLE
program and an Iseries table to remove deleted records from all
data tables on system. I skipped the ones prefixed with "Q".
View IFS files (DDS)
his program/Display list all objects in a directory to the screen.
Currently the directory is hard codeed but this can easily be
modified to pass in the path and then just do “stuff”with the files.
Arrays
Array is short for "an array of variables
of the same type." An array is a way of grouping
objects and variables together so that they are
easy to work with.
|
|
CL enhancments V5R3
This was added to the forums and I didn’t want to see it lost.
Who Locked my Record?
Here is an example of a program that pops up a window showing the
job, user and job number of the person locking the record it
is trying to access.
Fun With Dates
Add or subtract a duration in years, months, days, hours, minutes, seconds, or microseconds
Determine the duration between two dates, times, or timestamps
Extract a portion of a date, time, or timestamp (for example, the day)
Test that a value is valid as a date, time, or timestamp.
To add or subtract a duration, you can use the + or - operator in free-form
syntax or the ADDDUR or SUBDUR operation code in traditional syntax.
Message Subfile Example
Do You need a simple example of of a message subfile.
Included in the download is the display file, the RPGLE program
and a program to build the message file and add a few messages to
test with.
Read Outq - QUSLSPL
This program reads multiple outqueues from an Iseries
table. Then performs some action on the spooled files.
Uses IBM system API - QUSLSPL.
Convert Table to CSV
I know this is easy just use the CPYTOIMPF. Well we added a way
to select fields from a file and add only your selected fields to
the csv. - Plus created physical file on the fly!
PDF or HTML reports
We have put together a set of tools that will enable you to send
Iseries reports to just about anyone you wish via email.
We will show you how to convert those “ugly”greenbar
reports into .PDF or .HTM then email them.
A great use for this would be combining an attachment maybe XML
with your reports in a nice html formatted email. Can you
say ASN? Don’t let marketing know about this one.
Printing (AFP)
This example is a bit crude, but what it does give you
is an example of AFP printing of project sheet. This
includes boxes, lines, multiple fonts, and
text rotation.
Push Button DDS example
This example shows how to use the DDS keyword(s)
WDWTITLE,PSHBTNFLD, PSHBTNCHC. Its a simple example that
just processes Iseries commands. Its pretty much useless except
as an example.
PHP on the Iseries
Just put together page on where to get information on
loading/setup of PHP on the Iseries. I also included
information on PASE and QSHELL.
Write Directly to IFS
This example is simple in nature it takes data from iseries
tables and writes the directly in a fixed length format to
a PC type file on the IFS. Once there you need only email
to your customer(s).
Save Iseries Library to CD
Did you ever wonder how software companies created distribution CD’s
for the Iseries. How you were able to load entire software packages
by keying in LODRUN OPT01 on the command line. Well we have an example
of just such an application.
Iseries Website
Example(s) to setup you Iseries webserver and develop your
first RPGLE CGI program.
Built in Functions
Examples of popular built in functions.
%CHECK %DATE %DEC %DIFF %EDITC %LOOKUP %SUBDT
/FREE Form RPG
IBM takes away the MOVE opcode and gives us the
semi colon.
Sample subfile program
Simple subfile in a window with position to and select.
DDS and RPG included. Good for a starter program.
Default H-Specs
The RPG compiler looks for control (H) specifications
in two other locations, if none are specified in the program's
source member: A data area called RPGLEHSPEC anywhere in the library list
DFTLEHSPEC in library QRPGLE
Virus on the IFS
Although OS/400® or i5/OS can not be infected by a
PC virus, if the Integrated File System on OS/400®
or i5/OS is used as a file server for PC files,
the files stored on the Integrated File System may
carry viruses.
Duplicate Spooled file
This document shows different uses of the Copy Spooled File
(CPYSPLF) command including how to re-create a spooled file
with different attributes or how to create a PC file from
an existing spooled file.
Display Remote outqueues
Written By:Bryan Dietz & Tom Chamberlain 2001
These programs display all remote outqueues to a
subfile and allow a user to edit/maintain spooled files as well as
the outqueue itself.
API’s QSPROUTQ, QCMDEXC, QUSDLTUS, QUSCUSAT, QUSCRTUS
Soundex SQL Function
Soundex codes begin with the first letter of the surname followed
by a three-digit code that represents the first three remaining
consonants. Zeros will be added to names that do not have enough
letters to be coded.
|