Troubleshooting
Problem
This document provides instructions for retrieving and modifying the WSCST source code for the system-supplied QSYS/QWPDEFAULT *WSCST object. This is a special workstation customizing object that can be used with Host Print Transform (HPT) to convert *SCS spooled files to plain ASCII text. The QWPDEFAULT *WSCST object is also known as the generic or default workstation customizing (WSCST) object.
Resolving The Problem
This document provides instructions for retrieving and modifying the WSCST source code for the system-supplied QSYS/QWPDEFAULT *WSCST object. This is a special workstation customizing object that can be used with Host Print Transform (HPT) to convert *SCS spooled files to plain ASCII text.
The QWPDEFAULT *WSCST object is also known as the generic or default workstation customizing (WSCST) object.
The instructions in this document are useful if you are using a printer that only handles simple ASCII data and are getting extraneous characters in the printed output, or if you want to convert an *SCS spooled file into an ASCII text file.
This document was last updated on 18 September 2014.
Caution: These instructions are provided as is. Any assistance with editing the Workstation Customization Table must be done through a consulting agreement. |
The generic WSCST source can be retrieved with the Retrieve WSCST Source (RTVWSCST) command, or you can copy it from the example in this document and paste it into a member in your QTXTSRC file. Use the following operating system command to retrieve the WSCST source code to a member in your QTXTSRC file:
RTVWSCST DEVTYPE(*TRANSFORM) MFRTYPMDL(*NONE) SRCMBR(member-name)
SRCFILE(*LIBL/QTXTSRC)
TEXT('Generic Host Print Transform WSCST source code')
Note: The generic Host Print Transform (HPT) WSCST source code can also be retrieved by setting the Manufacturer type and model (MFRTYPMDL) parameter to *WSCSTA3, *WSCSTA4, *WSCSTA5, *WSCSTB4, *WSCSTB5, *WSCSTCONT80, *WSCSTCONT132, *WSCSTEXECUTIVE, *WSCSTLEDGER, *WSCSTLEGAL, *WSCSTLETTER, or *WSCSTNONE.
Once retrieved, the source physical file member will contain the following source code:
:WSCST DEVCLASS=TRANSFORM.
:TRNSFRMTBL.
:INITPRT
DATA ='00'X.
:SPACE
DATA ='20'X.
:CARRTN
DATA ='0D'X.
:FORMFEED
DATA ='0C'X.
:LINEFEED
DATA ='0A'X.
:EWSCST.
Common Modifications to the Generic or Default WSCST Source Code
In some cases, you may have a need to make modifications to the generic or default WSCST source code, for instance:
1. | Modifying the Initialize Printer (INITPRT) tag to send no printer controls (''X), rather than sending a NULL byte ('00'X). |
2. | Modifying the Carriage Return (CARRTN) tag to send no printer controls (''X), rather than sending a Carriage Return (CR or '0D'X). |
3. | Modifying the Line Feed (LINEFEED) tag to send a Carriage Return and Line Feed (CR/LF or '0D0A'X) rather than sending only a Line Feed (LF or '0A'X). |
For example:
:WSCST DEVCLASS=TRANSFORM.
:TRNSFRMTBL.
:INITPRT /* Do not send a NULL byte ('00'X) using */
DATA =''X. /* the INITPRT tag. */
:SPACE
DATA ='20'X.
:CARRTN /* Do not send a Carriage Return (CR or */
DATA =''X. /* '0D'X for the CARRTN tag. */
:FORMFEED
DATA ='0C'X.
:LINEFEED /* Send a Carriage Return and Line Feed */
DATA ='0D0A'X. /* (CR/LF or '0D0A'X) for the LINEFEED tag. */
:EWSCST.
Modifications for Windows Code Page 1252 (Windows, Latin 1)
By default, Host Print Transform (HPT) will convert spooled files from the EBCDIC code page specified in the QCHRID (Graphic character set and code page) system value to the default ASCII code page that corresponds to the EBCDIC code page. For example, if the QCHRID system value is set to 037 (USA/Canada - CECP) then the EBCDIC text will be translated to default ASCII code page 437 (IBM-PC).
Windows applications, such as Notepad and WordPad, typically use ASCII code page 1252 (Windows, Latin 1) instead of ASCII code page 437. There are several code points that are different between code pages 1252 and 437, which can cause several characters to be translated incorrectly if you are intending to send spooled files to a PC and import them into a Windows application instead of printing them on a printer.
This issue can be resolved by modifying the WSCST source code to include an EBCDIC-to-ASCII Table Entry (EBCASCTBLE) tag to have HPT translate from EBCDIC code page 037 to ASCII code page 1252. For example:
:WSCST DEVCLASS=TRANSFORM.
:TRNSFRMTBL.
:INITPRT /* Do not send a NULL byte ('00'X) using */
DATA =''X. /* the INITPRT tag. */
:SPACE
DATA ='20'X.
:CARRTN /* Do not send a Carriage Return (CR or */
DATA =''X. /* '0D'X for the CARRTN tag. */
:FORMFEED
DATA ='0C'X.
:LINEFEED /* Send a Carriage Return and Line Feed */
DATA ='0D0A'X. /* (CR/LF or '0D0A'X) for the LINEFEED tag. */
:EBCASCTBL.
:EBCASCTBLE /* Translate text from EBCDIC code page 37 */
EBCDICCP = 37 /* (USA/Canada CECP) to ASCII code page */
ASCIICP = 1252 /* 1252 (Windows, Latin 1) for use with */
DATA = /* Windows applications */
'20A0E2E4E0E1E3E5E7F1A22E3C282B7C26E9EAEBE8EDEEEFECDF21242A293BAC'X
'2D2FC2C4C0C1C3C5C7D1A62C255F3E3FF8C9CACBC8CDCECFCC603A2340273D22'X
'D8616263646566676869ABBBF0FDFEB1B06A6B6C6D6E6F707172AABAE6B8C6A4'X
'B57E737475767778797AA1BFD0DDDEAE5EA3A5B7A9A7B6BCBDBE5B5DAFA8B4D7'X
'7B414243444546474849ADF4F6F2F3F57D4A4B4C4D4E4F505152B9FBFCF9FAFF'X
'5CF7535455565758595AB2D4D6D2D3D530313233343536373839B3DBDCD9DA20'X.
:EEBCASCTBL.
:EWSCST.
Notes:
1. | The DATA specified in the EBCASCTBLE tag for EBCDICCP 37 and ASCIICP 1252 was derived from the CHRID(*N 1140) to CHRID(*N 1252) best fit translation table (the QA6YBFA93 *TBL object in library QUSRSYS) because there is no system-supplied translation table from EBCDIC code 37 to ASCII code page 1252, and because EBCDIC code pages 37 and 1140 are identical except for EBCDIC code point '9F'X. |
2. | Code point '9F'X is the Euro Symbol in code page 1140 and is the International Currency Symbol in code page 37. Both of these symbols exist in ASCII code page 1252, so the DATA string has been modified to map code point '9F'X to code point '80'X (International Currency Symbol) instead of code point 'A4'X (Euro Symbol) in ASCII code page 1252. |
Modifications for Windows Code Page 1253 (Windows, Greek)
By default, Host Print Transform (HPT) will convert spooled files from the EBCDIC code page specified in the QCHRID (Graphic character set and code page) system value to the default ASCII code page that corresponds to the EBCDIC code page. For example, if the QCHRID system value is set to 037 (USA/Canada - CECP) then the EBCDIC text will be translated to default ASCII code page 437 (IBM-PC).
Some Windows users will need to convert from a non-Latin 1 EBCDIC code page to a non-Latin 1 ASCII code page for their Windows applications, such as converting from EBCDIC code page 875 (Greece) to ASCII code page 1253 (Windows, Greek).
This issue can be resolved by modifying the WSCST source code to include an EBCDIC-to-ASCII Table Entry (EBCASCTBLE) tag to have HPT translate from EBCDIC code page 875 to ASCII code page 1253, and including a custom translation table based on the Q875BFA94 *TBL object in library QUSRSYS, which is the "CHRID(*N 875) to CHRID(*N 1253) best fit table". For example:
:WSCST DEVCLASS=TRANSFORM.
:TRNSFRMTBL.
:INITPRT /* Do not send a NULL byte ('00'X) using */
DATA =''X. /* the INITPRT tag. */
:SPACE
DATA ='20'X.
:CARRTN /* Do not send a Carriage Return (CR or */
DATA =''X. /* '0D'X for the CARRTN tag. */
:FORMFEED
DATA ='0C'X.
:LINEFEED /* Send a Carriage Return and Line Feed */
DATA ='0D0A'X. /* (CR/LF or '0D0A'X) for the LINEFEED tag. */
:EBCASCTBL.
:EBCASCTBLE /* Translate text from EBCDIC code page 875 */
EBCDICCP = 875 /* (Greece) to ASCII code page 1253 */
ASCIICP = 1253 /* (Windows, Greek) */
DATA =
'20C1C2C3C4C5C6C7C8C95B2E3C282B2126CACBCCCDCECFD0D1D35D242A293B5E'X
'2D2FD4D5D6D7D8D9DADB7C2C255F3E3FA8A2B8B9A0BABCBEBF603A2340273D22'X
'A1616263646566676869E1E2E3E4E5E6B06A6B6C6D6E6F707172E7E8E9EAEBEC'X
'207E737475767778797AEDEEEFF0F1F3A3DCDDDEFADFFCFDFBFEF2F4F5F6F7F8'X
'7B414243444546474849ADF9C0E091AF7D4A4B4C4D4E4F505152B1BD20B792A6'X
'5C20535455565758595AB2A72020ABAC30313233343536373839B3A98020BB20'X.
:EEBCASCTBL.
:EWSCST.
Notes:
1. | The DATA specified in the EBCASCTBLE tag for EBCDICCP 875 and ASCIICP 1253 was derived from the CHRID(*N 875) to CHRID(*N 1253) best fit translation table (the Q875BFA94 *TBL object in library QUSRSYS). |
2. | The Q875BFA95 *TBL automatically converts Code point 'FC'X, which is the Euro Symbol in code page 875, to '80'X, which is the Euro Symbol in code page 1253. |
Historical Number
8700236
Was this topic helpful?
Document Information
Modified date:
18 December 2019
UID
nas8N1010129