Here is a quick and simple way to upload a CSV to an AS400 table. This comes in handy when trying to quickly transfer data back and forward between systems. I use this to create relationships on AS400 tables where the data I need is non existant on the server.
Learning has never been so easy!
You have the as400 or iSeries or SystemI5 disk shared, ie you can see it with the windows explorer. On the web page right clic the link & save as a file in your PC with the.MBR extention; On the file explorer, expand your I5Shared disk, expand QSYS, up to your source file sample + qsys.lib; drag & drop your.MBR file to your source file.
2 Steps totalStep 1: Put CSV on the AS400
1.) Open iSeries Navigator
2.) Expand the drop down for your system 3.) Expand File Systems 4.) Expand Integrated File Systems 5.) Here you will have the file structure for your AS400. Under Root I have created a folder called quoting. This is where I will drop my CSV called guides.csv. 6.) The easiest way to get the CSV in that folder is to drag and drop the file there. Step 2: Running The Commands
1.) Open up the green screen and go to a command line
2.) at the command line type 'CPYFRMIMPF' Press F4 3.) You will be at the copy from import file screen 4.) At this screen you need to fill out the following fields A.) From Stream File = Path to file (In this case '/Quoting/Guides.csv' B.) To data base file = Location where you want file to be placed (Fill in File name and Library) C.) Replace or Add = '*UPDADD' D.) Record delimiter = '*ALL' E.) Record Format = 'DLM' F.) Decimal point = '*PERIOD' (Note: You will need to page down to see this) G.) Replace Null Values = '*FLDDFT' H.) Identity column = '*FROMFLD'
5.) Once all of this is filled out press enter and the table will be created on your system.
I have added complete print screens outlining this process. If you copy everything from those changing only the file name as you have it this should work fine. I use this all the time for SQL queries where I need to create a relationship with fields that dont exist.
I dont know if there are alot of AS400 users here but If there are any questions please let me know.
Published: Oct 08, 2009 ยท Last Updated: Oct 19, 2017
8 Comments
Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |