Suppose you want to make an iSeries™ database file available to all NetWare users. If the database file is externally defined (using DDS) and has packed decimal fields, you cannot copy it directly to a file in QNetWare file system. You need to first copy it to a physical file; then you can copy it to a file in QNetWare. If fields are in packed decimal format, you need to create a logical file to convert the packed decimal fields to zoned decimal fields. The following example shows how to copy and convert a file that contains packed decimal fields. You can also see an example of how you might do this with an ILE C for iSeries program.
The file in this example is in library DATALIB and has the name CUSTCDT. You can refer to these example displays:
To copy the CUSTCDT database file to the QNetWare file system, you would follow these steps:
MKDIR DIR('/QNetWare/SRVNW0A.SVR/SYS/DTA') DTAAUT(*INDIR) OBJAUT(*INDIR) CRTOBJAUD(*NONE)
CRTLF FILE(DATALIB/CUSTCDTL) SRCFILE(DATALIB/QDDSSRC)CUSTCDTL is the name of the logical file, and DATALIB/QDDSSRC is the source physical file that contains the member CUSTCDTL. Example: DDS for logical file CUSTCDTL shows the DDS definition of such a logical file.
Optionally, you can select a subset of fields you want to copy to QNetWare. Just put the fields you need into the logical file. You can also specify an ordering sequence on the logical file.
There is no need to specify other field definitions. The logical file is built over the physical file and copies all the field definitions from it.
DSPFD FILE(CUSTCDTL) TYPE(*RCDFMT)
The resulting display for the example logical file CUSTCDTL shows that it has a record length of 60:
Record Format Level
Format Fields Length Identifier
CUSREC 11 60 3B84438D4C428
Text . . . . . . . . . . . . . . . . . . . :
Total number of formats . . . . . . . . . . : 1
Total number of fields . . . . . . . . . . . : 11
Total record length . . . . . . . . . . . . : 60
CRTPF DATALIB/CUSTSTMF RCDLEN(60)
CPYF FROMFILE(CUSTCDTL) TOFILE(CUSTSTMF) MBROPT(*ADD) FMTOPT(*NOCHK)
FMTOPT(*NOCHK) is required because the record formats of the database files are different.
Copy To Stream File (CPYTOSTMF) Type choices, press Enter. From database file member . . 1 > '/QSYS.LIB/DATALIB.LIB/CUSTSTMF.FILE /CUSTSTMF.MBR' To stream file . . . . . . . . 2 > '/QNetWare/SRVNW0A.SVR/SYS/DTA/CUSTCDT.DAT' Copy options . . . . . . . . . . *NONE *NONE, *ADD, *REPLACE Data conversion options . . . 3 *AUTO *AUTO, *TBL, *NONE Database file CCSID . . . . . 4 > 37 1-65533, *FILE Stream file codepage . . . . . 5 > 850 1-32767, *STMF End of line characters . . . . . *CRLF *CRLF, *LF, *CR, *LFCR... Bottom F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More keys
In this case you would use the drive letter as a link to CUSTCDT.DAT.
DSPMFSINF OBJ('/QNetWare/SRVNW0A.SVR/SYS/DTA')This example converts the database file data from CCSID 37 to ASCII code page 850. 5