Microsoft Windows NT has become the network software of choice in recent years, and if you dont think IBM recognizes this fact, then youve never heard of the QNTC file system on the AS/400. As part of the AS/400 Integrated File System (AS/400 IFS), which includes QDLS and QLANsrv among others, QNTC can act as a repository or conduit for files on your NT PC server.
This article takes a look at what QNTC is, why you might want to use it, and how to configure it and gives you a quick look at one of the more interesting features coming up in Version 4, Release 5 of OS/400.
A Bit of History
The AS/400 has supported an internal PC card for a long time. Originally known as the File Server I/O Processor (FSIOP), its name was later changed to Integrated PC Server (IPCS), and it is currently known as the Integrated Netfinity Server for AS/400. No matter what it is called, its main function has remained the same: to allow AS/400 customers to load PC software, such as Novell NetWare, onto the card and run it from the AS/400 platform. Although NetWare users were the original target audience, IBM quickly expanded support for Lotus Domino and, most recently, Windows NT.
Version 4, Release 2 of OS/400 saw the first support of Windows NT on the IPCS. In that release, however, V4R2 users could load the NT Workstation software onto the IPCS and let the AS/400 act only as a node of the NT network. The AS/400 could not act as the NT server in a network. Whats more, the NT file system itself was not supported. In other words, native AS/400 applications, APIs, and commands were unable to access files on an NT server in the network, which left a rather incomplete system. This must have made for a tough sale for IBM sales reps who had to try to convince NT shops that the expensive AS/400 platform was a good value over their cheaper PC servers. When asked if they could integrate their NT data with their DB2/400 data, the IBM marketing rep probably hemmed and hawed and finally sheepishly admitted that this functionality didnt exist yet. No sale!
Version 4, Release 3 of OS/400 changed all that. This release of the operating system introduced the QNTC file system to the AS/400 community. At last, there was a way to let your RPG IV programs directly access data on your NT network. Whats more, now, your AS/400, with Windows NT loaded onto the IPCS (hereafter referred to as the
Integrated Netfinity Server), could act as the NT server in your NT network if you so desired. If you didnt want the AS/400 to be the server, it could also act as a node on the NT network. NT files on the AS/400 server became available to the rest of the AS/400 through the QNTC file system.
How It Works
You communicate with the QNTC file system using the POSIX APIs, such as OPEN(), READ(), and WRITE(). These are the same APIs that you use to manipulate any other file in the AS/400 IFS. As shown in Figure 1, the RPG IV program reads from a file in the QNTC file system and then writes that data to a DB2/400 database. Notice the path statement in the variable Filepath. You can see that I specified the QNTC file system as part of the path name. In this example, the program will open a file named HPSETLOG. TXT in the QNTC file system on the server named NOAHSARC. You can change the value of this variable if youd like to try out this code. Either hardcode the file path name in that variable or build a dynamic variable at runtime. For a detailed explanation of whats going on in this program, check out the article RPG IV and the IFS, by Ted Holt in the December 1997 issue of Midrange Computing.
You can also use the Work with Object Links (WRKLNK) command to access the files in QNTC. Once you either issue a command line command or call one of the POSIX APIs, that command string is translated into something NT can understand using the Common Internet File System (CIFS). CIFS is a new industry standard developed by Microsoft to define remote file access protocol. QNTC takes all the work out of converting your commands to something NT understands by converting those commands into CIFS building blocks, which are also known as server message blocks (SMBs).
Incidentally, SMBs are what AS/400 NetServer uses to communicate with your Windows systems to perform file and print sharing.
Once the command has been translated to an SMB, it is sent to the NT system over your IP network as a NetBIOS packet, which is encapsulated in the TCP/IP packet. By encapsulating these SMBs in NetBIOS over TCP/IP, the data can be transmitted over network bridges and routers. A much wider range of network servers can be accessed this way than by using NetBIOS alone.
Why Use It?
There are myriad reasons why you should start to use this new file system. Perhaps the simplest one is that your users will need to log onto only one system to access all their data. The QNTC file system handles the connection handshake between OS/400 and the NT server, whether that server is loaded locally on the Integrated Netfinity Server or on a remote network two or three TCP/IP hops away. When users log onto the AS/400, they are automatically logged onto the NT file system, too.
Lets take a few moments to imagine a scenario using the AS/400 and the QNTC file system and go through one way you might use it. Lets say that a departmental secretary comes into work in the morning and logs onto the AS/400 from her PC, using an emulation product such as Client Access/400. Although shes not aware of it, when she logged onto the AS/400, she also logged onto the NT server because her AS/400 user ID and password were the same as the NT user ID and password set up for her on the NT server.
The secretary begins her daily task of updating item prices, using an RPG IV green- screen application. At some point, the secretary discovers that there are items in the OS/400 database without current pricing. She knows that another department handles pricing, so she phones someone in that department and learns that, yes, the new prices have been set, but they are stored on a PC in that department in a Microsoft Access database. At the secretarys request, the Access database is saved and exported as a comma-delimited text file to the NT server.
In the good old days before QNTC, the secretary would have had to call the IS department and request that someone retrieve the Access data, convert it, and upload it to the AS/400. Either that, or someone would have had to print the data on hard copy and the secretary would have entered it manually. Today, theres a better way, using the QNTC file system.
Returning to our scenario, when the secretary gets off the phone, she exits the item lookup screen and goes into a new green-screen application. In this one, she selects a list of item numbers she wants to update and presses a function key that prompts her with a list of predefined, available locations (paths) for the location of the pricing file. The secretary selects from the list the location of the exported Access database that resides on the NT server. When the secretary presses the Enter key to accept her choice, the RPG IV program, much like the one shown in Figure 1, which also uses the work file shown in Figure 2, uses the POSIX APIs OPEN and READ to open the exported text file and read the data from that file.
The new item prices from the text file are written to a temporary file in library QTEMP. Now, the RPG IV program does a simple chain to the temp file to extract the item prices that match those in the list chosen by the secretary and updates the items with the new prices. In seconds, the items all contain updated prices, and the secretary is back at work, verifying other item numbers.
This is just one of the thousands of possible scenarios for using the QNTC file system.
Configuring QNTC
Although you dont have to purchase QNTC separately (it comes free as part of OS/400), there are a few steps youll need to take to configure it so you can start using it. All QNTC configuration steps take place from the Client Access/400 Operations Navigator on a PC connected to your AS/400.
On the AS/400
First, youll need to configure NetServer. Thats a topic that would take more space to cover than we have room for here. For a detailed description of configuring NetServer on your AS/400, check out Client Access without Client Access in the July/August 1998 issue of Client Access/400 Expert (now known as AS/400 Network Expert) from Midrange Computing. Another great article on AS/400 NetServer and how to configure it is
NetServer Satisfies Express Client File Sharing Needs in the April 1999 issue of MC. Both articles tell you what NetServer is and guide you step by step through configuring it. The one important NetServer configuration step I want to highlight here is that the domain name in your NetServer configuration must be the same as the Windows NT Server domain name. This is because QNTC uses the NetServer name resolution and browsing services to determine which servers are available on the network.
In the example shown in Figure 3, I configured NetServer properties using Operations Navigator to point to a server named Qcondor, which is the name of the AS/400 I was using, and the domain name of SieCorp. SieCorp is the workgroup name specified on the Identification panel on the PCs Network properties panel. Its also the NT domain name in this particular network. You can access the Network properties panel by right- clicking on the Network Neighborhood icon on your PCs desktop and selecting Properties from the drop-down menu.
Once youve configured NetServer, make sure the QSERVER subsystem is started using the STRSBS SBSD(QSERVER) command and then start NetServer from Operations Navigator. One final note on the AS/400 configuration: Make sure that the AS/400 user ID and password youre going to use match the Windows NT user ID and password.
On Windows NT
If youre not familiar with Windows NT, you may need to refer to any of the numerous manuals on using Windows NT or even the Windows NT User Guide that comes with the software if you have specific questions about any of the steps listed below. Some of these steps will apply only if you are installing Windows NT for the first time:
Match the NT user ID and password with the AS/400 user ID and password so that when a user logs on to the AS/400, that user will be automatically logged on to the NT server.
Install the TCP/IP networking protocol when you install the NT server, either on the Integrated Netfinity Server or on a stand-alone PC. Installing the NetBIOS protocol is not necessary; NT can detect NetBIOS packets inside TCP/IP packets.
Create the file directories (or shares, to use the Windows NT terminology) that your files will be stored in if you havent already done so. This step can be performed on an as-needed basis. The main thing to understand about shares is that when your native AS/400 application accesses a file in an NT share, it will refer to the file in the format/file system/server/directory/file name.
In the example shown in Figure 3, I use the WRKLNK command from an AS/400 command line to display a list of files and subdirectories. In this example, you see a file named hpsetlog.txt in the WINNT subdirectory under the C directory on the NOAHS-ARC server in the QNTC file system. Remember, the server named NOAHSARC may be on another PC in the network or on the Integrated Netfinity Server inside the AS/400. You identify which server to use by specifying its name in the path.
Set up at least one server to be the domain controller for your NT network. The domain controller authenticates login requests in your network. If you have an Integrated Netfinity Server on your AS/400 and you load Windows NT Server onto it, you could set up that server as the domain controller.
Configure at least one NT PC, either the one on the Integrated Netfinity Server (if youre using it) or one somewhere on the network, to be the master browser. NT uses browsing to allow other systems to determine the computer member list for a given domain.
Thats pretty much it. There are a few other things you can do if you so desire. For example, you could configure one of the NT PCs as a WINS Proxy server. This step isnt necessary if the AS/400 and the NT server both reside on the same subnet. Dont forget to start the NT browsing service! When I configured NetServer and the QNTC file system on a friends AS/400 and NT network at his software development company, SieCorp (www.siecorp.net), here in central Illinois, I was completely hooked up and accessing a file on his NT server from the AS/400 in under 10 minutes. Now, thats fast!
Make Sure It Works
To check out your configuration, from an AS/400 command line, enter the WRKLNK command and press Enter. Search for the QNTC file system in the resulting list and enter a 5 next to it to display the next level. You should see the NT server(s) on which your AS/400 shares a domain. Enter a 5 next to each one to drill down through the available shares directories. You should see a display much like that shown in Figure 4.
Whats Ahead
The most exciting new feature that Version 4, Release 5 of OS/400 will introduce is the use of the familiar AS/400 Save and Restore commands to save and restore data from the QNTC file system using your AS/400 storage devices. The only caveat here is that you can back up and restore only data that is stored on the Integrated Netfinity Server. This isnt necessarily a bad thing, though; you can store a lot of NT data on the AS/400! Whats more, the Integrated Netfinity Server will be upgraded to a 500+ MHz chip in early 2000, so the processing speed of Windows NT residing on an AS/400 will be comparable, or even superior, to many standalone servers currently on the market. Future releases of
OS/400 will most likely allow any NT PC on the network to be accessed using the Save and Restore commands, but thats still a ways down the road.
Bringing It All Together
IBM has been trying to sell the AS/400 as a viable platform for networking for a long time now without much luck. Trying to convince an NT shop that it would be better off purchasing this $75,000 machine instead of that $6,000 standalone PC hasnt been an easy road to travel. Now, finally, IBM may be on to something. The functionality that QNTC brings to an NT network is exactly the kind of thing these NT shops need. Its also the hook that IBM can use to replace all those standalone systems with dedicated AS/400 network servers.
REFERENCES AND RELATED MATERIALS
AS/400Implementing Windows NT on the Integrated Netfinity Server, Redbook (SG24-2164-01)
Client Access without Client Access, Bridget Meyer, Client Access/400 Expert (now known as AS/400 Network Expert), July/August 1998
NetServer Satisfies Express Client File Sharing Needs, Bridget Meyer, MC, April 1999
OS/400 UNIX-Type APIs V4R4 (SC41-5875-03, CD-ROM QB3AM403)
RPG IV and the IFS, Ted Holt, MC, December 1997
Support for Windows Network Neighborhood (AS/400 NetServer) home page: www.as400. ibm.com/beyondtech/netserver.htm
*================================================================
* To Compile:
*
* CRTBNDRPG PGM(XXX/QNTC00R1) DFTACTGRP(*NO) BNDDIR(QC2LE)
*================================================================
*
FRcfile O E K Disk
*
* open -- open a QNTC file
D open pr 10i 0 ExtProc('open')
D Filepath * value
D openflags 10i 0 value
D mode 10u 0 value options(*nopass)
D codepage 10u 0 value options(*nopass)
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* read -- read a QNTC file
*
D read pr 10i 0 ExtProc('read')
D filehandle 10i 0 value
D datareceived * value
D nbytes 10u 0 value
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* write -- write to a QNTC file
*
D write pr 10i 0 ExtProc('write')
D filehandle 10i 0 value
D datatowrite * value
D nbytes 10u 0 value
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* close-- close a QNTC file
*
D close pr 10i 0 ExtProc('close')
D filehandle 10i 0 value
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* values for oflag parameter, used by open()
* from QSYSINC/H, member FCNTL
D O_Rdonly s 10i 0 inz(1)
D O_Textdata s 10i 0 inz(16777216)
* Prototype for reading from the QNTC file
D RdntFil PR 100A
D Filepath 100A CONST
D CodePage S 10u 0 inz(819)
D Cr C const(x'0D')
D Data_Rec S 78A
D Eol C Const(x'0D25')
D Error_Flag S 1A INZ('0')
D File S 100A
D Filepath S 100A INZ('/QNTC/NOAHSARC/C/+
D WINNT/HPSETLOG.TXT')
D Fp S 10i 0
D I_Net_Adr S 20A Inz
D Lf C const(x'25')
D N S 5 0
D Oflag S 10i 0
D Omode S 10u 0
D R S 5 0
D Rc S 10i 0
** MAIN
*C Eval Error_Flag = RdNtFil(Filepath)
C Eval *Inlr = *On
** RdNtFil - Subprocedure To Read a file from QNTC File System
*P RdNtFil B Export
D RdNtFil PI 100A
D Filepath 100A Const
D CharsRead S 10i 0
D CurChar S 1
D Eof C const(x'00')
C Eval Oflag = O_Rdonly + O_Textdata
C Eval File = %trim(Filepath) + x'00'
C Eval Fp = open(%addr(File): Oflag)
C If Fp < 0
C Eval Error_Flag = *On
C Return Error_Flag
C Endif
C Eval R = 0
C Eval N = 0
C Eval Data_Rec = *Blanks
C Exsr GetChar
C Dow CurChar <> Eof
C Select
C When R = 78
C Exsr Write_Rec
C Eval R = *zero
C Eval Text = *blanks
C When CurChar = Cr
C Exsr Write_Rec
C Eval R = *zero
C Eval Text = *blanks
C When CurChar = Lf
C Exsr Write_Rec
C Eval R = *zero
C Eval Text = *blanks
C Other
C Eval R = R + 1
C Eval %Subst(Text: R: 1) = CurChar
C Endsl
C Exsr GetChar
C Enddo
C Exsr Write_Rec
* Close the QNTC File
C CallP Close(Fp)
C Return Error_Flag
** GetChar - Process QNTC Record, One Character At A Time
*C GetChar begsr
* If input buffer is empty, or all characters have been
* processed, refill the input buffer.
C If N = CharsRead
C Eval Data_Rec = *Blanks
C Eval CharsRead = Read(Fp: %Addr(Data_Rec): 78)
C Eval N = *Zero
C Endif
* Get the next character in the input buffer.
c If CharsRead <= 0
C Eval CurChar = Eof
C Else
C Eval N = N + 1
C Eval CurChar = %Subst(Data_Rec: N: 1)
C Endif
C Endsr
** Write_Rec - Write Data from QNTC file to database
*C Write_Rec Begsr
C Write Rcrec
C Endsr
P RdNtFil E
Figure 1: This RPG IV program demonstrates how to read from a file in the QNTC file system and then write that data to a DB2/400 file.
****************************************************** **
* TO COMPILE:
* CRTDSPF FILE(XXX/RCFILE) SRCFILE(XXX/QDDSSRC)
****************************************************** **
R RCREC
TEXT 80A COLHDG('TEXT')
Figure 2: The RPG IV program reads from a file in the QNTC file system and then writes that data to a DB2/400 database.
Figure 3: Configure NetServer to use your AS/400 system name and your networks domain name.
Figure 4: Use the AS/400 WRKLNK command to display your QNTC directories and files.
LATEST COMMENTS
MC Press Online