Emulator Programming Reference
Emulator Programming Reference
SC31-8837-01
SC31-8837-01
Note
Before using this information and the product it supports, read the information in Notices on page 139.
Contents
Figures . . . . . . . . . . . . . . . v
Tables . . . . . . . . . . . . . . . vii
About This Book. . . . . . . . . . . ix
Who Should Read This Book. . .
How to Use This Book . . . . .
Command Syntax Symbols . .
Where to Find More Information .
Online Help . . . . . . .
Messages and Alerts . . . . .
Personal Communications Library
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. ix
. ix
. ix
. . . . . . x
. . . . . . x
. . . . . . x
. . . . . . xi
15
15
16
16
16
16
16
16
16
16
16
17
17
17
18
20
20
21
21
21
21
22
WordPad . . . . . . . . .
WordPro . . . . . . . . .
Updating Linked Files . . . . .
Inactivity Timeout for Communication
Considerations . . . . . . . .
Virtual Memory . . . . . . .
Emulator Session Icons . . . .
Disabling CDRA Tables . . . .
. .
. .
. .
Links
. .
. .
. .
. .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
22
22
22
22
23
23
23
23
25
25
26
28
28
28
29
30
32
32
38
40
40
40
41
41
42
55
56
57
58
58
59
60
60
61
61
62
62
62
65
66
72
73
73
73
76
94
iii
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 95
. 96
. 96
. 96
. 97
. 98
. 98
. 98
. 98
. 99
. 99
. 100
. 100
. 101
. 101
. 101
. 101
. 101
. 101
. 101
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
101
102
102
102
102
103
103
103
104
104
104
105
105
iv
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
107
107
108
108
108
109
110
116
117
.
.
. 117
. 117
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
121
122
122
122
122
123
123
123
123
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
127
127
127
128
128
128
.
.
.
.
129
130
131
131
132
. 132
. 133
. 133
. 134
. 135
. 141
Index . . . . . . . . . . . . . . . 143
Figures
1.
2.
3.
4.
5.
6.
vi
Tables
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
.
. 17
18
. 20
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 70
21
25
66
67
67
68
68
68
69
70
16.
17.
18.
19.
20.
21.
22.
23.
24.
vii
viii
[ ]
...
Ellipsis after an argument indicates that you can repeat the preceding item
any number of times.
For 3270, a slash must precede the Time Sharing Option Extensions
(TSO/E) password. A slash must also precede parameters of DOS
commands entered from the command line. For 5250, a slash must precede
parameters of IBM DOS commands entered from the command line.
All directives, operands, and other syntax can be typed in either uppercase or
lowercase, unless otherwise indicated.
ix
Online Help
The help facility describes how to install, configure, and use Personal
Communications. Online help is very extensive and includes information about
every aspect of configuring and using Personal Communications.
Use help to obtain the following information:
v Menu choices
v Operation procedures
v Operations in windows
v Meanings of the terms displayed in windows
v Causes of errors and the corresponding actions to take
v Mouse-based operations
v Operation without a mouse
v Detailed explanations of specific terms
v Further technical information about Personal Communications
v Detailed explanations of operator information area (OIA) messages
To display online help, select choices from the Help menu or press F1.
You can use Personal Communications online help just as you use the online help
for Windows.
OIA Messages
Personal Communications displays messages in the operator information area
(OIA) or in a pop-up window. Messages from Personal Communications are
displayed in the message window; messages from the host system regarding the
condition of the session are displayed in the OIA of the session window.
The OIA is the bottom line of the session window. An OIA message indicates the
status of Personal Communications as well as information about the workstation,
host system, and attachment method.
All of the OIA indicators, reminders, and messages are described in the online
help. To view this information:
1. Select Index from the Help menu.
2. Select The operator information area messages.
To look up a specific OIA message, select Search. When the Search window
appears, type the letters that appear in the OIA. For example, MACH or PROG. If a
lightning bolt appears, type COMM.
3. Double-click the index entry that matches your search.
4. Scroll through the window until you find the number that appears in your
OIA.
Alerts
Alerts may be generated which correspond to specific Personal Communications
messages. Refer to the Administrators Guide and Referencefor more information.
xi
v IBM Personal Communications for Windows, Version 5.6 Host Access Class Library,
SC31-8685-03
v IBM Personal Communications for Windows, Version 5.6 Configuration File Reference,
SC31-8655-05
These books are also available (except in DBCS versions) in PDF format and are
optionally installed or viewed from the CD-ROM.
In addition to the printed books, there are HTML documents provided with
Personal Communications:
Host Access Class Library for Java
This HTML document describes how to write an ActiveX/OLE
2.0compliant application to use Personal Communications as an
embedded object.
Host Access Beans for Java
This HTML document describes Personal Communications emulator
functions delivered as a set of Java Beans.
xii
Highlights
X.25 APPC 3270 via Hayes AutoSync
3270 via AS/400
Dependent Logical Unit Requester (DLUR)
SDLC Synchronous Data Link Control
3270 via AS/400 (passthru)
APPC 3270 via SDLC
Dependent Logical Unit Requester (DLUR)
SNA/IP
LU 0, 1, 2, 3
APPC 3270
LU 0, 1, 2, 3 via DLUR
IBM ISA/MCA WAC
Synchronous Data Link Control
3270 via AS/400 (passthru)
APPC 3270 via SDLC
Dependent Logical Unit Requester (DLUR)
X.25 Qualified Logical Link Control
X.25 3270 via AS/400
APPC 3270 via X.25
X.25 DLUR
Communications Server Client
Communications Server
IBM-EEDLC
LU (0, 1, 2, 3) via DLUR
APPC 3270
OEM LU (0, 1, 2, 3)
3270 via AS/400 (passthru)
APPC 3270
Dependent LU Requester (DLUR)
v AS/400 Connections
LAN LAN via IEEE 802.2
Telnet5250 over TCP/IP
VT over Telnet
Telnet5250 over IPX/SPX
5250
Twinaxial Data Link Control (APPC)
Twinaxial Data Link Control (Console)
COM port
SNA-over-Async
Hayes AutoSync
SNA-over-Async (Console)
VT over Async
VT over Telnet
Telnet 5250
X.25 Hayes AutoSync
SDLC Synchronous Data Link Control
SNA/IP
5250
IBM ISA/MCA WAC
Synchronous Data Link Control (WAC)
X.25 Qualified Logical Link Control
IBM-EEDLC
5250
OEM APPC 5250
5250
Highlights
COM port
VT-over-Async
VT over Telnet
v S/3X Emulator Connections
5250
Twinaxial Data Link Control (Console)
v Client/Server Connections
LAN LAN via IEEE 802.2
Twinaxial
Twinaxial Data Link Control (APPC)
COM port
SNA-over-Async
Hayes AutoSync
X.25
SDLC Synchronous Data Link Control
IBM WAC
Synchronous Data Link Control
X.25
AnyNet SNA over TCP/IP
APPC
Enterprise Extender
HPR over IP
v Configuration of SNA Node (APPN) Sessions
Emulator
Client/server applications
v SNA Node Operations
Starting and stopping resources
Deleting resources
Displaying resource information
Changing session limits
Initiation of path switches
v Log Viewer
View Message Log, Trace Log, and Merged Log files
Summary and Detail views
Set default Message Log size and location
Filter and search Log files
Message Log entries Help
v Trace Capability
3270/5250 emulator data
APPN and APPC API data
Connectivity data, such as LAN or SDLC
User services data, such as node initialization
v APPC Applets
Display SNA sense data (GETSENSE)
Transfer files (AFTP and AFTPD)
Check connection (APING)
v Sample Programs
Located in \Personal Communications\samples subdirectory
v Installation and Configuration
Partial installation option
Program sharing on a network server
Automatic detection of installed communication adapters
Dynamic change of communication configurations
Automatic Dial Facility (Async (IGN), SDLC, Home3270, SNA-A)
Chapter 1. Personal Communications Highlights
Highlights
Silent Installation
ASCII SNA-node configuration
Verification of ASCII configuration
v OEM Adaptor Cards
An open API enables vendors and other equipment manufacturers (OEMs) to
provide adapter cards that allow for additional connectivity options, for
example, additional X.25, ISDN, SDLC or twinax support.
v Host Session Function
Up to 26 sessions
Variable screen size and automatic font scaling
Function settings (of the host code page, for example) for each session
v Host Graphics Support
Built-in vector graphics support for GDDM and other graphics applications
v File Transfer Function
Easy operation through graphical user interface (GUI) windows
Batch transfer of multiple files
Concurrent file transfer through multiple sessions
Background file transfer
File transfer invocation by macro
OfficeVision/MVS Import/Export functions
VT File Transfer (XModem and YModem)
v Edit (Cut and Paste) Function
You can use the clipboard to cut, copy, and paste a selected area. In addition,
you can paste data in other applications, such as spreadsheet programs, that
support the PasteLink function.
Support of spreadsheet data format (Sylk, Biff3, Wk3 formats)
Copy Append
Paste Next
Paste to Trim Rectangle
Paste Stop at Protected Line
v Graphical User Interface (GUI)
Customizable 3D iconic tool bar
3D-button hotspots
Pop-up keypad
Macro function, including record and play
VBScripts, including record and play
Keyboard-function setup and remapping
Mouse-button-function setup and remapping
Display setup (cursor type, graphics, sound, colors, for example)
Automatic font size adjustment or fixed font size
Window-appearance setup
Menu-bar customization
3270 Light Pen emulation by using a mouse
Status bar with history
Page setup (Text and Graphics)
Revised Configuration Dialog
Online help
v Print Function
Printer session (for PC/3270: SCS, LU 3, or non-SNA)
Graphics local print
Printing with the Windows NT printer drivers
Print function by printer definition table (PDT)
Multiple host-print functions in multiple sessions
Print-job control by SNA bracket timeout
Highlights
PDF-to-PDT conversion tool
PC400 print function by OS/400 Host Print Transform (HPT)
PC400 printing supported by the AS/400 Advanced Print Support Utility
v Programming Interfaces
16/32-bit Emulator High-Level Language Application Programming Interface
(EHLLAPI)
16/32-bit Dynamic Data Exchange (DDE)
32-bit Node Operations Facility (NOF)
16/32-bit Personal Communications API (PCSAPI)
32-bit Advanced Program-to-Program Communication (APPC)
32-bit Common Programming Interface for Communications (CPI-C)
32-bit Automation Object API
32-bit ActiveX/OLE 2.0
Host Access Beans for Java
ActiveX Controls
v PC400 Client Function
Data transfer
PC Organizer
Text Assist
Enhanced Programmable Terminal User Interface (ENPTUI)
Highlights
Log Viewer
The Personal Communications log viewer utility enables you to view, merge, sort,
search, and filter information contained in message and trace logs. Use the log
viewer during problem analysis to work with message and trace log entries. The
default name of the message log output file is PCSMSG.MLG; its file extension
must be .MLG. The file extension for trace logs must be .TLG.
To view message or trace logs:
1. From the Administrative and PD Aids subfolder, click Log Viewer; or, from an
active session, click Actions Launch Log Viewer.
2. From the list of logged messages, double-click a message to display the
message text.
For more information about log viewer functions, see Chapter 8, Log Viewer
Functions on page 127.
Trace Facility
The Personal Communications trace facility enables you to log trace information
for certain Personal Communications functions.
To start a trace, perform the following steps:
1. From the Administrative and PD Aids folder, click Trace Facility; or, from an
active session, click Actions Launch Trace Facility. The trace status on the
title bar displays the current state:
Problem Analysis
Active Trace data is being collected by the trace facility.
Inactive
No trace data is being collected.
2. From the main dialog box, click Set Up to set the desired trace system
parameters.
3. Click OK to return to the main trace dialog box.
4. From the main trace dialog box, select the type of data you want to trace from
the Function Name, Component Name, and Trace Option list boxes.
Function Name
A specific set of Personal Communications features, such as 3270/5250
Emulator or User Services.
Component Name
The name of a specific part of a function, such as API data (for the
5250 Emulator function) or Node Initialization (for the User Services
function).
Trace Options
The options associated with a particular component, such as EHLLAPI
(for the API component) or API trace (for the Node Initialization
component).
5. Start tracing data by clicking Start, or apply changes to the trace options by
clicking Apply.
6. Run the operation that you want to trace.
7. Optionally, stop the trace by clicking Stop.
8. Save the trace data to your hard disk by clicking Save.
9. Click Format to specify a formatted trace file name and to format the trace
data. The Information Bundler utility should be used immediately after the
trace is complete to ensure that the correct information is gathered.
Note: If you have changed the default path for the formatted trace file, the
Information Bundler will not find the trace information. Copy the trace
files to the system-class application data directory.
10. Click OK.
11. Click Clear to clear the trace buffer where you saved a trace.
12. Use the log viewer to view the formatted trace log.
Information Bundler
The Personal Communications Information Bundler utility gathers system files,
trace and log files, and registry information and creates a self-extracting .EXE file.
This .EXE file is sent to support personnel using FTP for problem resolution. This
utility should be executed immediately after the trace is complete to ensure that
the correct information is gathered. To use the information bundler utility:
1. From the PD Aids folder in the Personal Communications program group,
double-click the Information Bundler icon; or, from an active session, click
Actions Launch Information Bundler.
2. A .EXE file containing system and Personal Communications information is
created in the Personal Communications system-class application data directory.
By default this file is called X12345.EXE. Refer to the installation documentation
for the location of the system-class application data directory for each Windows
operating system.
10
Problem Analysis
Internet Service
The Internet Service utility enables you to send the .EXE file containing diagnostic
data collected by the Information Bundler to an FTP server. This utility will not
work unless TCP/IP is configured and you have a direct connection to the internet.
To use Internet Service:
1. Double-click the Internet Service icon located in the Personal Communications
program group; or, from an active session, click Actions Launch Internet
Service.
The Internet Service window contains four data fields that must have valid
values before you can submit your problem report.
2. Verify that the FTP Address field contains the default address
testcase.software.ibm.com. This is the service anonymous FTP server.
3. Type your email address in the field provided.
4. In the Problem Determination Filename field, type the file name and path of
the .EXE file created with the Information Bundler. This file is located in the
Personal Communications installation directory.
5. In the PMR Number field, type the PMR number that you received as a result
of contacting IBM support personnel.
6. When all fields in the window have been filled with valid values, click
Transmit to submit your problem determination information.
11
Problem Analysis
12
13
14
Power Management
Personal Communications complies with Windows 2000 Power Management
requirements for handling sleep events. This support minimizes session
interruptions due to network disconnections caused by sleep on Windows 2000
and subsequent versions.
Note: In this context, the term sleep means that the system is on standby or is in
hibernation. To applications such as Personal Communications, standby and
hibernation are the same.
The benefits of this power management system include the following:
v Power consumption is reduced using the Advanced Configuration and Power
Interface (ACPI). The system is able to enter a lower power state (or sleep mode)
that appears to be off but is still powered enough to enable the system to power
up (or wake) to handle timed events or device-related needs such as receiving a
fax.
v The PC is instantly available to the user because it can rapidly return from a low
power state to a fully-functional state.
v Customers can rely on their PCs to power down and up in a way that is easily
understood and predictable.
The following Personal Communications components are affected by this Power
Management arrangement:
v Emulator sessions
v Transfers that utilize an emulator session
Sleep Permission
Before entering a sleep state (stand by or hibernate), Windows 2000 normally
requests permission from the applications that are running. When one or more
emulator sessions are connected and Windows signals that the user is available for
interaction, Personal Communications asks the user to grant or deny sleep
permission. If the user grants permission, Personal Communications logs the event
and then notifies Windows. When user interaction is not possible, sleep permission
is denied without permission from the user.
When Personal Communications is not in the connected state, Windows 2000 may
automatically sleep, without prompting the user for permission.
Critical Sleep
When Windows 2000 resumes after an emergency suspension, Personal
Communications might display and log a warning message.
15
Scroll Bar
When you click Font from the Appearance menu in the host session window and
select Fixed Size from the Select Display Font window, the entire operator
information area might not appear on the screen; the session-window size is
restricted to be smaller than the screen size. If you specify With Scroll Bar, the
OIA will not scroll.
Print Processing
Following are some additional considerations when printing with PC400.
Printable Area
Depending on the printer driver used, it might not be possible to use the entire
surface of the paper for printing.
If the printing position is beyond the printable area, the page is automatically
changed. When using a printer driver that allows you to set the margins, specify
the minimum margins, thus maximizing the printable area.
PDT Mode
Printing using a PDT file is restricted as follows:
v Only the fonts specific to the printer being used are supported.
v Graphics are printed using the Windows printer driver selected in Printer
Setting, regardless of the PDT mode.
v Postscript printers are not supported. There are no PDF files for Postscript
printers.
16
Key
Edit Cut
Ctrl+X
Edit Copy
Ctrl+C
Edit Paste
Ctrl+V
Enter
Enter
New Line
Right Ctrl
The PF7 and PF8 remain mapped to Roll Up and Roll Down, respectively.
17
18
Function of Key
Key
Alternate Cursor
Ctrl+F11
Attention
Esc
Backspace
(Backspace)
Backtab
Shift+|
Backtab Word
Alt+
Begin Bold*
Ctrl+B
Begin of line*
Ctrl+4(pad)
Begin Underscore*
Ctrl+U
Bottom of Page*
Ctrl+2(pad)
Carrier Return
Ctrl+Enter or
Ctrl+ (pad) or
Ctrl++ (pad)
Center Text*
Ctrl+C
Clear
Pause
Cursor Blink
Ctrl+F10
Cursor Down
or 2(pad)
Cursor Left
or 4(pad)
Cursor Right
or 6(pad)
Cursor Up
or 8(pad)
Delete Character
Delete or .(pad)
Delete Word
Ctrl+Delete or
Ctrl+.(pad)
Alt+Insert
Dup
Shift+Insert
Edit Copy
Ctrl+Insert
Edit Cut
Shift+Delete
Edit Paste
Shift+PageDown or
Ctrl+Shift+Insert
Edit Undo
Alt+ (Backspace)
End Bold/Underscore*
Ctrl+J
End of line*
Ctrl+6(pad)
End of page*
Ctrl+P
Enter/Control
Right Ctrl
Key
Erase EOF
End or 1(pad)
Erase Input
Alt+End
Alt+ or
Alt+2(pad)
Fast Cursor Up
Alt+ or
Alt+8(pad)
Field Exit
Enter(pad) or
(Enter)
Field Mark
Shift+Home
Field Minus ()
(pad)
+ (pad)
Ctrl+H
Ctrl+Y
Help
Alt+F1
Home
Home or 7(pad)
Host Print
Ctrl+Pause
Insert
Insert or
0 (pad)
Insert Symbol*
Ctrl+A
Jump Next
Alt+PageUp
Mark Down
Shift+
Mark Left
Shift+
Mark Right
Shift+
Mark Up
Shift+
Ctrl+
Ctrl+
Ctrl+
Move Mark Up
Ctrl+
Next Column*
Ctrl+D
Next Stop*
Ctrl+N
Pause
Ctrl+F7
PF1 to PF12
F1 to F12
PF13 to PF24
Shift+F1 to F12
Play
Ctrl+F6
Quit
Alt+Left Ctrl
Record
Ctrl+F5
Required Backspace
Ctrl+ (Backspace)
Required Space*
Ctrl+Space
Required Tab*
Ctrl+|
Reset/Control
Left Ctrl
Roll Down
9(pad) or PageUp
19
Key
Roll Up
3(pad) or PageDown
Rule
Ctrl+Home
Stop Code*
Ctrl+S
System Request
Shift+Esc
Tab Field
|
Tab Word
Alt+
Test Request
Alt+Pause
Top of Page*
Ctrl+8(pad)
Word Underscore*
Ctrl+W
Note:
(pad)
*
Key
Change Screen
Not assigned
Character Advance
Shift+BackSpace
Help
Not assigned
Host Print
Not assigned
PA3
Not assigned
Roll Down
PageUp
Roll Up
PageDown
Printer Setup
Not assigned
Keyboard Setup
You can use Keyboard Setup to modify the function defined for each key on the
keyboard, except some reserved keys.
You can define the following functions for the keys:
v Performing a key function
v Playing a macro
v Entering characters
20
Keyboard File
When you specify a key, you can save the new keyboard layout in a file (.KMP). If
you create two or more keyboard files, you can alternate between them as
required.
To assign a function to a key on the keyboard:
1. Click Preferences Keyboard from the Edit menu
2. When the Keyboard Setup window appears, select Customize.
Note: Select Spain from the Language menu during keyboard setup if you
want Catalan support.
3. Assign the key functions, referring to the online help for detailed instructions.
4. Save your changes and exit the Customize Keyboard window.
5. Click OK after completing the setup.
You can reset either the entire keyboard or specific keys to defaults:
v To reset the entire keyboard, set the current keyboard to IBM Default in the
Keyboard Setup window.
v To reset specific keys, select a key in the Customize Keyboard window and then
select Default from the Current Actions for Selected Key box.
Note: There are seven keys that you cannot redefine and they are gray or dimmed
in Keyboard Setup; these keys are as follows: Alt, AltGr, Print Screen, Scroll
Lock, CapsLock, NumLock, and Shift.
Key
Cut
Ctrl+X
Copy
Ctrl+C
Paste
Ctrl+V
Enter
Enter
New Line
Right Ctrl
The PF7 and PF8 remains mapped to Roll Up and Roll Down, respectively.
21
size font can result in an incorrect display on the screen. To correct the display,
adjust the size of the session object window slightly.
WordPad
Personal Communications session objects created in Microsoft WordPad documents
by the drag-and-drop method cannot be used after the document has been saved
and closed. This limitation might be fixed by some future version of WordPad. For
the present, you should only create Personal Communications objects in WordPad
by using the Insert-Object menu item.
Some versions of Microsoft Word and Microsoft WordPad incorrectly save the state
of embedded objects that are displayed as icons. If you open a document that
contains a Personal Communications session object that was created to display as
an icon, and the object is activated, then it may activate In-Place instead of as a
separate window. This problem might be fixed in future versions of these
containers.
WordPro
If you attempt to open a link to a Personal Communications session in a Lotus
WordPro document, current versions of WordPro may give unpredictable results.
This limitation may be fixed by some future version of WordPro. For the present,
you should only use embedded Personal Communications objects in WordPro
documents. You can use the Display as Icon option if a separate window is
desired.
The value xx, ranging from 1 to 999, is the number of minutes a link remains
connected when there is no activity over it. The default value, InactiveTimeout=0
disables Inactivity Timeout.
22
Note: The Inactivity Timeout function monitors only attention keys (that is, the
Enter, Clear, and PFx keys). We recommend that you set a comparably
longer value for xx if, for example, you expect to key in large amounts of
data on the screen before pressing the Enter key.
Considerations
The following are environmental considerations for Personal Communications.
Virtual Memory
If you receive a message stating that the system is low on virtual memory, increase
the virtual memory paging file. If you get this message as you are trying to open
new host sessions or starting some Personal Communications function such as File
Transfer, the virtual memory settings should be increased. Refer the operating
system documentation for instructions on how to increase the size of the paging
file.
23
24
Type of
Transfer
Products
required on an
AS/400 system Access Method
File
Transfer
Personal
v
Communications
Tools
v
(PCT/400 see
Chapter 5,
v
Transferring
Files on
v
page 95)
v
Data
Transfer
PC
Support/400
V2R2 or V2R3
or OS/400
V3R1 or later1
Sending and
receiving unit
Entire file
Type of
connection
to an
AS/400
system
Display
session
Any SNA
link
25
v Logical database
v Distributed data management (DDM)
When retrieving files, you can:
v Control which records (and which fields within a record) are retrieved.
v Control the ordering of records and the ordering of fields within the record.
v Select a subset of the records.
v Group records into summary records.
v Join two or more files.
v Specify formats and separators of date and time fields.
v Specify the decimal separator character.
You can specify the following output destinations:
v Display
v Disk
v Printer
26
27
v The third part (field) of a source file contains the text of the file. This
part can contain data fields of character type or zoned type only.
Physical source files provide the optimum means of transferring text or
source statements with a workstation.
Note the following considerations when transferring data to and from an AS/400
physical source file:
v To transfer text from the AS/400 system to a workstation, specify the name of
the source file and members in FROM. Specify an asterisk (*) in SELECT. This
informs the AS/400 system that only text is transferred from the source file, with
the order number and date fields excluded.
v The AS/400 text must be stored in the workstation code text file. Normally, a
workstation text editing program can be used to manipulate this workstation
code text file.
v Specify that the file-description file is not to be stored for that workstation file.
Because text is assumed to be a record consisting only of character data, it is not
necessary to define fields.
v To return text from a workstation file to an AS/400 file, specify the type of the
workstation file containing the text. This is almost always workstation code text.
Specification of the file-description file is not required.
v To create a new AS/400 file and its members, specify a valid record length. This
record length must be equal to the maximum record length of the workstation
file, plus 12 bytes. This is because the transfer function automatically creates the
order number and date fields when the file is transferred to the AS/400
members. The order number and date fields together occupy 12 bytes.
Transfer Function
You can transfer only source programs, records, and the following information:
v Information organized for analysis
v Information used for decision making
v Information suited for computer processing
When using a spreadsheet, for example, you might want to use inventory data to
create a cost analysis report. If there is no way to copy the data into the
workstation, you must print the data from the AS/400 system and manually type
it into a workstation file. With the transfer function, however, you can access the
inventory database directly, select only the data needed for the report, process the
data as required, then complete the report using that data.
28
You can also send data from the workstation to the host system for processing by
AS/400 application. When a remote user is authorized to access the AS/400 system
directly, he or she can access the created cost analysis report to compare with their
results.
Figure 1 outlines the joining of two files, transferring the information to the
workstation, and creating a report.
AS/400
Sales
Cost
Workstation
Cost
Product
Run
Transfer
Request
Product
Cost
Inventory
Product
To transfer data by using PC400, you must create a transfer request. A transfer
request provides the necessary information about the data you want to transfer.
Before creating a transfer request, you must have the answers to the following
questions:
Where is the data located?
How much of the data do you want to transfer?
How should the data be sorted?
Where do you want data to be transferred?
When transferring data from the AS/400 system to a workstation, PC400 allows
you to specify which data is to be transferred and whether the data is to be
displayed or written to a workstation file.
In addition, a transfer request can be saved to a workstation file, allowing you to
easily perform the same transfer at a later date. After a transfer request is saved,
you can call the request to make changes or to run it again.
29
v Data is transferred according to the information that has already been registered.
The interactive screen is not necessary. This is called the automatic transfer of
data.
In both cases, data transfer is performed by PCSFT5.EXE on the workstation and
by the PC Support/400 transfer program on the AS/400 system.
The Data Transfer icon is registered in the PC400 folder by installing PC400.
Double-clicking on this icon displays the AS/400PC Transfer window (for
receiving). This icon includes:
\Personal Communications\PCSFT5.EXE
The PCAS/400 Transfer window (for sending) appears when the registered
contents are changed as follows:
\Personal Communications\PCSFT5.EXE
When you save the transfer information, register it as an icon in the PC400 folder.
You can then transfer data automatically simply by double-clicking on this icon.
Workstation Files
To transfer data from a workstation to the AS/400 system, the transfer function
uses a special-format workstation file, called a file-description file. Using this file,
data is stored in a valid format and converted into a valid type.
A file-description file identifies the format of a workstation data file and contains a
description of the fields in the data file. The file-description file also contains a
name list of all the fields in the data file. This list reflects the order, as well as the
names, in which each field appears within the data file. In addition, this list
includes a description of the data type, length, and decimal position of each field.
Using this information, the transfer function can recognize not only how data has
been modified but also where a certain field exists in a file record.
30
When data is transferred from the AS/400 system to a workstation, you can use
the transfer function to automatically create the file-description file. In this case,
the information in the file-description file depends on the file description in the
AS/400 file.
You must create a file-description file with the same name as the workstation data
file to transfer a workstation data file to the AS/400 system.
AS/400 Files
The following list provides a simple explanation of the requirements for
transferring data between the AS/400 system and a workstation.
Library
The AS/400 library contains related objects that are used to generate
significant groups. For example, the objects might be all the programs and
files related to credit sales management. Using the library, you can group
objects and find a desired file by name. The transfer function uses the
library to locate an AS/400 file.
File
AS/400 files that you can manipulate consist of a file description and data
stored in the file. PC400 processes an AS/400 file, called a database file.
The database file can be either a physical file or a logical file.
A physical file is a database file that contains data stored in records. It
includes a description of the record format in addition to the data itself.
A logical file is a database file, that you can use to access data stored in one
or more physical files. Logical files, like physical files, contain a file
description. However, logical files do not contain any actual data. Instead,
you can access fields in one or more physical files by using the record
format included in the logical file description. When a logical file is
transferred from the AS/400 system to a workstation, data is obtained from
one or more physical files. You need only specify a logical file as the file to
be transferred. The AS/400 system recognizes which physical file contains
the actual data to be transferred.
Note: Data cannot be transferred from a workstation to logical files.
Member
Data records in a database file are grouped into several members. At least
one member must be included in one file.
When data is transferred to and from the AS/400 system, actual data
transfer is done between file members. For example, a certain workstation
file can be transferred to the AS/400 system. In this case, the file members
become new members of a new or existing AS/400 file, or substitute for
existing members in an existing AS/400 file.
Record format
A record format describes the fields contained in a file record and the
order in which these fields appear in the record. Record formats are stored
in the file description. Both physical and logical database files can have
one or more record formats.
Chapter 4. Data Transfer for PC400
31
Items to Be Specified
The following section explains the items that you specify in the PCAS/400
Transfer window. Those items that are specified by selecting Advanced are
indicated by the addition of (Advanced) at the end of the corresponding item
name.
FROM
PC file name
This item is always required. It specifies the name of the workstation file
containing the data to be transferred to the AS/400 system. Specify this item
using the following format. (Items inside brackets [ ] can be omitted.)
[d:][path-name]file-name[.ext]
A list of workstation files can be displayed by selecting Browse. You can limit
the number of names listed. To limit the listing, specify a combination
consisting of part of a file name and a global file name character (* or ?) in the
input area of the workstation file list. For example:
v When you click OK with /A: specified, the displayed listing contains the
names of all files in the current directory of the diskette inserted into drive
A.
v When you click OK with A:\SUPPLY\ specified, the displayed listing
contains the names of all files under the SUPPLY path of the diskette
inserted into drive A.
v When you click OK after specifying B:*.XLS, the displayed listing contains
the names of all files having extension XLS in the current directory of the
diskette inserted into drive B.
TO
System name
This item is always required. When the router program is active, this item
specifies the default system name.
Library/File (Member)
This item is always required. It specifies the name of the AS/400 physical file
that will receive the data to be transferred from the workstation. You can
specify either an existing file name or new file name.
Specify this item using the following format. (Items inside brackets [ ] can be
omitted.)
[library-name/]file-name[(member-name[,record-format-name])]
32
library-name
This is the name of the AS/400 library containing the AS/400 file to
which data is to be transferred. If no library is specified, *LIBL is used.
To create a new file to receive transferred data, specify the library
name.
When the input field is null and Browse is selected, the AS/400 system
displays a list of all libraries defined in *USRLIBL of the AS/400 job
library list. You can modify this list by changing the job description.
Run a change job description (CHGJOBD) command on the AS/400
system.
file-name
This is the name of an AS/400 physical database file. When data is
transferred to an existing file, the data in that file is replaced with the
transferred data. To create a new file to receive transferred data,
specify a new file name of 1 to 10 characters.
To list the available files, do one of the following things:
v To list all files within all libraries defined in *USRLIBL of the AS/400
job library list, specify *USRLIBL followed by a slash (/), then select
Browse. If a slash (/) is not specified after the library name, the
AS/400 system displays a list of library names rather than the file
names.
v To list the names of the files in a certain library, specify the library
name followed by a slash (/), then select Browse. You can also
specify a part of a file name followed by an asterisk (*), then select
Browse. The AS/400 system lists all the files whose names begin
with the specified character string.
member-name
This is the name of a member in the specified AS/400 file to which
data is to be transferred. If this member name is not specified, data is
transferred to the first member, *FIRST, in the AS/400 file.
To transfer data to an existing file, specify the member name. The data
within that file member is replaced with the transferred data.
To create a new member in an existing file or in a new file, specify a
new member name of 1 to 10 characters.
By selecting Browse with a file name specified, the names of the
members in that file are listed. When a left parenthesis, part of a
member name, an asterisk (*), and a right parenthesis are specified, in
this order, and then Browse is selected, the AS/400 system can list all
member names beginning with the specified character string.
record-format-name
This is the name of the record format in the specified AS/400 file. The
record format name need not be specified except when a physical file
contains more than one record format. Most physical files have only
one record format. Before specifying a record format name, a member
name or *FIRST must be specified as the member name.
When you transfer data to an existing file without specifying a record
format name, it is assumed that the file has only one record format
(*ONLY). Therefore, that record format is used.
When a new file is created with no record format name, QDFTFMT is
used as the record format name.
Chapter 4. Data Transfer for PC400
33
Note: A library name, file name, member name, and record format name can
be specified using up to 10 characters each. Each name must begin with
one of the following characters: A to Z, , #, or@. For characters
subsequent to the first, the numbers 0 to 9, underscores, and periods can
also be used.
Type
Length
Zoned
Zoned
Character
or Open
6
6
1 to 4096
"
Note: When fields contain character data or zoned data only, the data portion
can be broken down into several fields. The destination AS/400 file
contains the fields for order number and date. The workstation file,
however, does not. This method is recommended when transferring text
only between the AS/400 system and the workstation.
v Specify this item in all other cases. Two examples are:
Data is transferred from a workstation file having more than one field.
The AS/400 file that receives the data is other than a physical source file
having the record format described above.
34
35
Type
Length
6
6
1 to 32755
Decimal Places
2
0
36
[library-name/]file-name
library-name
This is the name of an AS/400 library containing a
field-reference file. If this library name is not specified,
*LIBL is assumed. If you cannot find the desired library,
selecting Browse displays a list of all libraries in *USRLIBL
of the AS/400 job library list. *USRLIBL of the library list
can be changed by modifying the job description by
executing a CHGJOBD command on the AS/400 processor.
file-name
This is the name of the AS/400 physical database file
containing the field definitions. Always specify this file
name. When a library name is specified concurrently, use a
slash (/) to delimit the library name and file name. If the
desired file cannot be found, enter the library name and a
slash, then select Browse. The system displays a list of files
in that library. To list all the files in the libraries defined in
*USRLIBL of the AS/400 job library list, enter *USRLIBL/
then select Browse.
If you enter part of a file name followed by an asterisk (*) and then
select Browse, the system displays a list of available file names,
each beginning with the specified part of the name.
For example, enter ARLIB/AR* in the Field Reference File Name
item, then select Browse. The system displays a list of all physical
file names beginning with AR in library ARLIB.
Note: You must have *OBJOPR authority for the field-reference file
to be specified. To list certain files, you must also have
*OBJOPR authority for those files.
Record Length
This item is always required. It specifies the record length of an
AS/400 physical source file. When the data receiver is an AS/400
physical source file, the specified value must include the length of
the order number and date fields that are added to a workstation
file at transfer (the total length of these two fields is 12 bytes).
Authority
This item is always required. It specifies the authority level of a
new AS/400 file.
Specify one of the following things:
v Read/Write. This enables other users to read from and write to
the AS/400 file and allows the file name to be displayed in lists.
However, users cannot delete the file (*OBJOPR, *READ, *ADD,
*OBJMGT, *UPD, and *DLT authorities). If other users might be
transferring data from a workstation file to the AS/400 file,
specify Read/Write or All.
v Read. This enables other users to read from the AS/400 file, and
allows the file name to be displayed in lists. However, other
users can neither write to the file nor delete it (*USE authority).
v All. This enables other users to read from and write to the
AS/400 file as well as delete it. The file name is displayed in
lists (*ALL authority).
Chapter 4. Data Transfer for PC400
37
38
3. Specify the name of the file to be opened using the Open Transfer Request File
window, then click OK.
The PCAS/400 Transfer window reappears, and the transfer request
information, saved to the specified file, appears for each item. This opens the
saved transfer request.
4. Change the contents of the transfer request as necessary.
5. To save the changed contents, follow the procedure explained in Saving a
Transfer Request on page 38.
39
When the error is not so severe, you can request that the system continue
transferring data. By doing so, even if the same error occurs in another record, an
error message does not appear and the transfer function automatically continues
executing the transfer request.
40
WHERE
This item specifies the requirements that must be satisfied before records
can be selected for transfer.
ORDER BY
This item is optional. It specifies how records are grouped. When this item
is left blank, records are not grouped (data is transferred in the same order
it appears in the AS/400 file).
41
files are classified into several groups. To group all records into a single
group, this item need not be specified.
SELECT
Specifying this item creates a summary record. The field names specified in
GROUP BY can be specified.
WHERE
This item is optional. It specifies the requirements that each record to be
grouped must satisfy. To group all records, this item need not be specified.
HAVING
This item is optional. It specifies the summary record to be transferred. To
transfer all summary records, this item need not be specified.
ORDER BY
This item is optional. It specifies how summary records will be grouped.
When this item is left blank, records are not grouped (data is transferred in
the same order as it appears in the AS/400 file).
Items to Be Specified
The following section explains the items to be specified using the AS/400PC
Transfer window. Those items that can be specified by selecting Advanced, are
identified by adding (Advanced) to the end of those item names.
FROM
System name
This item specifies the name of the host system that contains the data to be
received. When the router program is active, this item specifies the default system
name.
Library/File (Member)
This item is always required. It specifies the name or names of one or more files
used to store data to be transferred. Up to 32 file names can be specified. To
specify several files, delimit them with commas and use JOIN BY, displayed after
all FROM items have been specified. Only the file name must be specified. Do not
specify a comma as a part of a file name. When the other optional items are not
specified, they are assumed automatically. For example, the library name, member
name, and format name can be assumed to be *LIBL, *FIRST, and *ONLY,
respectively. When the cursor is on the input field of FROM, selecting Browse lists
libraries, files, members, and formats.
Note: To transfer data from an AS/400 physical file, you must have *USE
authority for that file. To transfer data from an AS/400 logical file, you must
have *OBJOPR authority for that file and *READ authority for each
subordinate file.
Specify file names as follows. (Items inside brackets [ ]can be omitted.) To specify
several file names, delimit the names with commas.
[library-name/]file-name[(member-name[,record-format-name])],
[library-name/]file-name[(member-name[,record-format-name])],...
library-name
This is the name of the AS/400 library that contains the AS/400 file to be
transferred. This AS/400 file contains the data to be transferred from the
AS/400 system to a workstation. If this library name is not specified, *LIBL
is assumed. If you cannot find the desired library, selecting Browse
displays a list of all libraries defined in *USRLIBL of the AS/400 job library
42
list. *USRLIBL of the library list can be changed by modifying the job
description by executing the CHGJOBD command on the AS/400 system.
file-name
This is the name of the AS/400 physical file, logical file, or DDM file from
which data is transferred. This file name must always be specified. To
specify a file name and library name concurrently, delimit them with a
slash (/). If you cannot find the desired file name, enter the library name
followed by a slash, then select Browse. The system then displays a list of
files contained in that library. To display a list of all the files in the libraries
defined in *USRLIBL of the AS/400 job library list, enter *USRLIBL/, then
select Browse.
member-name
This is the name of the AS/400 member containing the data to be
transferred, or *FIRST. If this member is not specified, the system assumes
*FIRST, and the first member of that file is used.
record-format-name
This is the name of the record format contained in the specified AS/400
file, or *ONLY. Before specifying the record format name, specify the
member name or *FIRST. If the record format name is not specified, the
system assumes *ONLY, and the only record format for that file is used. To
specify a record format name, delimit the record format name and member
name with a comma.
When the specified AS/400 file has several record formats, a record format
name must be specified. If the file member name is not specified, a record
format name cannot be specified.
Notes:
1. A library name, file name, file member name, and record format name can be
specified using up to 10 characters for each. Each name must begin with A to
Z, , #, or @. For characters subsequent to the first, 0 to 9, underscores, and
periods can also be used.
2. When the FROM field remains blank or a comma is entered to specify the next
file name, selecting Browse displays a list of libraries defined in *USRLIBL of
the AS/400 job library list.
3. Enter part of the file name, member name, or record format name, followed by
an asterisk (*), then select Browse. The system displays a list of names
beginning with the specified characters.
For example, you might want to transfer data from file member ITEMMBR1 (first
member) of file ITEMMAST in library ITEMLIB. ITEMFMT is the only record
format of this file. The specification will be as follows:
ITEMLIB/ITEMMAST(ITEMMBR1,ITEMFMT)
Alternatively, specify:
ITEMLIB/ITEMMAST
JOIN BY (Advanced)
When several files have been specified in FROM, specify JOIN BY. When only one
file has been specified in FROM, JOIN BY does not appear.
JOIN BY specifies how to link or join the records of the files specified in FROM.
Each file specified in FROM must be joined with at least one other file that has
been specified in FROM.
Chapter 4. Data Transfer for PC400
43
Use JOIN BY to specify one or more join conditions. The join conditions indicate
the similarity of two files. Therefore, they indicate which records of one file are
joined with those of another.
The join conditions are as follows:
field-name = field-name
Field name is the name of the field defined in the record format specified in
FROM. The join conditions require two field names, one for each file to be joined.
Field names must be delimited by one of these:
=
Equal
<> or ><
Not equal
>
Greater than
>=
<
Less than
<=
44
In this case, records having the same value as EMPNO are joined between the first
and second files specified in FROM. Then, such records are joined between the
second and third files specified in FROM.
Up to 32 join conditions can be specified.
After JOIN BY is specified, each of SELECT, WHERE, and ORDER BY can be
completed, by following the procedure described earlier in this chapter. To browse
a field name that has been defined in several files, prefix the field name with a file
qualifier.
GROUP BY (Advanced)
This item is required only to classify AS/400 file records into several groups. When
no value is specified in GROUP BY, all the records are treated as a single group.
If GROUP BY is not displayed, select Group functions at the bottom right of the
screen. Then, GROUP BY appears. GROUP BY and HAVING are displayed
concurrently. You can specify either, both, or neither.
When GROUP BY and HAVING are displayed but you do not want to specify
either, select Remove Group functions. The two items disappear.
To classify several records into groups, specify one or more fields to act as the base
for grouping. Records are grouped according to the field specified first, then by the
field specified second, and so on. For example, suppose that the following
groupings are specified:
SHIFT, DEPTNO
In this example, the records are first grouped by SHIFT. Records belonging to a
single group will subsequently have the same value as SHIFT. Then, the records in
each group are grouped by DEPTNO. When there is only one record having a
certain SHIFT value, the group has only one record.
Delimit field names with commas. Blanks can be specified to improve readability.
Up to 50 field names can be specified. These fields must have been defined in the
record format defined in FROM.
If a field cannot be found, selecting Browse displays a list of all the fields
contained in the record.
With GROUP BY specified, specify SELECT to transfer the summary record of
each group.
SELECT (Advanced)
This item is always required. It specifies the field to be transferred or the function
that indicates the type of summary information to be transferred.
The field to be specified must have been defined in the record format specified in
FROM.
To transfer all the fields in the specified record, specify an asterisk (*) in this input
field. (Specifying an asterisk causes all fields in the record to be transferred.)
Note: Up to 256 fields can be transferred. When more than 256 fields have been
defined in a file, an asterisk cannot be used. In this case, specify the names
by selecting the fields to be transferred.
Chapter 4. Data Transfer for PC400
45
To transfer fields by selecting from a record, enter the field names in the order in
which the fields are arranged. One or more blanks can be placed between the field
names to improve readability. However, the names must be delimited by commas,
as follows:
ITEMNO,
QONHAND,
PRIC
When records are transferred from an AS/400 source file, specifying an asterisk (*)
causes all fields in the file to be transferred, with the exception of the order
number field and date field. (To transfer all the fields, including the order number
field and date field, specify all the field names, including each data field name.)
A field can be specified repeatedly as required. However, bear in mind that no
more than 256 fields can be selected. A list of field names can be displayed by
selecting Browse.
Transfers the average value of the specified fields for each record
group. This function can be used only for numeric fields.
MIN
MAX
SUM
Transfers the total value of the specified fields for each record
group. This function can be used only for numeric fields.
COUNT
Transfers the total number of records that satisfy the WHERE
condition for each record group. Specify COUNT(*).
46
field-name
This is the field name defined with the record format specified in FROM.
Each function returns one value for each record group. In SELECT, several
functions can be specified. To do so, delimit the functions by commas, as follows:
SUPPNO, AVG(PRICE), MIN(PRICE), MAX(PRICE)
This indicates that the average, minimum, and maximum values for PRICE are
calculated for each supplier after SUPPNO has been selected. A summary record is
transferred according to the function selection. Specify SUPPNO in GROUP BY,
because SUPPNO has not been used for the functions.
WHERE (Advanced)
This item is optional. It specifies one or more conditions that records to be
transferred must satisfy.
To transfer summary records, use this item to specify which records are to be
grouped, then group the records. Using this item, you can specify one or more
conditions that the record must satisfy to belong to a certain group. When WHERE
is not specified, all records are grouped.
As the conditions, specify the test to be applied to the records in the specified file
member. All the records in the specified file member are tested for the conditions
specified here. Only those records that pass this test are transferred.
When WHERE is not specified, all records in the specified file member are
transferred.
The condition format is as follows:
field-name
test
value
field-name
This must be a field substring or field name defined in the record format.
Fields or constants can be manipulated by specifying a supported function,
with the results being used for comparison. The supported functions and
usage are as follows:
SUBSTR
Returns the specified part of a character string. This function
contains three parameters: the field name, starting position, and
length of the returned substring. The following example returns the
20 characters starting from the 10th character of the FULLNAME
field:
SUBSTR(FULLNAME 10 20)
VALUE
Returns the first non-null value in the parameter list. (If all
parameters are null, null is returned.)
VALUE(DEPOSIT WITHDRAW BALANCE)
CURRENT
Returns DATE, TIME, TIMEZONE, or TIMESTAMP for the current
system.
CURRENT(TIMEZONE)
DIGITS
Returns a character string representation of a numeric field.
DIGITS(EMPLOYEE#)
Chapter 4. Data Transfer for PC400
47
CHAR
Returns a character string representation of the date field, time
field, or time-stamp field. The second parameter is used to specify
the format of the Systems Application Architecture (SAA) of the
string to be returned (supported values are USA, EUR, ISO, or JIS).
CHAR(DATEHIRE USA)
DATE Returns the date of the time-stamp field.
DATE(TIMECRTD)
TIME Returns the time of the time-stamp field.
TIME(TIMECRTD)
TIMESTAMP
Returns the time-stamp, combining the date field and time field.
TIMESTAMP(DATESEND TIMESEND)
YEAR Returns the year of the date field or time-stamp field.
YEAR(DATEHIRE)
MONTH
Returns the month of the date field or time-stamp field.
DAY
MONTH(DATEHIRE)
Returns the date of the date field or time-stamp field.
DAY(DATEHIRE)
DAYS Returns the day of the year, counted from January 1, of the date
field or time-stamp field.
DAYS(DATEHIRE)
HOUR
Returns the time of the time field or time-stamp field.
HOUR(TIMESEND)
MINUTE
Returns the minute of the time field or time-stamp field.
MINUTE(TIMESEND)
SECOND
Returns the second of the time field or time-stamp field.
SECOND(TIMESEND)
MICROSECOND
Returns the microsecond of the time field or time-stamp field.
MICROSECOND(TIMECRTD)
test
Equal
<> or ><
Not equal
48
>
Greater than
>=
<
Less than
<=
LIKE
BETWEEN
The field is equal to one of two constants, or to a value between
them.
IN
The field is the same as one of the values in the constant list.
IS
ISNOT
The field contains no null values.
Test usage is as follows:
Using the LIKE Test
The LIKE test checks the field specified with the field name for a
character pattern specified as a value. The field to be specified
must be a character field.
The values to be tested must be character-string constants. This
string can contain any characters. A percent (%) character (both
SBCS% and DBCS%) indicates a character string consisting of zero
or more characters. A 1-byte underscore (_) character indicates any
single 1-byte character. A 2-byte underscore (_) character indicates
any single 2-byte character.
The following example explains how to use the LIKE test:
NAME LIKE %ANNE%
The following example searches for all last names beginning with
character J.
LSTNAM LIKE J%
49
When the pattern does not include a percent character (%), the
length of the character string must be identical to that of the field.
Using the BETWEEN Test
The BETWEEN test checks the fields specified in the field name for
character strings or numeric values that are equal to or between
the specified constants. The values to be tested must be two
character-string constants or two numeric constants. The types of
these constants must be identical to that of the field name specified
by the user. Delimit the two constants with AND.
The following example searches for those records for which the
price is between 50.35 and 75.3, inclusive:
PRICE BETWEEN 50.35 AND 75.3
The following example searches for those records for which the
name begins with C:
NAME BETWEEN C AND CZZZZZZZZZ
The following example searches for those records for which the
balance is between 0 and 5 000.
BALDUE BETWEEN 0 AND 5000
This example searches for those records for which the name is
SMITH, JONES, or ANDERSON.
The following example searches for the values in the STATE field
for which the value is other than NY, MN, or TX:
NOT STATE IN (NY MN TX)
50
NOT can also be used. The following example selects items where
data is transferred not only from those records in which the DEPT
field is not equal to 470, but also from those records for which the
DEPT field is equal to 470 and, additionally, STATE is equal to NY.
NOT (DEPT = 470) OR (DEPT = 470 AND
STATE = NY)
Comparison can start from a certain line and end at the next line.
However, a field name cannot start from a certain line and end at
the next line. Field names must not exceed one line.
When a value to be tested is a character string enclosed in
quotation marks, the value can start from a certain line and
continue to the next line.
HAVING (Advanced)
This item is optional. It specifies which summary record is transferred.
Chapter 4. Data Transfer for PC400
51
Pay particular attention to the difference between HAVING and WHERE. WHERE
operates on each record within a certain group. HAVING, on the other hand,
operates only on summary records (records that contain summary information for
each group).
With this item, you can specify one or more conditions that a summary record
must satisfy prior to being transferred.
As the conditions, specify the tests that should be applied to the summary records.
The specified test conditions are applied to all summary records, only those
summary records that pass the tests are transferred. To transfer all summary
records, leave the HAVING item blank.
The format of the conditions is as follows:
function (field-name)
test
value
This indicates:
function
This is a function supported for SELECT. See the description of SELECT in
this section for details of these functions.
field-name
This is the field defined by the record format specified in FROM. A field name
is acceptable even when it has not been specified in SELECT.
Test
This is the comparison type for functions. The types are listed below.
=
Equal to
<> or ><
Not equal
>
Greater than
>=
<
Less than
<=
value
This is a function operating on certain fields or a constant. See WHERE
(Advanced) on page 47 for details of constants, expressions, and tests.
Note: A comma is treated as a decimal point. Therefore, do not separate
numbers with commas.
Test conditions can be combined by using logical AND or logical OR. When
both AND and OR are specified, AND comparison is performed first. Up to 50
tests can be specified. By using parentheses, the operation order can be
modified, or a description can be added to an operation. For example, you can
specify:
COUNT(*) >=2 AND MAX(PRICE) > 100
52
If the desired field cannot be found, selecting Browse displays a list of the
names of all fields in the record.
The type, length, digit, and number of decimal places of the value returned for
each function are:
SUM
AVG
COUNT
MAX
MIN
Type
Packed
Packed
Length
16
16
Digit
Decimal Places
31
(Same as tested field)
31
31 (Total of the digit
and decimal places
of the field)
Binary
4
10
0
(Same as tested field)
(Same as tested field)
ORDER BY (Advanced)
This item is optional. It specifies the order in which the requested records are
grouped. When ORDER BY is not specified, record transfer is not done according
to a certain order.
Records are grouped according to the field specified first. Those records having the
same value in each field specified first are grouped by the field specified second,
and so on. Records containing null values are grouped after all records without
null values have been grouped.
For example, you can specify:
DEPT,NAME,PHONE
In this case, records are first grouped according to DEPT. Then, the records having
the same value for DEPT are grouped by NAME. The records with the same DEPT
and NAME values are finally grouped by PHONE.
When a field name is specified in ORDER BY, it must also have been specified in
SELECT, or SELECT* must have been specified.
Fields can be grouped in ascending or descending order. To do this, specify one
blank after a field name then enter ASC or DESC. The default value is ASC. For
example, specify:
DEPT DESC, NAME ASC
This indicates that the DEPT fields are to be grouped in descending order, after
which the NAME fields are to be grouped in ascending (alphabetic) order.
Absolute values (ABS) can be specified for numeric fields. To do this, add a blank
after a field name then enter ABS. For those fields having negative values, the
negative signs are ignored and the absolute values are used.
The total length of the fields to be specified must not exceed 120 digits.
53
When you do not specify transfer of records with missing fields, those records are
not transferred.
Specify this item to transfer data records that have alternative values for missing
fields.
Do not specify this item if data records that have alternative values for missing
fields are not to be specified. In this case, only those data records created from
those records that exist in all files specified in FROM are transferred.
TO
Output device
This item specifies where received data is to be sent.
Display
The received data is displayed on the screen.
Disk
Printer
The received data is printed on the printer.
When Disk is selected as the output device, also specify the following items.
PC file
This item specifies the name of the workstation disk file or diskette file to
which the data is to be written.
Replace old file
This item is always required. It specifies whether the records in the file
specified by PC File are to be replaced with the transferred records.
The default value is Replace old file.
Workstation file type
This item is always required. It specifies the type of the workstation disk
file or diskette file to which the transferred records are written.
The system default is PC code test.
Save transfer description
This item is always required. It specifies whether the workstation file
description is written to a workstation file. This file description describes
the transferred data and it is required to subsequently return data to the
AS/400 system.
The system default is Save.
Description file name
This item is always required. It appears only when Save Transfer
Description is selected. The File Description File Name specifies the name
of the workstation disk file or diskette file to which the file description is
written.
This item automatically sets the desired file name. This file name is the
same as that specified by the user for TO, but to which extension .FDF has
been added. Extension .FDF indicates that this file is a file-description file.
The use of extension .FDF is recommended when using a unique file name.
To specify a file name in this item, use the same format as that in TO.
(Items inside brackets [ ] can be omitted.)
[d:][path-name]file-name[.ext]
54
After Save File Description File is specified or a name is specified for File
Description File Name, the AS/400PC Transfer Request window
reappears after the Return key is pressed. Using this screen, a transfer
request can be changed, saved, or executed.
55
56
MBRTEXT
PUBAUT
RCDLEN
REFFILE
For a transfer request from the AS/400 system to a workstation, none of the
following reserved words can be used as a file name or field name:
IS
ISNOT
LIKE
MAX
MIN
NOT
OPTIONS
OR
ORDER
PARTOUT
REPLACE
SELECT
SUBSTR
SUM
TABLES
WHERE
ABS
AND
ASC
AVG
BETWEEN
BY
COLUMNS
COUNT
DESC
EXTRACT
FROM
GROUP
HAVING
IN
INNER
To use one of these reserved words as a file name or field name, use the reserved
word in uppercase, enclosed in quotation marks:
TO MYLIB/"INTO"
The SUPPLIERS file contains information about the suppliers of each part. Each
supplier is identified by a two-digit number, SUPPNO. The SUPPLIERS file
contains the number of parts delivered (PARTNO), their prices (PRICE), times of
delivery (DELIVTIME), and ordered quantities (QONORDER). The parts listed in
the SUPPLIERS file are the same as those listed in the INVENTORY file.
File: SUPPLIERS
Field name: SUPPNO
PARTNO
-----------
PRICE
-----
DELIVTIME
---------
QONORDER
-------Chapter 4. Data Transfer for PC400
57
Record 1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
51
51
53
53
53
54
54
54
54
57
57
61
61
61
64
64
221
231
222
232
241
209
221
231
241
285
295
221
222
241
207
209
.30
.10
.25
.10
.08
18.00
.10
.04
.02
21.00
8.50
.20
.20
.05
29.00
19.50
10
10
15
15
15
21
30
30
30
14
21
21
21
21
14
7
50
0
0
200
0
0
150
200
200
0
24
0
200
0
20
7
INVENTORY
SELECT
PARTNUM, QONHAND
WHERE
ORDER BY
PARTNUM
In this case, only part of the INVENTORY file is to be transferred. Specifically, only
the part number (PARTNUM) and quantity on hand (QONHAND) fields of the
records for which the number of parts in stock is less than 100 (QONHAND < 100)
are transferred. Records are transferred in ascending order of parts numbers
(PARTNUM).
The following data is transferred:
Field:
Record 1:
2:
3:
PARTNUM QONHAND
------- ------207
75
209
50
295
85
58
PARTNO
-----221
231
DESCRIPTION
----------BOLT
NUT
PRICE
----.30
.10
The same results are available by joining the data in these two files by using the
AS/400-to-PC transfer function. To do this, specify both files (INVENTORY and
SUPPLIERS) in the FROM item. For SELECT, specify which fields are to be
transferred (PARTNO, DESCRIPTION, and PRICE). For WHERE, specify which
records are to be transferred (records for which SUPPNO = 51).
Respecify the relationship between the two files in JOIN BY. From these results,
the user can determine, by checking the SUPPLIERS file, that part number 221 is
delivered from supplier 51 at a cost of 30 cents. In addition, to determine the part
name, the user must check the INVENTORY file for part number 221 and its
product name. In other words, the user observes that data is joined from the
records in both the SUPPLIERS file and the INVENTORY file and that those
records have the same part number. Therefore, to link the two records in these
files, the records must have the same part number.
In short, to obtain this information, specify:
Library/File (Member)
SUPPLIERS, INVENTORY
JOIN BY
PARTNO = PARTNUM
SELECT
WHERE
SUPPNO = 51
ORDER BY
PARTNO
SUPPLIERS, INVENTORY
JOIN BY
T1.PARTNO = T2.PARTNO
SELECT
WHERE
SUPPNO = 51
ORDER BY
T1.PARTNO
59
The following examples of joining several AS/400 files describe more sophisticated
techniques. You should now be familiar with the basics of how to join two files.
For a more detailed explanation, refer to the following sections.
DESCRIPTION
----------NUT
PRICE
----.30
.10
If Return Record at Missing Field Value has not been specified, the field missing
records are not transferred. For example, if the INVENTORY file does not contain
the part number 221 record, the result of the previous example will be as follows:
Field: PARTNO
-----Record 1:
231
DESCRIPTION
----------NUT
PRICE
----.10
SUPPLIERS, SUPPLIERS
JOIN BY
T1.PARTNO = T2.PARTNO
SELECT
WHERE
ORDER BY
T1.PARTNO
The same file has been specified in FROM twice. JOIN BY specifies that records
having the same part number are joined. This creates a joined record containing
information about two suppliers of a single part. The user can spot those records
for which the price is double, or greater than double, that of another supplier.
60
Records in the SUPPLIERS file are compared, one by one, with all the records
(including itself) in the SUPPLIERS file. When the same part number is found, the
two corresponding records are linked. This processing is performed for each record
in the SUPPLIERS file.
For each record, the first suppliers price is compared with the second suppliers
price. When the first suppliers price is double, or greater than double, that of the
second, only the record containing the first supplier price is kept.
The final result is as follows:
Field:
Record 1:
2:
3:
4:
T1.PARTNO
--------221
231
241
241
T1.SUPPNO
--------51
51
53
61
T1.PRICE
-------.30
.10
.08
.05
T2.SUPPNO
--------54
54
54
54
T2.PRICE
-------.10
.04
.02
.02
SUPPLIERS
GROUP BY
PARTNO
SELECT
WHERE
DELIVTIME < 30
Note that the conditions specified in WHERE are checked first, then the records
that satisfy those conditions are included in the group.
SUPPLIERS
61
GROUP BY
PARTNO
SELECT
HAVING
The following table shows the result of removing unnecessary summary records by
using HAVING
Field: PARTNO
-----Record 1:
209
2:
285
3:
207
MAX(PRICE)
---------19.50
21.00
29.00
MIN(PRICE)
---------18.00
21.00
29.00
One summary record for an entire file can be transferred. To do this, specify only
the summary function in SELECT and nothing in GROUP BY. As a result, an
entire file can be recognized as one group, while one summary record can be
transferred for the group.
You can concurrently use the concept of summarizing groups and that of joining
records from several files. To obtain the desired results, do as follows:
1. Specify a file in FROM, and specify the join conditions to join the records in
JOIN BY.
2. Specify the conditions in WHERE to remove unnecessary records.
3. Specify the fields used for grouping the remaining records in GROUP BY.
4. Specify the function in SELECT, then create summary records.
5. Specify the conditions in HAVING to remove unnecessary records.
6. Specify the items for grouping the final summary records in ORDER BY.
File
Transfer request files can be processed.
Create Creates a transfer request file
Open
Save, Save As
Save the current settings to the transfer request file being used or to a new
transfer request file, respectively
Exit
62
request creates indices again and modifies any detected decimal data
errors. This requires extra processing time.
Time Format
Specifies a desired time format for fields of AS/400 field type having a
selected time. If no time format is specified, the default value in the
workstations national information file is used when the transfer request
starts, and that in an existing transfer request is assumed when the request
is called again.
Supported time formats are as follows:
HMS Hours, minutes, seconds (hh:mm:ss)
ISO
International Standard Organization (hh.mm.ss)
USA USA Standard (hh:mm AM or PM)
EUR IBM European Standard (hh.mm.ss)
JIS
Japanese Industrial Standard (hh:mm:ss)
DDS AS/400 DDS (Format given by AS/400 file attribute)
DFT
AS/400 default format (Host job default is used)
Time separator
Specifies enabled delimiters. The fields of the AS/400 field type for the
selected time must be in a format that supports delimiters.
When no delimiters are specified, the default value in the workstations
national information file is used when the transfer request starts, and that
in an existing transfer request is assumed when the request is called again.
Supported time delimiters are as follows:
Colon (:)
Period (.)
Comma
(,)
Blank ( )
Null
(NULL) No Separator
Default value
(DFT) AS/400 Default Separator
Date Format
Specifies the date format for fields of AS/400 field type for the selected
date.
If this date format is not specified, the default value in the workstations
national information file is used.
Supported values are as follows:
MDY
DMY
YMD
JUL
Julian (yy/ddd)
ISO
USA
EUR
JIS
63
DDS
DFT
Date separator
Specifies delimiters. The fields of the AS/400 field type for the selected
date must be in a format that supports delimiters.
When no date delimiters are specified, the default value in the
workstations national information file is used when the transfer request
starts, and that in an existing transfer request is used when the request is
called again.
Supported date delimiters are as follows:
Slash
(/)
Dash
(-)
Period (.)
Comma
(,)
Blank ( )
Null
DFT
Decimal separator
Specifies the decimal point character in an AS/400 field whose type is
packed decimal or zoned decimal.
When decimal points are not specified, the default value in the
workstations national information file is used when the transfer request
starts, and that in an existing transfer request is used when the request is
called again.
Supported decimal point delimiters are as follows:
Period (.)
Comma
(,)
DFT
Sort Sequence
Specifies which sort sequence should be used for this transfer request.
AS/400 job default
Sort by the table identified on the AS/400 system as the job sort table.
Hexadecimal
Sort by the internal hexadecimal representation.
User specified table
Sort by the table identified by the user in a subsequent prompt.
Shared Weight Table
Sort by the shared weight table associated with the language named in a
subsequent prompt.
Unique Weight Table
Sort by the shared unique table associated with the language named in a
subsequent prompt.
Changing the sort sequence affects the order in which records appear only if the
ORDER BY clause is being used. The sort sequence affects all character
64
comparisons that depend on the order of the alphabet. Such comparisons can occur
in the WHERE clause, the GROUP BY clause, the HAVING clause, the JOIN BY
clause, the IN predicate, the LIKE predicate, the BETWEEN predicate, the MAX
function, and the MIN function. Comparison operations are =, <>, >, >=, and >=.
Language
AS/400 standard tables provide many languages. Select the user-specified
languages to enter the desired language ID. Language IDs shipped with AS/400
are found in the AS/400 NLS Guide.
Language ID
Enter the language ID for the desired language
AS/400 standard tables provide many languages. Language IDs shipped with
AS/400 are found in the AS/400 NLS Guide.
Translation Table
Translation tables for ASCII-to-EBCDIC translation or for EBCDIC-to-ASCII
translation can be specified, created, and customized.
Current Table
Specifies whether the IBM default translation or the user-defined
translation table is to be used.
Host Code Page
Specifies the host code page to be used for translation.
Workstation Code Page
Specifies the workstation code page to be used for translation.
File Name
Specifies the file name of the user-defined table to be used for translation.
v To list all files in your workstation, click Browse.
v To customize the translation table, click Customize.
File-Description Files
A file-description file is a workstation file that contains all field descriptions of the
data in the corresponding workstation data file. Each field descriptor contains the
field name, data type, and field length. There is one field descriptor for each field
in the workstation file.
A file-description file defines the following:
v The file type of the workstation file to be transferred. For an explanation of each
file type, see Creating a File-Description File on page 66.
v The field names and order of these fields in each data record.
v The data type of each field in the workstation file.
v The size and number of decimal places of each field.
The workstation files require field definitions when the files are transferred. The
field definitions describe the file as it exists on the workstation. These definitions
contain data that is similar to the field definitions (DDS) required by AS/400
system files. The data must be defined for both the AS/400 system and the
Chapter 4. Data Transfer for PC400
65
workstation files, because the field names from each file are needed to send the
data to the AS/400 system and the data in each file might be in different formats.
A file-description file is created on request during the transfer process of data from
an AS/400 file to a workstation file. Therefore, you usually do not need to worry
about the contents or the format of the file-description file. However, if you
transfer data that has not been previously transferred to the system, you must
create a file-description file.
Items within brackets are optional. Use either uppercase or lowercase characters
anywhere in the file.
PCFDF Entries: PCFDF is a keyword that identifies this file as a workstation
file-description file. It must appear in the first line of the file, starting in column 1.
A comment is the only other entry allowed on the first line. If you type a
comment, it must be separated from the PCFDF keyword by a space.
PCFT Entries: PCFT is a keyword that identifies this record as containing the file
type indicator. It is followed by an indicator identifying the type of file in which
the data is stored. It must appear only once, and must start in column 1, after the
PCFDF record and before any PCFL records. An optional comment can follow this
file-type indicator if separated from the indicator by at least one space.
Following is an example of a PCFT entry:
PCFT 4 BASIC RANDOM FILE
66
Indicator
File Type
ASCII text
DOS random
BASIC sequential
BASIC random
File Type
No-conversion file
Reserved
BIFF format
PCFO Entry: The PCFO entry is optional. PCFO is a keyword that identifies this
record as containing information about the date and time formats, time stamp, and
separator characters for applicable formats. It must appear only once and must
start in column 1, after the PCFT record and before any PCFL records. If there is
no PCFO entry, the information or characters assigned as defaults for the host
system are used.
Table 7 shows the valid time formats.
Table 7. Time Formats
Indicator
Format Name
Time Format
HMS
hh:mm:ss
ISO - International
Standards Organization
hh.mm.ss
hh:mm AM or PM
EUR - European
hh.mm.ss
hh:mm:ss
DDS
DFT
Unspecified
Separator
Colon (:)
Period (.)
Comma (,)
Blank ( )
Null (N)
67
Format Name
Date Format
MDY
mm/dd/yy
DMY
dd/mm/yy
YMD
yy/mm/dd
Julian
yy/ddd
ISO
yyyy-mm-dd
USA
mm/dd/yyyy
EUR
dd.mm.yyyy
JIS
yyyy-mm-dd
DDS
10
DFT
Unspecified
Separator
Slash (/)
Dash ()
Period (.)
Comma (,)
Blank ( )
Null (N)
Separator
Period (.)
Comma (,)
Unspecified (workstation
default used)
68
PCFL Entries: PCFL identifies a definition for a field. Enter a PCFL entry in the
file-description file for each field in the data file. The PCFL records must be in the
same order as the fields they define in the data file.
Define as many as 256 PCFL records in the file-description file and start PCFL
records in column 1. If you enter more than 256 PCFL records, you receive an error
message. You cannot continue a record on one line, and only the first 80 characters
of a record are used.
Following is an example of a PCFL entry:
PCFL CUSTNAME 1 20
CUSTOMER NAME
Data Type
ASCII1
ASCII numeric
Hexadecimal
Binary
Zoned
Packed
BASIC integer
10
EBCDIC
11
EBCDIC zoned
12
EBCDIC packed
Note:
1
Includes date, time, and time stamp except for files that are not
converted.
The data type indicator you enter must be valid for the file
type entered earlier. Any other data types are not valid and are
diagnosed as errors during a data transfer to the AS/400
system.
Table 13 on page 70 shows the valid single-byte character set (SBCS) data types for
each file.
69
ASCII text
ASCII
ASCII
numeric
DOS random
ASCII
Binary
Hexadecimal
ASCII Packed Zoned
BASIC sequential
BASIC random
DIF
No-conversion
BIFF format
Note: ASCII (SBCS) includes date, time, and time stamp types if
converted. EBCDIC includes date, time, and time stamp if not
converted.
For numeric fields in BASIC sequential and DIF files, a size specification must be
present. However, because the data in these fields is of variable length, the data
transfer function assumes a maximum length of 65 characters. This length more
than covers the largest possible exponential ASCII numeric value. The size
specifications for character fields must be the maximum size of any data item in
that field.
Table 14 shows the allowed data length limits for each workstation data type.
These are the maximum lengths you can specify for size in the PCFL entry.
Table 14. Allowable Data Length Limits for Personal Computer SBCS Data Types
70
ASCII
4093
ASCII numeric
BASIC double-precision
BASIC integer
BASIC single-precision
Binary
EBCDIC
4093
Hexadecimal
2048
16
31
Table 14. Allowable Data Length Limits for Personal Computer SBCS Data
Types (continued)
Personal Computer Data Type
Time
HMS (see note 1)
USA
ISO, EUR, and JIS (see note 1)
DDS, DFT
v 8
Date
MDY, DMY, YMD
Julian
ISO, EUR, JIS, USA (see note 1)
DDS, DFT
v 8
Time stamp
v 26
v 8
v 8
v 8 or 10
Notes:
These abbreviations appear in the time and date parameter sections.
Abbreviation
Description
HMS
EUR
JIS
ISO
The length is determined by the format defined in the host file for DDS,
or from the AS/400 job default (DFT keyword).
Table 15 shows the allowed data length limits for each AS/400 data type.
Table 15. Allowable Data Length Limits for AS/400 Data Types
1
Binary
EBCDIC
4096
Hexadecimal
2048
16
31
Time
HMS
USA
DDS, DFT
8 or 10
Date
MDY, DMY, YMD
Julian
10
71
Table 15. Allowable Data Length Limits for AS/400 Data Types (continued)
AS/400 Data Type
DDS, DFT
Time stamp
Notes:
1
26
The data length limits for the workstation and the system data fields are different
in some cases. For these cases, the transfer function attempts to fit the workstation
data into the system field. If the data does not fit into the field, a message is
displayed. Refer to Data Conversions on page 73 for more details.
The length is determined by the format defined in the host file for DDS, or from
the AS/400 job default (DFT keyword).
If there is a decimal position associated with the data in that field, place a forward
slash (/) and then the number of decimal positions after the length specification.
There are no spaces between the length, slash, and decimal position specifications.
The decimal position specification refers to the number of positions from the
right-hand byte of the resulting decimal number. Do not specify a decimal position
for floating-point numbers unless the data type is one of the following types:
v ASCII numeric
v Binary
v Packed
v Zoned
Note: The number of decimal positions in a field ranges from 0 to 9 or the
maximum number of decimal digits in this number, whichever is smaller.
The data transfer function might round the number to fit it into the field.
Refer to Data Conversions on page 73 for more details.
Comment Entries: Enter comment lines anywhere in the file-description file,
observing the following restrictions:
v The last element of the field-descriptor entry specification is a comment. This is
an optional entry for your information only, and must be separated from the size
entry by a space. PCFL entries created by the data transfer function (RTOPC) do
not contain a comment field.
v Precede the comment with an asterisk (*) as the first nonspace character in the
line.
v Do not exceed 80 characters in length.
v Do not make the comment the first record in the file-description file.
Following is an example of a comment:
* This is a comment
72
PCFL
PCFL
PCFL
PCFL
COLOR 1 8 COLOR
WEIGHT 2 7/2 ITEM WEIGHT
PRICE 2 7/2 PRICE PER ITEM
INSTOCK 2 6 ITEMS IN STOCK
Data Conversions
The data transfer function needs data conversions for transferring data from the
system to the workstation, and vice versa. For both types of transfers, the
necessary conversion depends on the record size, the type of data being
transferred, the type of workstation file being used, the system data type, and, in
some cases, the data length.
Record Size
Each transferred record contains data indicating whether each field contains a null
value. There is a restriction on the maximum data record that can be sent or
received from the AS/400 system because of this data.
The following formula determines the maximum record length that can be
transferred:
v 4096 (number of fields in the record + 2) = (maximum record length)
Data Types
The data transfer function supports the following system data types:
v Date
v Time
v Time stamp
v Binary data
v Character data
v Hexadecimal data
v Packed decimal data
v Zoned decimal data
The data transfer function supports the following workstation data types:
v BASIC numeric data, including:
Double-precision data
Integer data
Single-precision data
v Binary data
v Character data, including:
ASCII
EBCDIC
v Hexadecimal data
v Packed decimal data
v Zoned decimal data
v ASCII numeric data
73
non-SAA format is 1940 to 9999. The range of the month is 1 to 12. The range of
the day is 1 to x, where x depends on the month.
A time is a three-part value (hour, minute, and second) designating a time of day
under a 24-hour clock. The range of the hour is 0 to 24 and the range of the other
values is 0 to 59.
A time stamp is a seven-part value (year, month, day, hour, minute, second, and
microsecond) that designates a date and time including the specified microseconds.
The maximum length of the time stamp is a character string of 26.
Dates, times, and time stamps can be assigned to result fields. A valid
character-string representation of a date can be compared with a date field, or a
valid character-string representation of a time can be compared with a time field.
Binary Data
This data represents signed or unsigned numbers in twos complement form.
Binary numbers of 1, 2, 3, or 4 bytes in length are allowed on the workstation, but
the AS/400 system allows only numbers 2 or 4 bytes in length. The bit on the left
side of the high-order bit determines the sign of the number (0 for positive, 1 for
negative). The system stores the data with the high-order byte on the left side of
the field, whereas the workstation stores the data with the high-order byte in the
right-hand position of the field.
The decimal position, if specified by the file description, represents the number of
decimal digits to the right of the decimal point. The file description specifies the
presence of a decimal position.
For example, the binary number 3BF5 is equivalent to the decimal number 15349,
and the binary number FFB4 is equivalent to the decimal number 76.
74
v Values where the workstation ASCII characters and AS/400 EBCDIC characters
match exactly
v Values where a substitute character is chosen for a character that cannot be
translated
The data transfer function uses tables to translate data from ASCII to EBCDIC and
EBCDIC to ASCII. You can change these default tables using the translation table
utility (TRTABLE).
Note: ASCII (SBCS) data includes date, time, and time stamp types if converted.
EBCDIC data includes date, time, and time stamp if not converted.
Hexadecimal Data
You can think of this data as a string of bits representing base 16 numbers. For
example, you can represent hex 3D with the following string of bits:
0011 1101
75
For DOS random files, zoned decimal fields from the system change from EBCDIC
to ASCII, as do character fields, except that the sign half-byte in the workstation
field is changed to a hex 3 to indicate a positive number or a hex B to indicate a
negative number.
For DOS random type-2 files, zoned decimal fields from the system change from
EBCDIC to ASCII, as do character fields, except that the sign half-byte in the
workstation field is changed to a hex 3 to indicate a positive number or a hex 7 to
indicate a negative number.
The decimal position, if specified, represents the number of decimal digits to the
right of the decimal point and is specified by the file description.
76
ASCII Length
2
4
6
11
Value Range
32768 to 32767
2147483648 to 2147483647
v Zoned decimal fields are changed to ASCII numeric. For example, EBCDIC
F0F0F9F5F2D6 with a field length that indicates two digits to the right of the
Chapter 4. Data Transfer for PC400
77
78
bytes are significant because the data rounds up if the first extraneous digit is 5
or greater, and rounds down if it is less than 5.
v Data in this field is incorrect or does not match the data type. This error occurs
when:
Nonnumeric data is found in a field that the file descriptions defined as
numeric. The transfer request ends to prevent transferring incorrect data to
the file.
ASCII numeric data is found that does not match the format the file
description specified. An incorrectly positioned decimal point within the field
could cause this error.
A value other than X'30' through X'39', minus, plus, or decimal point is found.
A duplicated decimal point or minus is found. The transfer request ends to
prevent transferring incorrect data to the file.
v Data for this field is missing. The default values are used. This error occurs
when a data field is defined, but the data is not in the file. This means that the
end of the record is reached before all of the defined data is found.
The field or fields for which data has been defined but not found then fill with
default values and transfer to the file. The default values are EBCDIC spaces for
character fields, or zeros for numeric and hexadecimal fields.
To supply your own default values, use the default (DFT) keyword in the data
description specifications (DDS) for the file.
v Extra data is found at the end of this record. The extra data is not transferred.
Data found at the end of this record and not defined by the system data
definitions or workstation file-description file is not transferred to the system
file, because no definitions exist to define the data and how it should change.
When you transfer data from an ASCII text file to an AS/400 file without using a
file-description file, any extra data found past the record length specified for the
file is not transferred.
79
v Zoned decimal fields change into one of the following BASIC variables
depending on the field length and the number of decimal positions:
Zoned decimal fields of 4 bytes or less with no positions to the right of the
decimal point change to a BASIC integer of an equivalent value.
A zoned decimal field of 4 bytes or less, but with a decimal point, falls into
the following category.
Zoned decimal fields up to 7 bytes (including those that did not fall into the
previous category) change to a BASIC single-precision number of an
equivalent value.
Zoned decimal fields greater than 7 bytes change to a BASIC double-precision
number of an equivalent value.
v Packed decimal fields change into one of the following BASIC variables
depending on the length of the field:
Packed decimal fields of 2 bytes or less with no positions to the right of the
decimal point change to a BASIC integer of an equivalent value.
A packed decimal field of 2 bytes or less, but with a decimal point, falls into
the following category (up to 4 bytes).
Packed decimal fields of up to 4 bytes (including those that did not fall into
the previous category) change to a BASIC single-precision number of an
equivalent value.
Packed decimal fields greater than 4 bytes change to a BASIC
double-precision number of an equivalent value.
Note: Changes between binary, packed decimal, and zoned decimal numbers
with decimal points are not equivalent to their BASIC number
counterparts, because BASIC uses a binary number format that does not
always change into exact decimal fractions.
Transferring Data from BASIC Random Files: When you transfer data from
BASIC random files to system files, the data changes as follows:
v Hexadecimal fields transfer to the system file as unchanged hexadecimal data.
The field lengths as stored on the workstation should be the same as the field
lengths as stored on the system.
v ASCII character, date, time, and time-stamp data changes to EBCDIC character
data byte by byte.
v For null-capable AS/400 fields, null values (except date, time, and time stamp)
cannot be reliably detected and are not uploaded. For variable-length AS/400
fields, trailing blanks are removed and the field is converted to the
variable-length format.
v Numeric fields from BASIC random files (BASIC integers, single-precision
floating-point numbers, and double-precision floating-point numbers) change to
system binary data, zoned decimal data in EBCDIC format, or packed decimal
data in EBCDIC format.
Note: Because the change of floating-point numbers into decimal fractions is not
always exact, each number automatically changes into the most precise
number possible with respect to the system field length. If you want more
precision, specify a larger system field size.
Errors When Transferring Data from BASIC Random Files: When you transfer
data from a workstation BASIC random file to a system file, the following errors
can occur:
80
v Data in this field is too short for the system field. The data is padded. This error
occurs when the file contains character or hexadecimal data shorter than the
field length specified on the system. This error can occur if the workstation field
is defined as shorter than the system, or if the data in the last record of the file
is too short. Character fields are padded on the right with EBCDIC spaces, and
hexadecimal fields are padded with zeros.
v Data in this field is too long for the system field. The data is truncated. This
error occurs when the workstation file-description file defines character or
hexadecimal data as longer than the field length specified on the system.
For character data, this error occurs only if the extra bytes are not spaces. For
hexadecimal data, this error occurs only if the extra bytes are not zeros. These
extra bytes are then truncated so that the data fits into the specified AS/400
field.
v The value of numeric data is too large for the system field. The maximum
number is used. This error occurs when:
Numeric data in the workstation field does not fit into the specified number
of bytes for the system field.
The decimal value of a numeric field contains more digits than are specified
for the system field.
v Data in this field has too many decimal positions. The number is rounded down
to zero. In BASIC random processing, this error occurs if the value of the
number is too small to fit into the specified field.
For example, the number 0.00001 does not fit into a system zoned field specified
as being 2 bytes in length and 2 decimal positions to the right of the decimal
point. In this example, the resulting value is zero.
v Data for this field is missing. The default values are used. This error occurs
when a data field is defined, but the data is not in the file. This means that the
end of the file is reached before all of the defined data is found. For BASIC
random files, this error occurs only on the last record in the file, since there are
no explicit record delimiters.
When this error occurs, the field or fields for which data is defined, but not
found, are filled with default values and are transferred to the AS/400 file.
These default values are EBCDIC spaces for character fields and zeros for
numeric fields.
To supply your own default values, use the Default (DFT) keyword in the DDS
for the file.
When you transfer data from a BASIC random file to an AS/400 file, any data
shorter than the record length defined for the system file is padded with EBCDIC
spaces.
Because there are no record delimiters in BASIC random files, this error can occur
only on the last record of the file. This probably indicates that the record length of
the system file does not match the record length of the workstation file.
81
Therefore, character data in BASIC sequential files cannot contain ASCII double
quotation marks, because they are interpreted as the end of the character string.
v Fields are delimited by ASCII commas (X'2C'). Therefore, commas are not
allowed as date, time, or decimal separators.
v Each record is delimited from the next by a carriage return character (X'0D') and
a line feed character (X'0A'). The end-of-file character is X'1A'.
v Records and fields are variable in length.
Transferring Data to BASIC Sequential Files: The following list describes how
AS/400 data created by a BASIC-sequential-file-defined data definition changes:
v Hexadecimal fields change to equivalent ASCII characters for each half-byte.
Double quotation marks surround them.
For example, X'F3' expands to ASCII 22443322 and is written to the file.
v EBCDIC character, date, time, and time-stamp fields change byte by byte and are
mapped into ASCII characters as defined by the translation tables. ASCII double
quotation marks are added before and after the character string.
v Null fields are represented by the absence of the field (comma comma, or by a
single comma if the null field is the last field of the record).
v For null fields, successive commas in the file will result in a null value being
sent to the AS/400 system if the field is null-capable.
v In variable-length fields, if the AS/400 field is variable length, the field is
converted to the AS/400 variable-length format.
v Binary fields change to ASCII numeric. Leading zeros to the left of the decimal
point and trailing zeros to the right of the decimal point are removed.
For example, X'FFD3' appears as ASCII 2D3435. When displayed on an ASCII
device, the string appears as 45.
v Zoned decimal fields change to ASCII numeric. Leading zeros to the left of the
decimal point and trailing zeros to the right of the decimal point are removed.
For example, EBCDIC F0F0F9F5F2D6 with a field length that indicates two digits
to the right of the decimal point expands to ASCII 2D39352E3236. The string
appears as 95.26 when an editor displays it or it prints.
v Packed decimal fields change to ASCII numeric. Leading zeros to the left of the
decimal point and trailing zeros to the right of the decimal point are removed.
For example, X'871F' (no decimal point) changes to ASCII 383731. The string
appears as 871 when an editor displays it or it prints.
Transferring Data from BASIC Sequential Files: When you transfer data from
BASIC sequential files to AS/400 files, the data changes as follows:
v ASCII character, date, time, and time-stamp data changes to EBCDIC character
data on a byte by byte basis and to hexadecimal by changing 2 ASCII bytes into
1 hexadecimal byte.
v ASCII numeric data translates to system binary, zoned decimal, or packed
decimal data, depending on the specified data type. The lengths of the system
data and the workstation data might be different because the minus signs and
decimal points are stored in ASCII numeric fields, and leading and trailing
spaces are stripped away.
BASIC might create exponential numbers in these files. The data transfer
function also changes these numbers.
Each translated field is individually verified to ensure that the resulting field
length matches the specifications for that field. The data transfer function tries to
fit the workstation data into the system field.
82
Errors When Transferring Data from BASIC Sequential Files: When you transfer
data from a BASIC sequential file to a AS/400-defined file, the following errors can
occur:
v Data in this field is too long for the AS/400 field. The data is truncated. The
file-description file defines character data as longer than the field length
specified for the file.
If the data transfers to an EBCDIC field, this error occurs only if the extra bytes
are not spaces. If the data transfers to a hexadecimal field, this error occurs only
if the extra bytes are not zeros. These extra bytes are truncated so that the data
fits into the specified AS/400 field.
v The value of numeric data is too large for the system field. The maximum value
is used. This error occurs when:
Numeric data in the workstation field does not fit into the specified number
of bytes for the system field.
The decimal value of a numeric field contains more digits than were specified
for the system field.
The value of the field is set to the maximum value possible for the number of
bytes and digits specified by the AS/400 system.
v Data in this field has too many decimal positions. The number is rounded. This
error occurs when the number of decimal positions in the workstation field is
greater than the number of decimal positions specified on the system. The extra
bytes are significant, because the data is rounded up if the first extraneous digit
is 5 or greater, and is rounded down if it is less than 5.
v Data in this field is incorrect or does not match the workstation data type. This
error occurs when a field defined as numeric by the file description contains
nonnumeric data. This could also result if a character or hexadecimal field
contains a numeric field, or if a numeric (zoned, packed, or binary) field
contains a character field.
When this error occurs, the transfer request ends to prevent transferring
incorrect data to the system file.
v Data for this field is missing. The default values are used. This error occurs
when a data field is defined, but the data is not in the file. This means that the
end of the record is reached before all of the defined data is found.
When this error occurs, the field or fields for which data has been defined, but
not found, are filled with default values and transferred to the AS/400 file.
These default values are EBCDIC spaces for character fields, or zeros for
numeric fields.
To supply your own default values, use the default (DFT) keyword in the DDS
for the file.
v Data in this field exceeds the workstation field size. The data is lost. This error
occurs when extra data, not defined by the file-description file, is found at the
end of a character field. The extra bytes are truncated and are not transferred to
the system file.
v Extra data found at the end of the record. The extra data is not transferred. This
error occurs when extra data is found at the end of the record, and has not been
defined by the system data definitions or workstation file-description file. This
extra data is not transferred to the system, because no definitions exist to define
the data and describe how it should change.
83
DIF is used for data interchange between spreadsheet programs and other
application programs.
The data transfer function supports only the following two data types within DIF
files:
v Character data: The data in a character cell (think of a cell as one field in one
record) must be enclosed in double quotation marks if there is an embedded
space in the string. However, if the string begins with a quotation mark, it must
also end with a quotation mark.
v Numeric data: The numeric data supported by the data transfer function
consists of a decimal number that can contain a minus sign or a decimal point or
both. The data transfer function also supports exponential numeric data.
Transferring Data to DIF Files: When creating a DIF file, system data changes as
follows:
v Hexadecimal fields change to equivalent ASCII characters for each half-byte.
Double quotation marks surround them.
v EBCDIC character, date, time, and time-stamp data changes byte by byte and is
mapped into ASCII characters as defined by the translation tables. ASCII double
quotation marks are added before and after the character string.
v Binary fields change to ASCII numeric. Leading zeros to the left of the decimal
point, and trailing zeros to the right of the decimal point, are removed.
v Zoned decimal fields change to ASCII numeric. Leading zeros to the left of the
decimal point, and trailing zeros to the right of the decimal point, are removed.
For example, EBCDIC F0F0F9F5F2D6 with a field length that indicates two digits
to the right of the decimal point expands to ASCII 2D39352E3236. When
displayed or printed, the string appears as 95.26.
v Packed decimal fields change to ASCII numeric. Leading zeros to the left of the
decimal point, and trailing zeros to the right of the decimal point, are removed.
For example, X'871D' (no decimal point) changes to ASCII 2D383731. When
displayed or printed, the string appears as 871.
v If untranslatable data is found, the entire field becomes an error cell. An error
cell results when untranslatable data is found when a DIF file is created or when
a not valid calculation is done using the DIF file with a spreadsheet program.
Transferring Data from DIF Files: If an error cell is found when data is
transferred from a DIF file to the AS/400 system, one of the following things can
occur, depending on the type of data in the file:
v If the system field is a character (EBCDIC) field, it is filled with untranslatable
characters (hexadecimal zeros) and is transferred to the system. A message
appears, telling you how many bytes of untranslatable data have transferred.
v If the system field is a hexadecimal, zoned, packed, or binary field, you receive
an error message telling you that the data in this cell is incorrect, and that the
data was not transferred to the system.
When you transfer data from a system file to a DIF file, the field names are placed
in the first record and you can consider them column headings. When you transfer
DIF files back to the system, the first row must either be these field names (exactly
as they are defined on the system) or data. If the first row does not consist of field
names, the file is processed as if it contains only data.
No DIF header information is used when sending the file to the AS/400 system. To
correctly transfer a DIF file to the system, ensure that the file is in the correct
84
format (row and column). It is essential that the field names, if present, make up
the first row of data. The subsequent records make up the remaining rows of data.
Therefore, when you transfer the data to the AS/400 system, the file must be saved
in the same format as originally created by the data transfer function.
When you transfer data from DIF files to AS/400 files, the data changes as follows:
v ASCII character, date, time, and time-stamp data is changed to EBCDIC
character data or to hexadecimal data. ASCII-to-EBCDIC conversion is done byte
by byte. ASCII-to-hexadecimal conversion is done by changing two ASCII bytes
to one hexadecimal byte.
v ASCII numeric data changes to system binary, zoned decimal, or packed decimal
data, depending on the data type the system specifies.
The lengths of the fields on the system and the workstation can be different,
because of the explicit way minus signs and decimal points are stored in ASCII
numeric fields. This means that each field changes individually, to ensure that
the resulting field length matches the system specifications for that field. The
data transfer function tries to fit the workstation data into the system field.
v In null fields, a NULL DIF character field results in a null value being sent to
the AS/400 field if the field is null-capable.
v If the AS/400 field is variable-length, the field is converted to the AS/400
variable-length format.
Errors When Transferring Data from DIF Files: When you transfer data from a
workstation DIF file to a system file with data definitions, the following errors can
occur:
v Data in this workstation file is not valid, or the version of this workstation file is
not supported. The DIF file does not follow the standard DIF format. Processing
ends, and no more records are transferred.
v Data in this field is too long for the AS/400 field. The data is truncated. The
workstation file-description file defines character or numeric data as longer than
the field length specified for the system file.
For character data, this error occurs only if the extra bytes are not spaces. For
hexadecimal data, this error occurs only if the extra bytes are not zeros. The
extra bytes are truncated so that the data fits into the specified AS/400 field.
v The value of numeric data is too large for the system field. The maximum value
is used. This error occurs when:
Numeric data in the workstation field does not fit into the specified number
of bytes for the AS/400 field.
The decimal value of a numeric field contains more digits than are specified
for the system field.
The value of the field is set to the maximum value possible for the number of
bytes and digits the system specifies.
v Data in this field has too many decimal positions. The number is rounded. The
number of decimal positions in the workstation field is greater than the number
of decimal positions specified on the system. The data is rounded up if the first
extraneous digit is 5 or greater, and is rounded down if it is less than 5.
v Data in this field is incorrect or does not match the workstation data type. One
of the following things has occurred:
A numeric field contains nonnumeric data.
A character or hexadecimal field contains a numeric field or a numeric
(zoned, packed, or binary) field contains a character field.
Chapter 4. Data Transfer for PC400
85
BIFF Files
In a BIFF file, data is expressed in lines and columns. A BIFF file contains character
and numeric data (positive and negative decimal values).
The BIFF file format is used in EXCEL. The supported BIFF version is 4 (EXCEL
4.0).
The transfer facility supports only the following two data types for a BIFF file:
v Character data
v Numeric data
Transferring Data to BIFF Files: When a BIFF file is created, the system data is
converted to equivalent EXCEL cell data.
If untranslatable data is found, the entire field is treated as an error cell.
Transferring Data from BIFF Files: If an error cell is found during data transfer
from a BIFF file to the AS/400 system, either of the following things can occur
depending on the data type of the file:
v If the system field is a character (EBCDIC) field, the error cell containing
untranslatable characters (hexadecimal zeros) is transferred to the system. A
message indicating how many bytes of untranslatable data were transferred is
displayed.
v If the system field is a hexadecimal, zoned decimal, packed decimal, or binary
field, an error message indicating that the data in this cell is not valid and thus
has not been transferred to the system is displayed.
When you transfer data from a system file to a BIFF file, the first record contains
field names, which can be treated as column headers.
86
To return a BIFF file to the system, the first line must contain these field names (as
defined in the system) or data. If the first line does not contain field names, the file
is regarded as containing data only.
When a file is sent to the AS/400 system, cell information (such as the character
size and font information) is ignored. This means that cell information is lost, even
if the contents of a BIFF file that have been sent to the AS/400 system are
retransmitted to a workstation.
When you transfer data from a BIFF file to an AS/400 file, the data is converted as
follows:
v ASCII character cell data is converted to EBCDIC character data or hexadecimal
data; 1-byte ASCII data is converted to 1-byte EBCDIC data.
v ASCII numeric cell data is converted to a binary number, or a zoned or packed
decimal number, depending on the data type specified in the system.
When you transfer data from a BIFF file to the AS/400 system, the following
specific processing is performed:
v When you transfer data to a BIFF file, the first record contains the names of the
fields to be transferred, which can be treated as column headers. To return a
BIFF file to the AS/400 system, the first line must contain the same field names
(as defined in the AS/400 system) or data. If the first line or the first set does
not contain a character field that exactly matches the AS/400 field, the file is
treated as being a file with no column headers, and only data is processed.
v When you transfer a BIFF file to the AS/400 system, header information is not
used.
v To ensure correct transfer of a BIFF file to the AS/400 system, the file format
must be valid (lines and columns). Data for each set or line must correspond to
one record in the AS/400 file.
Errors When Transferring Data from BIFF Files: When you transfer data from a
BIFF file on a workstation to the system file with the data definition, the following
errors can occur:
v Data in this workstation file is not valid, or the version of this workstation file is
not supported. The BIFF file does not conform to the standard BIFF format.
Processing terminates, and no more records are transferred.
v Data in this field is too long for the corresponding AS/400 field. The data is
truncated. A file-description file defines character or numeric data that is longer
than the field specified in the system file.
For conversion from ASCII to EBCDIC, this error occurs if a file-description
file defines ASCII data that is longer than the field specified in AS/400
system.
During conversion from ASCII to hexadecimal, this error will occur if a
file-description file defines ASCII data that is twice as long as the field
specified in AS/400 system. This is because 2-byte ASCII data is converted to
one hexadecimal character.
A truncation error only occurs if excess bytes are other than blanks (X'20')
during conversion from ASCII to EBCDIC, or other than zeros (X'30') during
conversion from ASCII to hexadecimal. Truncating these excess bytes enables
data to fit into the specified AS/400 fields.
v Numeric data is too long to fit into the corresponding AS/400 field. The
maximum value is assumed. This error occurs under either of the following
conditions:
Chapter 4. Data Transfer for PC400
87
Numeric data in a workstation field is too long to fit into the number of bytes
specified for the AS/400 field.
The number of decimal digits in a numeric field exceeds the number of digits
specified for the AS/400 field.
The field value is set to the maximum value that can be specified for the number
of bytes, and that for the number of digits, specified for the AS/400 system.
v Data in this field contains too many decimal places. The data is rounded off. The
number of decimal places in a workstation field is greater than the number of
decimal places specified for the system. If the first excess digit is 5 or more, the
data is rounded up. Otherwise, it is rounded down.
v Data in this field is not correct, or its type does not match the type of
workstation data. One of the following things has occurred:
A numeric field contains other than numeric data.
A character field or a hexadecimal field contains a number, or a numeric
(zoned or packed decimal, or binary) field contains characters.
A hexadecimal field or a numeric (zoned or packed decimal, or binary) field
for the AS/400 contains a BIFF error cell.
If this error occurs, the transfer request terminates to avoid transferring incorrect
data to the system file.
v Data for this field is missing. This error occurs if the data field is defined, but
the file does not contain any data. This means that the end of the record is
reached before all defined data has been found.
If this error occurs (that is, if data is defined for one or more fields, but it is not
found there) the fields containing the default value are transferred to the system
file. The default value is EBCDIC spaces for a character field and zeros for a
numeric field.
To specify a user-specific default value, use the default value (DFT) keyword in
DDS for the file.
v Data in this field exceeds the size of a workstation field. Data is lost. This error
occurs if excess data, not defined in the workstation file-description file, is found
at the end of the field. For character data, excess bytes are truncated, and not
transferred to the system file. For numeric data, the entire field is converted to
zeros and transferred to the system file.
v Excess data is found at the end of this record. The excess data is not transferred.
This error occurs if such excess data is not defined in the AS/400 data definition
or in the workstation file-description file. This excess data is not transferred to
the system, because the data and the conversion method are not defined.
88
v Binary fields on the AS/400 system and the workstation are represented as
two-complement numbers, so it is unnecessary to change individual bytes. The
workstation uses the convention of storing numeric values with the least
significant byte in the left-hand byte position. The data transfer function then
reverses the order of the bytes in the binary fields.
For example, X'CEF3', coming from the system as a 2-byte binary number
(representing the value 12557), appears as X'F3CE'.
v EBCDIC character, date, time, and time-stamp data changes byte by byte and is
mapped into ASCII characters as defined by the translation tables.
v Variable-length and null fields are converted to fixed length, and trailing blanks
(for character, hex, date, time, and time stamp) or zeros (for binary, zoned, and
packed) are added to the maximum length of the field.
v Hexadecimal fields do not change.
v Packed decimal fields do not change except for the last half-byte, which contains
the sign. The workstation uses X'3' to indicate a positive number and X'B' to
indicate a negative number in the sign half-byte.
For example, X'0865431F' appears as X'08654313'.
v Zoned decimal fields from the system change from EBCDIC to ASCII, as do
character fields, except that the sign half-byte in the workstation changed field is
X'3' to indicate a positive number and X'B' to indicate a negative number.
For example, EBCDIC X'F0F1F2F5F2D6' appears as ASCII X'3031323532B6'.
Transferring Data from DOS Random Files: When you transfer data from DOS
random files to AS/400 files, the data changes as follows:
v ASCII character, date, time, and time-stamp data changes to EBCDIC character
data on a byte by byte basis.
v Binary fields in the workstation file are stored in an order reversed from what
the system file expects. These bytes reverse and transfer to the system file.
v Hexadecimal fields do not change. The field length on the system should be the
same as the field length on the workstation.
v For packed decimal fields, only the last half-byte (the byte that contains the sign)
is changed. The host system uses X'F' to indicate a positive number and X'D' to
indicate a negative number for the sign half-byte.
For example, X'08654313' appears as X'0865431F'.
v Zoned decimal fields on the workstation change from ASCII to EBCDIC (ASCII
to EBCDIC for DBCS), as do character fields. The last half-byte (the half-byte
that contains the sign) in the workstation field is changed to X'F' to indicate a
positive number and X'D' to indicate a negative number.
For example, ASCII X'3031323532B6' appears as EBCDIC X'F0F1F2F5F2D6'.
v For null-capable AS/400 fields, null values (except date, time, and time stamp)
cannot be reliably detected and are not uploaded. For variable-length AS/400
fields, trailing blanks are removed, and the field is converted to the
variable-length format.
Errors When Transferring Data from DOS Random Files: When you transfer
data from a DOS random file to an AS/400 file, the following errors can occur:
v Data in this field is too short for the system field. The data is padded. This error
occurs when the workstation file contains character or hexadecimal data shorter
than the specified field length. It also occurs if the length of the workstation
field is defined as less than the system field, or if the data in the last record of
the file is too short. Character fields are padded on the right with EBCDIC
spaces. Hexadecimal fields are padded on the right with zeros.
Chapter 4. Data Transfer for PC400
89
v Data in this field is too long for the system field. The data is truncated. This
error occurs when the workstation file-description file defines character or
hexadecimal data as longer than the field length specified for the system file.
For character data, this error occurs only if the extra bytes are not spaces. For
hexadecimal data, this error occurs only if the extra bytes are not zeros. These
extra bytes are truncated so that the data fits into the specified field.
v The value of numeric data is too large for the system field. The maximum value
is used. This error occurs when:
Numeric data in the workstation field does not fit into the specified number
of bytes for the AS/400 field.
The decimal value of a numeric field contains more digits than were specified
for the AS/400 field.
The value of the field is set to the maximum value possible for the number of
bytes and digits specified by the system.
v Data in this field has too many decimal positions. The number is rounded. This
occurs when the number of decimal positions in the workstation field is greater
than the number of decimal positions specified on the system. The extra bytes
are significant, because the data rounds up if the first extraneous digit is 5 or
greater, and rounds down if it is less than 5.
v Data in this field is incorrect or does not match the workstation data type. This
error occurs when nonnumeric data appears in a field defined as numeric by the
file descriptions. When this occurs, the transfer request ends to prevent
transferring incorrect data to the system file.
v Data for this field is missing. The default values are used. This error occurs
when a data field is defined, but the data is not in the file. This means that the
end of the file is reached before all the defined data is found.
When this error occurs, the field or fields for which data has been defined, but
not found, fill with default values and transfer to the system file. Default values
are EBCDIC spaces for character fields, or zeros for numeric fields.
To supply your own default values, use the default (DFT) keyword in the DDS
for the file.
When you transfer data from a DOS random file to a system file without data
definitions, any data shorter than the record length defined for the system file is
padded with EBCDIC spaces.
Because DOS random files have no record delimiters, this error occurs only on the
last record and probably indicates that the record length of the system file does not
match that of the workstation file.
90
zoned decimal data types represented this way. Use the DOS random type-2
file type for those workstation applications.
Transferring Data to DOS Random Type-2 Files: When you create DOS random
type-2 file data definitions, system data changes as follows:
v Binary fields on the AS/400 system and the workstation are represented as two
complement numbers, so it is unnecessary to change individual bytes. The
workstation uses the convention of storing numeric values with the least
significant byte in the left-hand byte position. The data transfer function then
reverses the order of the bytes in binary fields.
For example, X'CEF3', coming from the system as a 2-byte binary number
(representing the value 12557), appears as X'F3CE'.
v EBCDIC character, date, time, and time-stamp fields change byte by byte and are
mapped into ASCII characters as defined by the translation tables.
v Variable-length and null fields are converted to fixed length, and trailing blanks
(for character, hex, date, time, and time stamp) or zeros (for binary, zoned, and
packed) are added to the maximum length of the field.
v Hexadecimal fields do not change.
v Packed decimal fields do not change. The sign convention used on the
workstation and on the host system is the same.
For example, X'0865431C' appears as X'0865431C'.
v Zoned decimal fields from the system change from EBCDIC to ASCII, as do
character fields. However, the sign half-byte is changed to a 3 to indicate a
positive number or a 7 to indicate a negative number when the data is sent to
the workstation.
For example, EBCDIC X'F0F1F2F5F2D6' appears as ASCII X'303132353276'.
Transferring Data from DOS Random Type-2 Files: When you transfer data from
DOS random type-2 files to AS/400 files, the data changes as follows:
v ASCII character data, date, time, and time stamp data change to EBCDIC
character data on a byte by byte basis.
v Binary fields in the workstation file are stored in an order reversed from what
the system file expects. These bytes reverse and transfer to the system file.
v Hexadecimal fields do not change. The field length on the system should be the
same as the field length on the workstation.
v For packed decimal fields, the last half-byte (the half-byte that contains the sign)
is not changed unless the sign half-byte is less than X'A' (represented by values
0 through 9). If the sign half-byte is less than X'A', it is changed to X'F' on the
host system.
For example, X'865431D' appears as X'0865431D', but X'08654318' appears as
X'0865431F'.
v Zoned decimal fields on the workstation change from ASCII to EBCDIC, as do
character fields. However, the sign half-byte is changed to an F to indicate a
positive number or a D to indicate a negative number when the data is sent to
the host system.
For example, ASCII X'303132353276' appears as EBCDIC X'F0F1F2F5F2D6'.
v For null-capable AS/400 fields, null values (except date, time, and time stamp)
cannot be reliably detected and are not uploaded. For variable-length AS/400
fields, trailing blanks are removed and the field is converted to the
variable-length format.
91
Errors When Transferring Data from DOS Random Type-2 Files: When you
transfer data from a DOS random type-2 file to an AS/400 file, the following errors
can occur:
v Data in this field is too short for the system field. The data is padded. This error
occurs when the workstation file contains character or hexadecimal data shorter
than the specified field length. It also occurs if the length of the workstation
field is defined as less than the system field, or if the data in the last record of
the file is too short. Character fields are padded on the right with EBCDIC
spaces. Hexadecimal fields are padded on the right with zeros.
v Data in this field is too long for the system field. The data is truncated. This
error occurs when the workstation file-description file defines character or
hexadecimal data as longer than the field length specified for the system file.
For character data, this error occurs only if the extra bytes are not spaces. For
hexadecimal data, this error occurs only if the extra bytes are not zeros. These
extra bytes are truncated so that the data fits into the specified field.
v The value of numeric data is too large for the system field. The maximum value
is used. This error occurs when:
Numeric data in the workstation field does not fit into the specified number
of bytes for the AS/400 field.
The decimal value of a numeric field contains more digits than were specified
for the AS/400 field.
The value of the field is set to the maximum value possible for the number of
bytes and digits specified by the system.
v Data in this field has too many decimal positions. The number is rounded. This
occurs when the number of decimal positions in the workstation field is greater
than the number of decimal positions specified on the system. The extra bytes
are significant, since the data rounds up if the first extraneous digit is 5 or
greater, and rounds down if it is less than 5.
v Data in this field is incorrect or does not match the workstation data type. This
error occurs when nonnumeric data appears in a field defined as numeric by the
file descriptions. When this occurs, the transfer request ends to prevent
transferring incorrect data to the system file.
v Data for this field is missing. The default values are used. This error occurs
when a data field is defined, but the data is not in the file. This means that the
end of the file is reached before all the defined data is found.
When this error occurs, the field or fields for which data has been defined, but
not found, fill with default values and transfer to the system file. Default values
are EBCDIC spaces for character fields, or zeros for numeric fields.
To supply your own default values, use the default (DFT) keyword in the DDS
for the file.
When you transfer data from a DOS random type-2 file to a system file without
data definitions, any data shorter than the record length defined for the system file
is padded with EBCDIC spaces.
Because DOS random type-2 files have no record delimiters, this error occurs only
on the last record and probably indicates that the record length of the system file
does not match that of the workstation file.
No-Conversion Files
No-conversion files, defined by the data transfer function, consist of data that has
not changed. For example, when data transfers from the system to a workstation
92
no-conversion file, the data transfers exactly as it is stored on the AS/400 system.
Date, time, and time-stamp data transfers to EBCDIC character data on the
workstation.
Transferring Data to No-Conversion Files: When you transfer data from the
AS/400 system to a no-conversion file, the data transfers exactly as it is stored on
the system.
Variable-length AS/400 fields are converted to fixed-length fields, and trailing
EBCDIC blanks are added to the maximum length of the field.
Date, time, and time-stamp data is converted to EBCDIC character data.
Variable-length and null fields are converted to fixed length, and trailing EBCDIC
blanks (for character, hex, date, time, and time stamp) or EBCDIC zeros (for binary,
zoned, and packed) are added to the maximum length of the field.
Transferring Data from No-Conversion Files: The data types that exist in a
no-conversion file are EBCDIC system data types only. When a no-conversion file
transfers to the system, the data transfer function performs no data change or
translation. Date, time, and time-stamp data transfers to EBCDIC character data on
the workstation.
However, the data transfer function verifies that all numeric data is in the correct
EBCDIC format. If any numeric data is found that is not in the correct EBCDIC
format, that data and any remaining data does not transfer.
Errors When Transferring Data from No-Conversion Files: When you transfer
data from a workstation no-conversion file to a system file, the following errors
can occur:
v Data sizes are not equal. When you transfer no-conversion files, the length and
decimal position specifications for the system and the workstation must match
exactly. If not, no records transfer.
v Data in this field is too short for system field. The data is padded. This error
occurs when the workstation file contains character or hexadecimal data shorter
than the field length specified for the system file. This could occur if the data in
the last record of the file is too short. Character fields are padded on the right
with EBCDIC spaces. Hexadecimal fields are padded with zeros.
v Data in this field is incorrect or does not match the workstation data type. The
transfer request ends to prevent transferring incorrect data to the system file.
This error occurs when a field defined by the file descriptions as numeric
contains nonnumeric data.
Note: The data is verified assuming that the data is in EBCDIC format. If you
want to transfer data in another format, do not use data definitions or file
descriptions, and specify the record lengths defined on the system and the
workstation in the same way.
v Data for this field is missing. The default values are used. This error occurs
when a data field has been defined, but the data is not in the file. This error can
occur only in the last record of the file, since no-conversion files have no explicit
record delimiters.
When this error occurs, the field or fields for which data has been defined but
not found fill with default values and transfer to the system file. These default
values are EBCDIC spaces for character fields, or zeros for numeric fields.
93
To supply your own default values, use the default (DFT) keyword in the DDS
for the file.
94
Host Requirements
For PC400 File Transfer in SBCS mode, you need one of the following host
file-transfer programs (referred to as APVAFILE):
v Personal Communications Tools/400 8mm Tape 46H8350
v Personal Communications Tools/400 1/2 inch Tape 85G9973
v Personal Communications Tools/400 1/4 inch Tape 85G9969
For PC400 File Transfer in DBCS mode, you need one of the following host
file-transfer programs (referred to as APVAFILE):
v Personal Communications Tools/400 V1R1, 5799-QBX (Japan)
v Personal Communications Tools for OS/400 V1R1, 5799-FPZ (Korea, China,
Taiwan)
Note:
PCT400 was withdrawn from marketing 3/98.
You can perform the following file transfer functions:
v Send files to the host system
v Receive files from the host system
v Use lists of files
v Create templates to define file names and transfer types
v Define transfer types
v Set transfer options
v Modify translation tables
v Transfer files via the XMODEM or YMODEM protocols
95
Transferring Files
96
Transferring Files
1. Click Receive File from Host from the Actions menu or Send File to Host
from the Actions menu of the session window; or click the Send or Receive
buttons on the tool bar.
The corresponding window appears.
2. Select a file to be transferred from the Host-File Name or PC-File Name list
box by pointing to the name of a file to be selected. While holding down the
Ctrl key, click the left mouse button.
The file name, its corresponding workstation or host file name (according to the
available templates), and the transfer type appear in the Transfer List part of
the window.
Note: You can also click the Browse button (for sending files) or the Clipboard
button (for receiving files) to open the corresponding dialog box, which
allows you to select files for transferring; when you click OK, the
selected files are shown in the Transfer List.
3. Click the Add to List button to include a selected file in the Transfer List.
4. After all desired files have been selected, click Save List.
The Save File-Transfer List File As window appears.
5. Enter or select a list name, and click OK.
Editing Lists
To edit the contents of a previously created list:
1. As explained in Sending Files to the Host System on page 95 and Receiving
Files from the Host System on page 96, display the Send File to Host or
Receive File from Host window.
2. Select Open List.
The Open File-Transfer List File window appears.
3. Select the name corresponding to the list file to be edited, then click OK.
4. The contents of the selected list appear in the Send File to Host or Receive File
from Host window.
5. Edit the contents of the list file.
97
Transferring Files
Managing Templates
A template is a set of rules to be used by the workstation to automatically generate
a workstation or host file name and transfer type when you specify a file to be
sent or received.
You can have up to 32 templates. They are automatically numbered from 1 to 32.
When you specify a file to be transferred, the workstation scans the templates,
starting from template 1. It uses the first matching template to generate a name for
the transferred file and the transfer type.
To manage a template:
1. Click Receive File from Host from the Actions menu or Send File to Host
from the Actions menu of the session window; or click the Send or Receive
buttons on the tool bar.
The Send File to Host or Receive File from Host window appears.
2. Select Template.
The Template window appears. The contents of the window depend on the
connected host system.
Adding Templates
The list box for the Template window lists the currently stored templates.
To add a template:
1. Select any template from the list box.
The contents of the selected template appear under the list box.
2. Change the workstation or host file names or extensions by overwriting them;
then select the transfer type. (For details of the transfer types, see Defining
Transfer Types on page 99.)
3. Click Add.
The window for determining where in the list to display the new template
appears.
4. Select a template number and specify whether to display the new template
before or after the template that has that number. Click OK.
The new template is added to the list in the appropriate position.
Testing Templates
To test the contents of an added or changed template:
1. Select the template to be tested from the list box.
98
Transferring Files
The number of the selected template appears in the Test Templates box in the
lower part of the window.
2. Select or enter data for the following items:
Test Mode
Determine which mode is to be used for the test: the mode in which a
file is transmitted from the workstation to the host system (send), or
the mode in which a file is transmitted from the host system to the
workstation (receive).
Templates
Determine which templates to test: only the template selected in step 1,
or all registered templates.
Source File
Enter the name of the file to be used for the test.
3. Click Test.
Target File indicates the name that has been generated by the template.
Note: Testing a template does not transfer a file.
Items to Be Specified
Choosing the appropriate property page enables you to set the items described in
the following sections.
File Options
The file options that can be used depend on the type of the connected host system
and the host code page selected when the session was configured. Table 17 on
page 100 lists the mode values for the file transfer options. File Transfer for
PC400 on page 103 lists transfer options.
99
Transferring Files
Table 17. Mode Values for File Transfer Options
Mode
DBCS
SBCS
Others
Additional Options
The required host command options can be entered in the Additional Options text
box.
Data Transfer
You can choose whether the Data Transfer function (see Chapter 4, Data Transfer
for PC400 on page 25) is to be used instead of the normal file transfer function.
100
Transferring Files
Host Command
You can specify host command to be called when file transfer starts. If nothing is
entered in this text box, APVAFILE is used for 5250 sessions.
Default PC Directory
You can specify the default directory that appears in the Send File to Host or
Receive File From Host window. To select the directory, click the Browse button.
Default Library
You can specify the AS/400 library to be used as the default.
PC Code Page
When a file is transferred, EBCDIC codes are converted to 1-byte workstation
codes, and vice versa. A valid value is automatically selected from among the
following values for SBCS sessions: 437, 737, 806, 813, 819, 833, 850, 852, 854, 857,
858, 860, 861, 862, 863, 864, 865, 866, 869, 874, 912, 915, 916, 920, 921, 922, 1008,
1089, 1124, 1125, 1127, 1129, 1131, 1133, 1153, 1155, 1156, 1157, 1158, 1160, 1164, 1250,
1251, 1252, 1253, 1254, 1255, 1256, 1257, and 1258; and from the following values
for DBCS sessions: 897 and 1041 (Japanese); 1088 and 1126 (Hangeul); 1114
(Simplified Chinese and Traditional Chinese)according to the host code page
specified when the workstation is configured. For an explanation of how to select
host code pages, see the online help for the host code page.
File-Transfer Timeout
You can define the time the workstation waits for a response from the host system
(in seconds). If the host system does not respond, the transfer is canceled, and an
error message appears. A number in the range 2065535 (or 0) can be specified.
The default timeout is 30 seconds. Specify an appropriate value such that the error
message does not appear too early. If you specify 0, a timeout is not set.
If a packet or block size is relatively large for low-speed lines, such as SDLC or
COM port lines, it is recommended that 150 seconds or greater be specified.
101
Transferring Files
102
Transferring Files
103
Transferring Files
By default, the message records segmented. is not displayed. To display the
message:
Look for the profile for the session you will use. Normally, this will be in the
application data directory under the name filename.WS (filename is a
user-specified file name).
Use an editor to insert the following sentence into the [Transfer] section. If there
is no [Transfer] section, first enter [Transfer]. Be careful to enter it correctly.
DisplayTruncateMessage=Y
or
[Transfer]
DisplayTruncateMessage=Y
The next time the session is started, this specification becomes active.
104
Transferring Files
Use the DSPMBRLST command to list AS/400 files or members. The command
format is as follows:
DSPMBRLST LIB(lib-name) FILE(file-name)
LIB parameter
The LIB parameter contains the target library name. The default value is
*USRLIBL. Extensive specification, such as *ALL, * for generic name, is
possible, but is time consuming. AS/400 files or members are listed more
efficiently if a specific name is specified.
FILE parameter
The FILE parameter contains the target file name. There is no default
value. The parameter must be specified. *ALL and * for generic name can
be specified.
Executing this command lists Library/File(Member) on the screen. If they cannot
be listed on one screen, MORE... is displayed in the lower right corner of the
screen. Use the next page or the preceding page key to scroll the screen. Create a
list for Paste with the Copy or the CopyAppend function of the Edit menu, as
required.
Specifying the JISCII option when receiving a file does the following:
v Converts EBCDIC codes to 1-byte workstation codes
v Converts IBM kanji codes to 2-byte codes
v Removes SO (hex 0E) and SI (hex 0F) before and after a kanji field
For other DBCS sessions, such as Korean, Chinese, or Taiwanese, specify the ASCII
file transfer option.
105
106
Chapter 6. Printing
You can use Personal Communications to print from display or printer sessions.
From display sessions, you can print all (Print Screen) or part (Trim Print) of the
screen of your session window on a workstation printer. Trim Print is not available
for PC400 sessions. For more information, refer to Quick Beginnings or the online
help.
You can map a key sequence to bring up the Printer Setup dialog. There is no
default key combination for this function. See Default Key Function Assignments
on page 17 for more information about keyboard functions.
From printer sessions, you can direct printing from an S/390 or AS/400 system to
a workstation printer.
Note: When you use a host application which prints to your workstations LPT1,
you must first select the printer in the Printer Setup dialog of the File
menu.
Configure a printer session to designate a workstation printer as a system printer
that will use either a Windows printer driver or a printer definition table (PDT)
provided with Personal Communications.
v Use Windows printer drivers for Personal Communications to print files based
on printer setup parameters, such as scaling, duplex options, and page
orientation, that you define in Printer Setup.
v Use PDT files for Personal Communications to print files based on page setup
information, such as control codes and the printer output format, defined in the
PDT. You can customize PDTs to define your own controls, by editing the
corresponding printer definition file (PDF) and converting it to a PDT.
For considerations and restrictions on printing, refer to Chapter 3, Considerations
for Using PC400 Sessions on page 15.
107
Printing
3. Confirm that Use PDT is not selected.
PDT Files
Basic Support
PDTs (printer definition tables) are compiled from PDFs (printer definition files).
PDFs contain printer commands that must be understood/supported by your
printer.
The following are the basic printer languages:
PCL
108
Printing
Older SBCS PDFs and PDTs are no longer shipped with Personal Communications,
but are available at the following website:
http://www.ibm.com/software/network/pcomm. If you already have modified
PDFs, any PDF and PDTs with different names than those in Table 18 are retained
during an install.
Note: All DBCS PDFs and PDTs are still shipped with Personal Communications.
The End_Job statement in a PDF contains the printer commands that are sent to the
printer at the end of each print job. If the End_Job contains a character defined as
form feed (FFF in the PDT), a form feed (FF) is sent to the printer. It is not needed
if the host application ends the job with the FF, as is commonly done. Some print
drivers add the FF if needed, and most print drivers ignore extra FFsl. So the FFF
usually is protection against the host application not using a FF, and usually causes
no problem. However, if you get an extra blank page, remove the FFF.
Table 18. Old Printer Definition Files
Printer Definition File (PDF) Name
Remarks
ibm5577
ibm5577a
(No FFF)
ibm5577b
(No FFF)
lbp4
lips3a4
lips3b4
The supplied basic_ascii PDF does not contain any printer commands, which
results in only ASCII text being sent to a printer or file. An accompanying PDT is
also shipped. This PDF is for SBCS only.
PFT Migration
You can migrate a PC Support/400 Workstation Feature Printer Function
Table (PFT) to a PDF for PC400. Refer to the Administrators Guide and
Reference for more information.
109
Printing
v KSSM_WAN.PDT
v NPPAGES.PDT
The printers to use with these PDTs are as follows:
File Name
--------IBM5577.PDT
IBM5585.PDT
IBM5587.PDT
ESC_P.PDT
ESC_BIG5.PDT
ESC_CNS.PDT
ESC_5550.PDT
ESC_TCA.PDT
KS_JO.PDT
KS_WAN.PDT
KSSM_JO.PDT
KSSM_WAN.PDT
NPPAGES.PDT
Printer Name/Model
-----------------IBM 4208-501, -5C2, -5K2
IBM 4216-510
IBM 5572-B02
IBM 5573-HC2
IBM 5575-B02, -F02, -H02, BC2, -FK1E
IBM 5577-B02, -G02, -H02, FC2, -HC2, -KC2,-HK2
IBM 5579-H02, -KC2
IBM 5585-H01, -HC1
IBM 5587-G01
IBM 5587-H01 (with extended functions)
IBM 5589-H01
IBM 5587-G01
IBM 5587-H01 (without extended functions)
ESC/P printer for China or Japan
ESC/P printer with Big5 DBCS code
ESC/P printer with CNS DBCS code
ESC/P printer 5550 DBCS code
ESC/P printer with TCA DBCS code
KS printer with combination code
KS printer with completion code
KSSM printer with combination code
KSSM printer with completion code
IBM NP12, NP17, NP24 printers for Japan
Printer Name/Model
-----------------IBM NP12, NP17, and NP24 in PAGES mode
All
All
All
IBM
types of IBM
types of IBM
types of IBM
5577-S02/T02
5585 printers
5587 printers
5577 printers
for Postal Bar Code Support (Japan only)
110
Parameter
Description
CPI
LPI
Specifies the number of lines to be printed per inch. If LPI was not
set previously, an LPI value suitable for the font selected from the
Font list box is assumed as the default.
Printing
Table 19. Page Setup Parameters Text (continued)
Parameter
Description
Maximum Number of Specifies the maximum number of lines per page. A number in the
Lines per Page
range 1255 can be specified. The default is 66. See Note 1.
Maximum Number of Specifies the maximum number of characters per line. A number in
Characters per Line
the range 1255 can be specified. The default is 132. See Note 2.
Font
Lists, in the list box, the fonts that can be used with the currently
selected printer.
The fonts in brackets [ ] are device fonts specific to the printer
driver. The other fonts are graphics display interface (GDI) fonts
printed in bit map formats.
Notes:
1. When you set this to a value other than the default, Personal Communications
uses it to scale the LPI and font to the best fit for the page.
2. When you set this to a value other than the default, Personal Communications
uses it to scale the CPI and font to the best fit for the page.
From a Personal Communications display session, you can set additional
parameters by selecting the Text Options tab, as follows:
Table 20. Page Setup Parameters Text Options
Group
Options
Setting
Chapter 6. Printing
111
Printing
Table 20. Page Setup Parameters Text Options (continued)
Group
Options
Setting
Ignore FF when at
first print position
112
Printing
Table 20. Page Setup Parameters Text Options (continued)
Group
Options
Setting
FF takes a print
position if followed
by data
Chapter 6. Printing
113
Printing
Table 20. Page Setup Parameters Text Options (continued)
Group
Options
Setting
CR at maximum print
Determines whether to
position +1
perform automatic new line
when CR is the maximum
number of columns to be
printed away from the first
column.
Selected
Automatic new line is
not done. The
characters after the
CR code are printed
on the same line.
Not selected
Automatic new line is
done.
Determines whether
to perform automatic
new line/carriage
return before new
line/carriage return
(NL) is done when
NL is the maximum
number of columns to
be printed away from
the first column.
This option cannot be used for
5250 sessions.
NL at maximum print
Selected
position +1
Not selected
After automatic new
line is done, new line
is done again.
This option can be used when
LU type 3 printing or
non-SNA printing is done and
the combination of bits 2 and
3 of the WCC is 00.
This option cannot be used in
5250 sessions.
Form Feed Position
Note: This cannot be used for
5250 sessions.
Any position
Column 1 only
When you use a PC400 printer session, you can set additional parameters by
clicking the Orientation tab, as follows.
114
Printing
Table 21. Page Setup Parameters Orientation (PC400 Printer Session Only)
Group
Parameter
Description
Bottom Margin is assumed to be equal
to Top Margin.
Right Margin is assumed to be equal to
Left Margin.
If selected and the host does not
explicitly set the orientation, the best
orientation based on the host specified
CPI, LPI, and page size will be used.
If not selected and the host does not
explicitly set the orientation the
following drawer orientation will be
used.
Table 22. Page Setup Parameters Orientation (PC400 Printer Session Only)
Group
Setting
Description
Portrait
Landscape
Portrait
Landscape
When you use a PC400 printer session, you can set additional parameters by
clicking the Form Settings tab, as follows.
Chapter 6. Printing
115
Printing
Table 23. Page Setup Parameters Form Settings (PC400 Printer Session Only)
Parameter
Description
Form Settings
Specifies the form that should be selected when an application program specifies one
of the following paper sources:
v Drawer-one form
v Drawer-two form
v Envelope-hopper form
Before using this function, you must configure the paper trays and forms in the
printer-driver setup.
Table 24. Page Setup Parameters Advanced Options (PC400 Printer Session Only)
Option
Item to be set
Represents the code page being used for printing and displaying on the workstation.
No CR between fields
Represents not sending a CR when printing other fields on the same line.
Represents showing a dialog window that will display showing printer status.
Printing to Disk
If you are using a PDT, you can save a host print-job or the contents of the session
window (Print Screen) to a workstation file instead of printing it.
Two types of Print-to-Disk function are provided by Personal Communications:
Print-to-Disk Append
Appends multiple host print jobs or print screen jobs to a single
workstation file.
Print-to-Disk Separate
Saves each host-print job or screen to a separate workstation file. You can
specify the file name, but the extension is automatically assigned as a
decimal number from 000 to 999. If you delete a file, its number will be
re-used. When all 999 numbers have been used, the extension is
automatically assigned a decimal number from 1000 to 9999.
Notes:
1. Print-to-Disk is not available for the Print-Graphics function.
2. Print-to-Disk can be used only when you use a printer definition table (PDT)
file.
To set up Print-to-Disk:
1. Click File Printer Setup from the menu bar in the session window.
116
Printing
The Printer Setup window lists the supported printers.
2. Select Print to Disk Append or Print to Disk Separate from the list box.
3. Click Select PDT.
The Select PDT file window appears.
4. Select a PDT file from the list; then click OK.
The Printer Setup window reappears.
5. Click Setup.
The File Selecting window appears.
6. Specify a file name, drive, and path; then click OK.
Note: If you specify the name of an existing file, subsequent print jobs are
appended to the data in the original file in the case of Print to Disk
Append.
117
Printing
In this case, the desired font is encoded with code page 852. Personal
Communications uses a different, existing translation table to translate data from
EBCDIC to 852, versus using the standard Windows code page.
This option is on the Page Setup panel for Personal Communications Version 5.6
5250 print sessions.
118
119
120
The control point that manages the node and its associated resources. The
local node provides APPN services.
Partner LU 6.2
A remote computer that communicates through an APPC session with local
LU 6.2s.
RTP Connections
In high-performance routing (HPR), a rapid transport protocol (RTP)
connection is the connection established between the endpoints of the route
to transport session traffic.
Transaction Programs
A transaction program (TP) is a program that processes transactions in an
SNA network. There are two kinds of TPs: application transaction
programs and service transaction programs.
121
Window
To modify the layout of your Personal Communications window.
Help
Displaying a Resource
To display a resource, select a resource from the pull-down list on the toolbar.
Starting a Resource
To start a resource:
1. Select a resource from the pull-down list on the toolbar.
2. Select the first column of the item, and right mouse click to display the pop-up
menu.
3. Click Start to start the resource. A started (active) resource can be stopped, but
not deleted.
Stopping a Resource
There are two ways of stopping a resource:
Normal Stop
Performs clean up and then stops the resource.
Abnormal Stop
Immediately stops the resource.
To stop a resource:
1. Select a resource from the pull-down list on the tool bar.
122
Deleting a Resource
To
1.
2.
3.
delete a resource:
Select a resource from the pull-down list on the tool bar.
Select the first column of the item, and right mouse click to display the pop-up.
Select Delete to delete the resource.
You should stop a resource (make it inactive) before redefining it. You do not need
to delete the resource before redefining it.
Command-Line Utilities
Another way to perform SNA Node operations is to use the command line. Five
command line programs are available to perform basic operations for the SNA
Node.
CSSTART [ -a | -d | -m | -h ] [ -p | -q ] [ cfgfile ]
Use the CSSTART command to start the SNA Node with a specified
configuration. The -a flag enables automatic start up after rebooting the
Chapter 7. SNA Node Operations
123
AnyNet IP to LU mapping
CNT
Connection networks
CON
Connections
CPS
DLC
DEV
Devices
DPU
DLUR PUs
FPT
Focal Points
LU0
Local LU 0 to 3
L62
Local LU 6.2
L6S
LU 6.2 sessions
MOD Modes
NOD
Nodes
PLU
Partner LU 6.2
RTP
RTP connections
TRP
Transaction programs
object_id
Specifies a case-sensitive value (for example, LU001 or LINK001) to
search for. Only objects whose first attribute matches this value are
124
CPS
DLC
DEV
DPU
LU0
L62
RTP
object_id
Specifies a case-sensitive value (for example, LU001 or LINK001) to
search for. Only objects whose first attribute matches this value are
displayed. The object id must be spelled correctly, including case
(upper and lower). An incorrect object id will result in an error
being displayed.
action One of the following:
[-h]
SN
Normal stop
SI
Immediate stop
ST
Start
DL
Delete
PS
Path switch
125
126
127
128
129
Grid Lines
1st column 2 3 4 5 6 7
1st line
77 78 79 80th column
e
d
2
3
4
5
23rd line
b
24th line
c
25th line
f
g
h
130
Grid Lines
Host
Buffer
for receiving
Designation by an application program
Buffer
for the
character rate
Identification F
Grid Line
Information
Buffer 2
Grid Line
Information
Buffer 1
Identification B
Switch
xxxx
xxxxxxxx
xx
xx
xx
131
Grid Lines
2F
20
or
27
attribute
character
Grid line information buffer designation data
nn
non-display
C3
xx
non-display
alphabet C
Grid line
definition data
CC
20
attribute character
When sending this control data from an application program on the host system,
this control data is sent as normal display data. The starting position for displaying
this data should be specified as follows:
1. Grid-line draw control code: first line, first column
2. Grid-line designation data: first line, fourth column
The last byte of the control code should be the attribute X'20' or X'27', which
indicates the end of the field. This attribute character should be sent from the host
so that it can be overridden with the non-display attribute X'27', which is the first
byte of the grid-line designation data. Items 1 and 2 should be defined as different
fields. When it receives the grid-line draw control code and the grid-line
designation data, PC400 stores the grid-line designation data in the specified
grid-line information buffer.
However, the grid-line screen format is displayed when receiving character data
that contains the information to display the grid-line screen format.
132
Grid Lines
2F
nn
non-display
20
or
27
attribute
Parameter
Meaning
Valid Value
nn
Grid line
information buffer
designation data
v X'C6' (F)
v Grid-line definition data to be stored into the
grid-line information buffer 1.
v X'C2' (B)
v Grid-line definition data to be stored into
grid-line information buffer 2.
Note: When PC400 receives the grid-line draw control code, the current contents
of the specified grid-line information buffer are deleted to prepare the buffer
to store other grid-line definition data.
xx
..
..
..
..
640 bytes
xx
C3
CC
alphabet C
20
attribute
character
It defines the grid-line information for each screen position from the first line, first
column to the 24th line, 80th column, respectively. It defines the grid lines for three
columns using a byte, so the length of this data is fixed-length 640 bytes as
follows:
24 rows * 80 columns / 3 = 640
The following illustration shows the relation between the actual grid lines on the
display screen and the grid-line definition data.
133
Grid Lines
Grid line on the workstation screen
1st column 2
. . .
1st column 2
. . .
80th column
1st line
2
. . .
fix
Grid line
definition data
01
fix
11
10
01
01
non-display
attribute
fix
11
10
--
27
79
7-
01
fix
--
---
--
--
01
--
C3
--
--
CC
00
20
attribute
character
134
Grid Lines
29
2F
nn
non-display
20
attribute
reverse image
Parameter
Meaning
xx ... xx
CC
Reserved
2F
nn
blink
non-display
20
attribute
character
Parameter
Meaning
Valid Value
nn
Note: The attribute character for the character data can be replaced with X'20' at the first
line and fourth column.
The position from the first to the fourth column on the first line of the user screen
format can not be used as character data when displaying the grid line in the
user-defined screen format. In addition, the character F or B should be present
at the first row and third column position. If it does not exist, the grid-line screen
format is not displayed and the user screen format which contains the only
character data is displayed.
135
136
Part 3. Appendixes
137
138
Appendix. Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in
other countries. Consult your local IBM representative for information on the
products and services currently available in your area. Any reference to an IBM
product, program, or service is not intended to state or imply that only that IBM
product, program, or service may be used. Any functionally equivalent product,
program, or service that does not infringe any IBM intellectual property right may
be used instead. However, it is the users responsibility to evaluate and verify the
operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not give you
any license to these patents. You can send license inquiries, in writing, to:
IBM Director of Licensing
IBM Corporation
500 Columbus Avenue
Thornwood, NY 10594
U.S.A.
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
IBM World Trade Asia Corporation
Licensing
2-31 Roppongi 3-chome, Minato-ku
Tokyo 106, Japan
The following paragraph does not apply to the United Kingdom or any other
country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS
PUBLICATION AS IS WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS
FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or
implied warranties in certain transactions, therefore, this statement may not apply
to you.
This information could include technical inaccuracies or typographical errors.
Changes are periodically made to the information herein; these changes will be
incorporated in new editions of the publication. IBM may make improvements
and/or changes in the product(s) and/or the program(s) described in this
publication at any time without notice.
Any references in this information to non-IBM documentation or non-IBM Web
sites are provided for convenience only and do not in any manner serve as an
endorsement of those documents or Web sites. The materials for those documents
or Web sites are not part of the materials for this IBM product and use of those
documents or Web sites is at your own risk.
Licensees of this program who wish to have information about it for the purpose
of enabling: (i) the exchange of information between independently created
Copyright IBM Corp. 1989, 2002
139
Notices
programs and other programs (including this one) and (ii) the mutual use of the
information which has been exchanged, should contact:
IBM Corporation
Department T01
Building 062
P.O. Box 12195
RTP, NC 27709-2195
U.S.A.
Such information may be available, subject to appropriate terms and conditions,
including in some cases, payment of a fee.
The licensed program described in this information and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement
or any equivalent agreement between us.
Information concerning non-IBM products was obtained from the suppliers of
those products, their published announcements or other publicly available sources.
IBM has not tested those products and cannot confirm the accuracy of
performance, compatibility or any other claims related to non-IBM products.
Questions on the capabilities of non-IBM products should be addressed to the
suppliers of those products.
All statements regarding IBMs future direction or intent are subject to change or
withdrawal without notice, and represent goals and objectives only.
140
Trademarks
Trademarks
The following terms are trademarks of the IBM Corporation in the United States or
other countries, or both:
400
ACF/VTAM
AFP
AIX
AIXwindows
APL2
APPN
AS/400
AT
Advanced Peer-to-Peer Networking
AnyNet
Application System/400
BookManager
CICS
CICS/MVS
CICS/VSE
COBOL/2
CUA
Common User Access
Client Access
Client Access/400
Current
DB2
DB2/400
DRDA
DisplayWrite
Distributed Relational Database Architecture
ExecJet
GDDM
Global Network
IBM
IBMLink
IIN
IMS
InfoWindow
MVS/ESA
MVS/XA
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of
Microsoft Corporation in the United States and/or other countries.
Tivoli is a trademark of Tivoli Systems Inc. in the United States and/or other
countries.
Java and all Java-based trademarks and logos are trademarks of Sun Microsystems,
Inc. in the United States and/or other countries.
PC Direct is a registered trademark of Ziff Communications Company and is
used by IBM Corporation under license.
UNIX is a registered trademark in the United States and other countries licensed
exclusively through X/Open Company Limited.
Appendix. Notices
141
Trademarks
C-bus is a trademark of Corollary, Inc.
ActionMedia, LANDesk, MMX, Pentium, and ProShare are trademarks or
registered trademarks of Intel Corporation in the U.S. and other countries.
Other company, product, and service names may be trademarks or service marks
of others.
142
Index
A
adding a file to the list 97
adding templates 98
additional options 100
alerts xi
AS/400
file 31
AS/400 files 31
ASCII text files 77
B
BASIC random files 79
BASIC sequential files 81
BETWEEN test 50
BIFF files 86
C
changing the contents of a list 97
changing the translation table 102
conditions, specifying WHERE 47
conversion errors that can occur during transfer
creating a transfer request
receiving data from the host 40
transferring data to the host 32
creating list files 96
customizing the translation table 102
39
E
D
data conversions 73
data types 73
ASCII numeric 76
binary 74
character 74
double-precision 74
hexadecimal 75
integer 74
packed decimal 75
single-precision 74
zoned decimal 75
record size 73
workstation file types 76
data description specifications (DDS) 66, 81
data interchange format files (DIF) 83
data transfer 100
Data Transfer
power management 15
Data Transfer for PC400 25
AS/400 System-to-Personal Computer Performance
Considerations 94
Data Conversions 73
Examples of Transfer Requests for Receiving 57
File-Description Files 65
Limited Usage of File Names and Field Names 56
Menu Functions Available 62
Overview 25
Preparation 28
Copyright IBM Corp. 1989, 2002
editing lists 97
enhanced protocol 101
explaining a file-description file
extension for list-files 101
65
F
file
AS/400 31
database 31
joining 31
logical 31
physical 31
file transfer 103
File Transfer
power management 15
File Transfer for PC400 103
DBCS File-Transfer Option 105
PC File Transfer with the CRLF Option 103
Restrictions for Transferred File Size 105
Transfer to a Physical File 104
Transfer to a Physical Source File 104
Use of the DSPMBRLST Command 104
file-description file 30, 65
file-description file entries 65
comment lines 72
example 72
format 66
PCFDF 66
143
G
Grid Lines (DBCS Only), Displaying 129
Combination Display of Grid-Line Screen Format and User
Screen Format 135
Control Code for Deletion of the Contents of the Grid
Line 134
Controlling the Grid-Line Format 130
Displaying the Grid-Line Screen Format 131
Grid-Line Draw Control 132
Grid-Line Screen-Format Displaying Mechanism 132
LDeleting the Grid-Line Screen Format 131
Limits for Displaying the Grid Lines 129
100
M
managing templates 98
member 31
message
merging 127
sorting 128
viewing 127
message logger device driver
messages
alerts xi
OIA xi
system fault x
127
N
no-conversion files 92
node operations 119
H
Highlights, Personal Communications 3
Hints and Tips
Considerations 23
Inactivity Timeout for Communications Links 22
Usage Notes for Sessions in OLE Documents 21
host command 101
I
IN test 50
Information, Where to Find More x
Alerts, Messages and x
Messages and Alerts x
IS test 51
ISNOT test 51
K
key functions
assignments
new keyboard map 21
Win32 edit hotkeys
Enter 21
New Line 21
keyboard
file 21
functions 18
setup
PC/3270 new keyboard map 20
L
library 31
LIKE test 49
list file 96
Log Viewer Functions 127
Changing Message Log Size and Location 127
Filtering 128
Merging Message and Trace Logs 127
Searching 128
Sorting Message and Trace Logs 128
Viewing Message and Trace Logs 127
144
O
online help x
P
page setup parameter 110
PC code page 101
PC400 Sessions, Considerations for the Use of
Print Processing 16
Scroll Bar 16
PC400, Data Transfer for 25
PC400, File Transfer for 103
PCFDF entries 66
PCFL entries 69
PCFO entry 67
PCFT entries 66
PCSERR999 error messages 16
PDF 108
PDT files 108
PDT mode 16
Personal Communications
library xi
Personal Communications Highlights 3
physical database file 31
Power Management
data transfer 15
file transfer 15
resume 15
sleep 15
wake 15
printable area 16
printer definition file 108
printer definition table 108
printing 107
Printing 107
code page 117
PDT Files 108
PrinterFontCodePage parameter 117
Printing Japan Postal Barcode 117
Setting Page Setup Parameters 110
Setting up the printer 107
15
Printing (continued)
translation table 117
printing to disk 116
problem determination and reporting 9
problem determination aids 9
Information Bundler 10
Internet Service 11
log viewer 9
trace facility 9
W
Where to Find More Information x
S
saving
keyboard layout 21
saving a transfer request 38
scroll bar 16
sending files to the host system 95
setting the page setup parameter 110
setting transfer options 100
setting up the printer 107
show status window 101
SNA node operations 119
Changing an HPR Path Switch 123
Command Line Utilities 123
Deleting a Resource 123
Displaying a Resource 122
Starting a Resource 122
Starting Node Operations 121
Stopping a Resource 122
Updating SNA Resources Dynamically 123
Using the Menu Bar 122
source file
transferring data to 27
T
template 98
test
combination 51
logical AND and logical OR 51
testing templates 99
source file 99
templates 99
test mode 99
trace
merging 127
sorting 128
viewing 127
trademarks 141
transfer function 28
transfer request
definition 30
transfer requests for receiving (example)
transfer types 99
57
Index
145
146
Overall satisfaction
Very Satisfied
Satisfied
Neutral
Dissatisfied
Very
Dissatisfied
h
How satisfied are you that the information in this book is:
Accurate
Complete
Easy to find
Easy to understand
Well organized
Applicable to your tasks
Very Satisfied
Satisfied
Neutral
Dissatisfied
h
h
h
h
h
h
h
h
h
h
h
h
h
h
h
h
h
h
h
h
h
h
h
h
Very
Dissatisfied
h
h
h
h
h
h
h Yes
h No
When you send comments to IBM, you grant IBM a nonexclusive right to use or distribute your comments in any
way it believes appropriate without incurring any obligation to you.
Name
Company or Organization
Phone No.
Address
SC31-8837-01
___________________________________________________________________________________________________
Cut or Fold
Along Line
_ _ _ _ _ _ _Fold
_ _ _and
_ _ _Tape
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _Please
_ _ _ _ _do
_ _not
_ _ staple
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _Fold
_ _ _and
_ _ Tape
______
NO POSTAGE
NECESSARY
IF MAILED IN THE
UNITED STATES
IBM Corporation
Information Development
Department CGMD / Bldg 500
P.O. Box 12195
Research Triangle Park, NC
27709-9990
_________________________________________________________________________________________
Fold and Tape
Please do not staple
Fold and Tape
SC31-8837-01
Cut or Fold
Along Line
Printed in U.S.A.
SC31-8837-01