Home > AS/400 Tips > iSeries programmer tips > The Lazy Coder: Use your iSeries as a file server
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES PROGRAMMER TIPS

The Lazy Coder: Use your iSeries as a file server


Andrew Borts
03.24.2004
Rating: -4.39- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


You Can View User Feedback To This Tip

Yikes! You've noticed that you have a TON of Integrated File System (IFS) files on your system. What are they doing there?! Well, your iSeries system has been a unified file system for a while. Remember "shared folder" support? That functionality went away as soon as IBM created this hierarchical file system. It looks, tastes and smells like a Windows NT server to any unsuspecting PC linking to it.

What can I do with it?
For SMALL iSeries or AS/400 shops, you can store files on it as if it were a PC server. Store programs, store files -- it doesn't have the same limitations that Shared Folders had. Nor do you need a single morsel of IBM software to access it. This functionality is BUILT into Windows 98 and beyond. My preference is still Windows 2000 or XP Pro for accessing those files. Even better, you can now set up Client Access without even having the CD on you by accessing the directory where the programs are stored. (Look in the QIBM directory!)

Where do I begin? I'm DYING here -- WHEN ARE YOU GOING TO LET ME IN ON THIS SECRET?
To access these files from a green (or Emulation) screen, type WRKLNK or Work Link and press enter. This will display what YOU can access within the IFS. (Note: QSYS (shown as QSYS.LIB) is merely a directory WITHIN the IFS structure.) What can you do from here? Let's create a directory WITHIN the IFS.

On the iSeries system, type MD and prompt using F4. You can now CREATE directories within your IFS. "Hey, wait a second," you say. "That's a DOS command!" You bet -- your 400 understands some DOS.

You can also change directories, so you can create files under a directory. With CD (Change Directory), your "Current" directory is changed so you can perform IFS functions without long prefixes. There's also CD's synonym -- CHGCURDIR (Change Current Directory) -- the iSeries identical twin! (I wonder if there are some people who would NEVER use the command CD but would swear by CHGCURDIR as being more efficient and written for the 64-bit environment.) Do NOT confuse CHGCURDIR with CHGCURLIB -- as that command Changes your Current LIBRARY -- which is really related to the back-end programs.

More Information

Wow! This is too much fun. What ELSE can I do with this thing?
So, do you want to use your 400 as a file server? This exciting bit of software engineering is named iSeries NetServer, and it comes with the following standards in place. The system serial number, with a Q in front of it, is the name of the server. To find this, several steps need to be taken on your PC:

  • Add a line to a file BURIED in Windows 2000 or Windows XP. It is in a subdirectory called /[windows directory]/system32/drivers/etc – where [windows directory] will be where your copy of windows is installed. There you will find two sample files Microsoft gives you: LMHOSTS.SAM and HOSTS.SAM. Inside those is a standard for declaring a sort of local name server for your PC. This helps it find your server and link up with them. Both files use the following format to declare a server.
  • xx.xx.xx.xx SERVERNAME
    Where ;
                xx.xx.xx.xx is the TCP/IP address of the server
                SERVERNAME is the name of the server
    

  • Edit the LMHOSTS.SAM file using Notepad and add your AS/400's information. Example: 192.168.1.1 QS1234567. (Your PC may pop up a window that says, "I don't know WHAT program to open this with. YOU TELL ME!") People using Client Access V5R2 may not need to modify these files as part of the installation manipulates this file, but everyone else on versions below that will need to do so.

    Next, "Save As" and remove the .SAM from the suffix. The file then becomes LMHOSTS.
  • Do the SAME thing with the HOSTS file. Once there, save as "HOSTS." (That's right -- hosts with the period on the end) instead of "HOSTS.SAM". This file is where your computer turns to FIRST to find servers or other computers on your network, THEN the system looks using the declared name servers. These are cool files to understand when troubleshooting Web sites while programming CGI applications -- but that's another tip for another day!
  • If (and I mean IF) your PC's Userid and password are THE SAME as your 400, you'll really have some fun now. Your PC's authentication is now sent to the 400 for its OWN authentication. (I encourage you to keep you and your users in this sort of mindset -- where both servers have the same passwords and userid formats.)
  • If there's ANYTHING you'd like visible to your network of users, you MUST set on a flag that indicates that they are a Shared resource. This is an application located as an extended feature of Operations Navigator. You MUST include the extended functionality when you install Client Access (BIG HINT!).
  • Fire up Operations Navigator and look under "File Systems." You should see "Integrated File System." (If you don't, you need to install that extended functionality I mentioned.) Under "Integrated File System," you'll see "root." Right click on that item. Select "New Share" and declare that you'd like to perform Read/Write operations (unless you'd like the share to ONLY allow READ access to the information on the server). You MUST have proper access to your IFS for these functions, so be sure to buy bagels for the guy who knows the QSECOFR password.
  • If you'd like to MAP the root directory (or whatever SHARE you've declared on your server), you can simply select the "File Shares" portion under the "Integrated File System," then select "root" and right click. You want to then select "Map Network Drive" and declare WHO will be connecting to the system. (You may have to place a password into this setup.)

Now you have this COOL file server, centrally stored by your nightly backups (you DO perform a SAV command each night, right?) which backs up the IFS and can then keep users' documents on a centrally located server.

Confusing? Let's summarize these terms:

  • WRKLNK -- Work with IFS "Links" or Objects
  • MD -- Make Directories (If I want a directory in HOME with my name on it, I'd use "MD /HOME/Andrew" assuming the directory HOME exists.)
  • CD -- Change Current Directory
  • CHGCURDIR -- Change Current Directory
  • iSeries Net.Server -- iSeries IFS agent -- Makes the server look like a Windows NT server.
  • LMHOSTS file -- A file for locating NetBios servers
  • HOSTS file -- A file for locating TCP/IP servers
  • PC -- Used to confuse and befuddle iSeries professionals

-----------------------------------------
About the author: Andrew Borts is webmaster at United Auto Insurance Group in North Miami, Fla. He is often a frequent speaker at COMMON and past president of The Southern National Users Group, an AS/400 user group based in Deerfield, Fla.

USER FEEDBACK TO THIS TIP

  • This tip mentions the usage of mapping a network drive to an IFS folder, which is extremely useful, but can potentially expose the iSeries as a storage location for viruses.

    In order to propagate themselves, viruses tend to search for available drives, and if an iSeries folder is mapped to an infected PC, then the virus can move to the iSeries itself.

    Therefore, a better alternative to mapping is to create a shortcut to the IFS folder instead, and then place the shortcut on the desktop. — Gary Edwards


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
iSeries CL programming
Taking advantage of CL advancements, starting with V5R3
Checking in on your IBM i authorization lists
Running PHP open source applications: NOBODY needs authority
Simplify the process of converting a spool file from iSeries into an Excel spreadsheet
CL program for daily backups
An automated CL method of moving a query from AS/400 to Excel
Changing user password expiration
Eight steps for creating program documentation using AS/400 utilities
DAYSPAST CLLE program for AS/400: Compares object creation date with today's date
Advanced Job Scheduler help

iSeries programmer tips
Enhancing RPG with external SQL stored procedures
Tracking data changes on IBM i with triggers
Introduction to SQLRPGLE on IBM i: Making a report
Implementing a browser interface in COBOL: Displaying database fields
Taking advantage of CL advancements, starting with V5R3
TAATOOL: Useful tools for programmers on IBM i
Implementing a browser interface in COBOL: Creating your graphic Web page
Implementing a browser interface in COBOL: Getting started
Making the most of RPG data handling on IBM i
Groovy programming on IBM i

Application Development
iSeries calling an .exe
Top 10 programmer tips
Formatted work job scheduler
Convert system date and time
Mixing free format code with embedded SQL
SQL update a field in one file from a field in another file
Webcasts for iSeries programmers
Programming advice from the pros
Easy code copying via the drag and drop method
Setting FTP time-outs

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts