Thursday, July 14, 2011

AS400 / iSeries Fun

Where I work we still have some Cobol programs in use and I am the only one that supports them.  I decided that I needed an easy way to pull the source code to my PC so I could use a slightly more friendly way to review the code and figure out what it does (so I could replace it with C# code).

Turns out that old school is the way to go.  I FTP'd into the server, changed into the appropriate library and did a get on the source file I wanted.  Very nice and easy.  Then I decided why not just pull it all so I did an mget and it worked.  Very nice!  Dropped all the source onto a Linux box so I could grep it anytime I wanted.  Did a WC on it and found that we had about 1.5 million lines of code spread across 7000 programs.

Wanted to share how I did it for others:

cd (some folder here to store the source files)
ftp servername
Enter Username & Password
cd (library here)
prompt (to turn off prompting for each file)
mget source.*
(wait for it to finish)
quit

Enjoy!

No comments:

Post a Comment

Comments are moderated. We're only going to allow stuff that we find funny, interesting, or just plain for the heck of it. If you don't like that, feel free to leave.

Copyright Realm Laboratories, LLC