as/400 and db2

hi all ,
i have just changed my work and have new challenge with as/400 , db2 and rpg.
i tried to install db2 for more understanding in windows and some website for as/400 online.
But a combine view of these are not clear .
Do you have any hand-on resource for as/400,db2 and rpg ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

try to take a look here
maybe you will find it more informative
Gary PattersonVP Technology / Senior Consultant Commented:
So, are you a programmer on another platform, ad now you need to learn RPG in an AS/400 environment?  If so, I suggest that you check out the excellent online training materials available through Manta technologies (

I suggest the following tracks, in the following order:

"Introduction to the IBM i Environment", then
"Fundamentals of System i Operations" then
"Working with DB2 Databases", then
"Control language Programming, then
"RPG Programming", then
"Integrated Language Environment".

There are lots of other learning alternatives, too, including books (, IBM online training (, and the free IBM Information Center that momi_sabag mentioned above.

- Gary Patterson


You indicate that you are new to the AS/400 hardware and operating system, that you are new to the DB2 database, and that you are new to the fundamental programming language in use at your location. You want to know where to begin.

But you haven't told us what you do know. What programming languages do you have experience with? What databases have you used? What hardware and OS? What kinds of environments -- multi-user? multi-national? manufacturing? financial? communications? security?

Where to begin -- It's hard to begin with RPG without knowing about source statements. It's hard to know much about source statements without knowing about source editors or about source files. It's hard to know about source files without knowing about source members. It's hard to know about source members without a basic grasp of how DB2 is implemented on AS/400 -- which leads to how file systems are implemented, and the Integrated File System (the IFS), and the object-based nature of the operating system, and...

Tell us something about YOU in order for us to relate concepts to your experience.

Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.


Do you have access to a "Test" or "Developement" iSeries(AS/400) environment, because without an iSeries sandbox you will have to be real careful when learning.  

As far as DB2 goes you will most likely find it easier to learn OS/400's flavor of DB2 on an iSeries essentially the entire iSeries is a DB2 database.  The version of DB2 running on OS/400 is the version and release of the actual OS so if your iSeries is running V5R2 OS/400 your DB2 is also V5R2.  Essentially DB2 is integrated into OS/400.  The iSeries also uses some different SQL terminology for instance a "Schema" in SQL terms is a "Library", a "Table" is a "Physical File", a "Row" is a "Record" a "Column" is a "Field" a "View" is a "Logical File" and a "Package" is a "SQL Package".  A good current book for iSeries based SQL and DB2 is "SQL for DB2" by James Cooper and Paul Conte.  

Seems like you have plenty of RPG reference from above.

Most find "Google" search better as finding things on IBM's web site than IBM's site search.  If you have an iSeries most likely you also have paid support.  IBMs iSeries support is very good from my experiences and most of the time they are more than willing to help you out.  So if you have it use it because it is not cheap.

Good luck with your learning.
dinhchung82Author Commented:
thanks for all !

I worked in bank and have experience with Oracle and Java.
But now , my new work need to know db2 and rpg ( on as/400).
I can use test/dev enviroment for learning .

Now , i have one use from application and use it through tn5250 .
when i want to use one program from vendor , i must call library .
how to i know the way to call library if i don't know the name and the way db2 is working with as/400.

I try to use DB GUI as Toad and use this use to connect to view database structure  but not successful . how to show database in as/400 that use and port that is db2 used?
Would any tool that is different with 5250 terminal have support for GUI more ?


Not sure I understand your question on the "call library"  Can you give more details

On you question on TOAD for DB2 I think you problems come from the fact DB2 UDB on the iSeries(AS/400) is not the same at DB2 UDB on other platforms.  I found a posting ( suggesting DB2 Connect could possible be used to connect TOAD to an iSeries database.  From my experience the best way to get a GUI view of the iSeries Database is to use iSeries Navigator part of iSeries Access.

dinhchung82Author Commented:
thanks , i shall use iSeries Navigator.

i am new to as/400 as you know but when i learn from my colleague: this is the steps i do :
+ use iSeries Navigator to connec to as/400
+ user and pass
+ setebu1 ( set ebs library list)
+ call library .... ( that's i mean )

i have one question , i use this user and pass for ftp . i list , i see some file . is it a library ???

Yes it sounds this those are libraries or in DB2/SQL would be schemas, and beneath that level you would have files or in DB2/SQL Tables.  If you use iSeries Navigator the terminology used is actually the DB2/SQL terminology and not the iSeries terminology.

Once in iSeries Navigator expand "Databases", expand your Database, and select a Schema(Library) and your should see all the Tables, Procedures..... within that schema.

If the schema you would like to see is not listed just right clickon Schemas and click on "Select Schemas to display" and enter the Schema or library you wish to see then click Add and OK
Gary PattersonVP Technology / Senior Consultant Commented:
setebu1 is a command that was created by someone - it is not a native operating system command.  It is either part of a package, or something someone locally wrote.

"CALL LIBRARY" is, similarly, a call to some non-operating system program (third party package or homegrown program).  

LIBRARY a program object that exists in one of the libraries in your job's library list (probably one of the libraries added by the SETEBU1 command.

You can determine where a command is stored (what library) by issuing the green-screen command WRKCMD, and where a program is stored by issuing the WRKPGM command.  For example, WRKCMD SETEBU1, and WRKPGM LIBRARY (probably have to execute this after running the SETEBU1 command).

It sounds like you are trying to track down the name of a running program and possibly find the source code.  IS that correct?

If so, follow the steps you were given to start the program (if it is CALL LIBRARY, then the program name is "LIBRARY", and you can find it with the command WRKPGM LIBRARY),

Sometimes, though, this might be an initial menu, and from there you would select an option that neads you to another program.  IT is pretty easy to figure out the name of the current program.  While running the program, you can open another 5250 session, and use the WRKUSRJOB command to find all jobs associated with you user profile.

For example, WRKUSRJOB GARYP would find all jobs running under the user profile GARYP.

You should see two jobs.  Select the job that is running the LIBRARY program, and use option 5 to work with that job.  The WRKJOB command lets you examine all sorts of job-related information, including open files (14), the job log (10), spooled files, and most importat for your purposes, the CALL STACK.  The call stack shows a list of every program currently running in the job.

Finding the source code depends on a lot of factors.  Sometimes you can see the source member (source text file) using the DSPPGM command.  If so, you can try using STRPDM on the source member name you find in the DSPPGM command.  If it is an ILE program, or if you use change management tools that move the source after compiling objects, it can get trickier.

Find the name of the program you want, and then post the complete, multi-screen output from DSPPGM for that command back here and we can help you locate the source code.

- Gary Patterson

                              Work with User Jobs                      PUB1     
                                                             07/16/09  20:56:23 
 Type options, press Enter.                                                     
   2=Change   3=Hold   4=End   5=Work with   6=Release   7=Display message      
   8=Work with spooled files   13=Disconnect                                    
 Opt  Job         User        Type     -----Status-----  Function               
      GARYPA1     GARYP       INTER    ACTIVE            PGM-OTH400             <----- My first job, running a program
      GARYPB1     GARYP       INTER    ACTIVE            CMD-WRKUSRJOB          <------This job, running WRKUSRJOB cmd
                               Display Call Stack                               
                                                             System:   PUB1     
 Job:   GARYPA1        User:   GARYP          Number:   164705                  
 Thread:   00000022                                                             
 Rqs    or                                                                      
 Lvl    Procedure   Library     Statement        Instruction                    
        QCMD        QSYS                            04B5                        
        QUICMENU    QSYS                            00C1                        
   1    QUIMNDRV    QSYS                            0CFB                        
      < PEP_OTH400  GAMES400                                                    
        OTH400      GAMES400    0000000436               <--Program call, currently running program line 436              
      < X_WS_EXFMT  QSYS        0000000063               <--Internal RPG language - EXFMT opcode              
        QWSGET      QSYS                            0630 <--System routine, get screen input               
        QT3REQIO    QSYS                            01CB <--System routine, waiting for screen IO               

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Operating Systems

From novice to tech pro — start learning today.