Unicode input spooled files can be defined in two ways:
1.As unicode AFPDS spooled files. This is recommended.
2.As special InterForm400 formatted *SCS unicode spooled files. That was recommended before AFPDS support was added in InterForm400. These spooled files are not compatible with some OS400 functions e.g. DSPSPLF.
The second alternative is described below.
If you want to change your programs to print certain unicode fields from a database you can do it in this manner:
1. The data fields must of course be defined as unicode. Here is an example:
Columns . . . : 1 80 Browse SEU==> FMT PF .....A..........T.Name++++++RLen++TDpB......Functions+++++++++++++++ *************** Beginning of data ********************************** 0001.00 A UNIQUE 0002.00 A R CUSTMSTR 0003.00 A CUSTNO 5 0 TEXT('Customer number') 0004.00 A NAME 30G CCSID(13488 15) 0005.00 A ADR1 30G CCSID(13488 15) 0006.00 A ADR2 30G CCSID(13488 15) 0007.00 A ADR3 30G CCSID(13488 15) 0008.00 A ADR4 30G CCSID(13488 15) 0009.00 A K CUSTNO ****************** End of data *************************************
F3=Exit F5=Refresh F9=Retrieve F10=Cursor F11=Toggle F12=Cancel F16=Repeat find F24=More keys
|
The unicode fields are defined as type G. The length is measured in unicode characters so the fields above with length 30 actually takes up 60 bytes.
2. The printer file must be changed so you e.g. can change between unicode output and normal output e.g. via an indicator (in the example below indicator 90 is used):
Columns . . . : 1 80 Browse SEU==> FMT DP .....AAN01N02N03T.Name++++++RLen++TDpBLinPosFunctions+++++++++++++ *************** Beginning of data ******************************** 0001.00 A REF(CUSTMSTP) 0002.00 A R CUST 0003.00 A CUSTNO R 10SPACEB(2) 0004.00 A 90 NAMEDS 63 16 0005.00 A N90 NAME R 16 0006.00 A 90 ADR1DS 63 16SPACEB(1) 0007.00 A N90 ADR1 R 16SPACEB(1) 0008.00 A 90 ADR2DS 63 16SPACEB(1) 0009.00 A N90 ADR2 R 16SPACEB(1) 0010.00 A 90 ADR3DS 63 16SPACEB(1) 0011.00 A N90 ADR3 R 16SPACEB(1) 0012.00 A 90 ADR4DS 63 16SPACEB(1) 0013.00 A N90 ADR4 R 16SPACEB(1) ****************** End of data ***********************************
F3=Exit F5=Refresh F9=Retrieve F10=Cursor F11=Toggle F12=Cancel F16=Repeat find F24=More keys
|
The fields with ‘DS’ as the end are the unicode fields so you can use indicator 90 so activate unicode output.
The spooled file also must have USRDFNOPT('IF-UCS2') which could be achieved via OVRPRTF before you generate the spooled file.
3. The printer program should be changed.
The program must be able to switch between normal output and unicode output. In this example it is done via indicator 90.
The program in this case also defines the unicode fields like this:
Columns . . . : 1 100 Browse SEU==> FMT ** ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... *************** Beginning of data *********************************** 0001.00 H DECEDIT('0,') DATEDIT(*DMY.) DFTACTGRP(*NO) ACTGRP('APF3812') 0002.00 FCUSTMSTP IF E K DISK 0003.00 FCUSTPRTF O e printer 0004.00 DNameDS DS 0005.00 D 1 inz(X'0E') 0006.00 DNAME 0007.00 D 2 inz(X'000F') 0008.00 DADR1DS DS 0009.00 D 1 inz(X'0E') 0010.00 DADR1 0011.00 D 2 inz(X'000F') 0012.00 DADR2DS DS 0013.00 D 1 inz(X'0E') 0014.00 DADR2 0015.00 D 2 inz(X'000F') 0016.00 DADR3DS DS 0017.00 D 1 inz(X'0E') 0018.00 DADR3 0019.00 D 2 inz(X'000F')
F3=Exit F5=Refresh F9=Retrieve F10=Cursor F11=Toggle F12=Cancel F16=Repeat find F24=More keys
|
So this illustrates one way of adding the <Shift In> and <Shift Out> sequences to the unicode fields (which in this example ends with ‘DS’).
ERP vendors or other software providers, that would like to use InterForm400 for unicode printing can contact InterForm A/S or the local InterForm400 contact as tools may be provided to ease the changes necessary to your sources.
A problem related to the special unicode spooled is, that unicode characters are represented by 2 bytes and thus cannot be fully displayed via a normal DSPSPLF command. To help you to around that problem InterForm400 is delivered with a command simular to DSPSPLF: APF3812/DSPUNISPLF.
Where a normal DSPSPLF command will not show any unicode text the DSPUNISPLF command will display any unicode character that is represented in the code page of the current 5250 session.
The DSPUNISPLF command is included in the APF3812/APFWRKOUTQ command so if you display an *SCS spooled file with USRDFNOPT('IF-UCS2') the DSPUNISPLF command is used instead of DSPSPLF.
When using the special *SCS unicode spooled file you will normally merge them in InterForm400, but you might want to print them out directly without merging.
The special unicode sequences are not supported by the standard printing process so you need to do a small change of the used output queues (for remote writers) or printer devices to print out the *SCS unicode spooled files.
InterForm400 is delivered with a special program, APF3812/IFWTRTRP, that can be used as a Data Transfer Program with the parameter: USRDTATFM(APF3812/IFWTRTRF) on either output queue or printer device.
For any spooled file that does not have USRDFNOPT(‘IF-UCS2') the program will run as if it was not there. Only spooled files with this option will be inspected and any unicode text will printed (all supported characters will be printed).
If you are using a data transfer program you will be forced to specify TRANSFORM(*NO) i.e. disabling host print transform. That is no problem as host print transform is done in the called program (IFWTRTRF).
If you have defined your own workstation customizing object (*WSCST) and you want to use that combined with a data transfer program like above you will need to do a workaround to make it work.
Please note, that this is a problem only if you are using MFRTYPMDL(*WSCST) combined with a *WSCST object in field WSCST on the output queue (for remote writers) or printer device description. It is NOT a problem if you are using any of the predefined *WSCST objects in QSYS, that are selected via the MFRTYPMDL parameter on output queues and printer devices.
If you try to combine a *WSCST object with MFRTYPMDL(*WSCST) you will get the error message: CPD83F0 Device class of the customizing object mismatched.
The workaround can according to IBM be done by replacing any of the predefined *WSCST objects in QSYS (use one that you would never use e.g. QWPIBM4019 might be a candidate..) with your own *WSCST object. It is a very good idea to just rename the *WSCST object in QSYS and then move or copy you own *WSCST object into QSYS - with that same name..
Note, that the workaround have the problem, that you will need to do this each time you upgrade the machine you run on..