×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Export data to flat files
2

Export data to flat files

Export data to flat files

(OP)
I inherited a AS/400 system with an application on it. I had never program in AS/400 environment. How can I export the data in RPG database to flat files?


 

------------------------------------------
There are 10 kinds of people in this world. One that understands binary and the other one that does not.

RE: Export data to flat files

If you are not familiar with AS400 then my advice is please at least get training. There should be training modules that can be provided with your company.

To answer your question - start with WRKQRY.

RE: Export data to flat files

There's no RPG database. DB2/400 is the database which is delivered with the machine.

You can FTP the DB2/400 file to any flat file providing that there's no packed or binary data in the file.

RE: Export data to flat files

(OP)
I programmed on IMS db before. I have no problem handling packed decimals.  As matter of fact, we have loaded data dump from IMS using Oracle sql loader.

what I'm trying to achieve is dump all the data out of the application and load it into another database such as Oracle of SQL Server for reporting purposes.

------------------------------------------
There are 10 kinds of people in this world. One that understands binary and the other one that does not.

RE: Export data to flat files

I don't think you can dump all the data into a database. Maybe what you are trying to tell us is to migrate individual or collective data files into an oracle tables. Here' what I always do whenever we migrate from DB2 to oracle. We are still doing this right now (interfaces). This is to assume that you already knew the data mapping beforehand:
1. Create Physical file that is mapped to your oracle table.
2. Create an RPG, cobol or QRY program to write to the physical file. You will need to convert EBCDIC characters into ASCII files. Be aware of oracle date formatting.
3. Use AS400 ftp capabilities to sent your file to where the
   location of your oracle database.
If you are using REFLECTION, you can use this tool too or if you know SQR language then this is the best I can think of because SQR can open multi database at one time.

Hope this helps.

RE: Export data to flat files

(OP)
You're right, I will be loading each file into a table each.
Sql loader is a powerful utility which can load EBCDIC files into Oracle.

 

------------------------------------------
There are 10 kinds of people in this world. One that understands binary and the other one that does not.

RE: Export data to flat files

Well, you could also use the CPYTOIMPF command to import the files into an IFS directory of your choice, the conversion EBCDIC -> ASCII occurs during the copy phase.. From there you can ftp the IFS flat files to load Oracle DB. You don't need a program.

Here's an example not tested.

CPYTOIMPF FROMFILE(MYLIB/MYFILE)                   
          TOSTMF('/home/mydirectory/myfile.txt')   
          STMFCODPAG(*STDASCII)                    
          RCDDLM(*CRLF)                            
          DTAFMT(*FIXED)                           
          STRDLM(*NONE)                                                      
_______________________________________________________                                                  
FTP  Oracle
User Password
PUT  /home/mydirectory/myfile.txt ...
QUIT

RE: Export data to flat files

(OP)
The information provided here has been great! Thank you guys!

------------------------------------------
There are 10 kinds of people in this world. One that understands binary and the other one that does not.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close