as/400 and db2

Posted on 2009-06-26
Last Modified: 2013-12-06
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 ?
Question by:dinhchung82
  • 3
  • 2
  • 2
  • +2
LVL 37

Assisted Solution

momi_sabag earned 50 total points
ID: 24726548
try to take a look here
maybe you will find it more informative
LVL 35

Assisted Solution

by:Gary Patterson
Gary Patterson earned 350 total points
ID: 24739421
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

LVL 27

Expert Comment

ID: 24757137

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.

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

LVL 27

Assisted Solution

tliotta earned 50 total points
ID: 24758845

Assisted Solution

dsimon122 earned 50 total points
ID: 24793780

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.

Author Comment

ID: 24866755
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 ?


Expert Comment

ID: 24868304

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.


Author Comment

ID: 24868396
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 ???


Expert Comment

ID: 24869555
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
LVL 35

Accepted Solution

Gary Patterson earned 350 total points
ID: 24872568
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


Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
cat /etc/debian_version returns stretch/sid instead of version 12 256
Time Machine reports 'Disc Full' 3 80
hp mini 3 68
IBM TS3100 tape Library 3 41
Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, ( because one time I did this and I essentially had a bricked …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question