Developer for System z
PL/I for Windows, Version 8.0, Programming Guide
Contents
Figures
Introducing PL/I on your workstation
About this book
What's new?
How to read the syntax diagrams
How to send your comments
Porting applications between platforms
Getting mainframe applications to compile on the workstation
Choosing the right compile-time options
Language restricted
Using the macro facility to help port programs
Getting mainframe applications to run on the workstation
Linking differences
Data representations causing run-time differences
Environment differences affecting portability
Language elements causing run-time differences
Compiling and linking your program
Compiling your program
A short practice exercise
The HELLO program
Using compile-time options
Using the sample programs provided with the product
Preparing to compile source programs
Program file structure
Program file format
Setting compile-time environment variables
IBM.OPTIONS
IBM.PPINCLUDE
IBM.PPMACRO
IBM.PPSQL
IBM.PPCICS
IBM.SOURCE
IBM.SYSLIB
IBM.PRINT
IBM.OBJECT
IBM.DECK
INCLUDE
TMP
Using the PLI command to invoke the compiler
Where to specify compile-time options
IBM.OPTIONS and IBM.PPxxx environment variables
PLI command
%PROCESS statement
Compile-time option descriptions
Compile-time option descriptions
Rules for using compile-time options
ADDEXT
AGGREGATE
ATTRIBUTES
BIFPREC
BLANK
CHECK
CMPAT
CODEPAGE
COMPILE
COPYRIGHT
CURRENCY
DBCS
DEFAULT
DEPRECATE
DLLINIT
EXIT
EXTRN
FLAG
FLOATINMATH
GONUMBER
GRAPHIC
IMPRECISE
INCAFTER
INCLUDE
INITAUTO
INITBASED
INITCTL
INITSTATIC
INSOURCE
LANGLVL
LIBS
LIMITS
LINECOUNT
LINEDIR
LIST
LISTVIEW
MACRO
MARGINI
MARGINS
MAXGEN
MAXMSG
MAXNEST
MAXSTMT
MAXTEMP
MDECK
MSG
NAMES
NATLANG
NEST
NOT
NUMBER
OBJECT
OFFSET
ONSNAP
OPTIMIZE
OPTIONS
OR
PP
PPCICS
PPINCLUDE
PPMACRO
PPSQL
PPTRACE
PRECTYPE
PREFIX
PROBE
PROCEED
PROCESS
QUOTE
REDUCE
RESEXP
RESPECT
RULES
SEMANTIC
SNAP
SOSI
SOURCE
STATIC
STMT
STORAGE
SYNTAX
SYSPARM
SYSTEM
TERMINAL
TEST
USAGE
WIDECHAR
WINDOW
XINFO
XML
XREF
PL/I preprocessors
Include preprocessor
Examples:
Include preprocessor options environment variable
Macro preprocessor
Macro preprocessor options
Macro facility options environment variables
SQL preprocessor
Programming and compilation considerations
SQL preprocessor options
SQL preprocessor options environment variable
SQL preprocessor BIND environment variables
Coding SQL statements in PL/I applications
Large Object (LOB) support
User defined functions sample programs
CICS support
Programming and compilation considerations
CICS preprocessor options
CICS preprocessor options environment variables
Coding CICS statements in PL/I applications
Writing CICS transactions in PL/I
CICS abends used for PL/I programs
CICS run-time user exit
Compilation output
Using the compiler listing
Compiler output files
Linking your program
Starting the linker
Statically linking
Linking from the command line
Linking from a make file
Input and output
Search rules
Specifying directories
Filename defaults
Specifying object files
Using response files
Specifying executable output type
Producing an .EXE file
Producing a dynamic link library
Packing executables
Generating a map file
Linker return codes
Setting linker options
Setting options on the command line
Setting options in the ILINK environment variable
Using the linker
Specifying numeric arguments
Summary of Windows linker options
Windows linker options
/?
/ALIGNADDR
/ALIGNFILE
/BASE
/CODE
/DATA
/DBGPACK, /NODBGPACK
/DEBUG, /NODEBUG
/DEFAULTLIBRARYSEARCH
/DLL
/ENTRY
/EXECUTABLE
/EXTDICTIONARY, /NOEXTDICTIONARY
/FIXED, /NOFIXED
/FORCE
/HEAP
/HELP
/INCLUDE
/INFORMATION, /NOINFORMATION
/LINENUMBERS, /NOLINENUMBERS
/LOGO, /NOLOGO
/MAP, /NOMAP
/OUT
/PMTYPE
/SECTION
/SEGMENTS
/STACK
/STUB
/SUBSYSTEM
/VERBOSE
/VERSION
Running and debugging your program
Using run-time options
Setting run-time environment variables
PATH
DPATH
Specifying run-time options
Where to specify run-time options
Specifying multiple run-time options or suboptions
Run-time options
NATLANG
Shipping run-time DLLs
Testing and debugging your programs
Testing your programs
General debugging tips
PL/I debugging techniques
Using compile-time options for debugging
Using footprints for debugging
Using dumps for debugging
Using error and condition handling for debugging
Error handling concepts
Common programming errors
Logical errors in your source programs
Invalid use of PL/I
Calling uninitialized entry variables
Loops and other unforeseen errors
Unexpected input/output data
Unexpected program termination
Other unexpected program results
Compiler or library subroutine failure
System failure
Poor performance
Input and output
Using data sets and files
Types of data sets
Native data sets
Additional data sets
Establishing data set characteristics
Records
Record formats
Data set organizations
Specifying characteristics using the PL/I ENVIRONMENT attribute
Specifying characteristics using DD:ddname environment variables
Associating a PL/I file with a data set
Using environment variables
Using the TITLE option of the OPEN statement
Attempting to use files not associated with data sets
How PL/I finds data sets
Opening and closing PL/I files
Opening a file
Closing a file
Associating several data sets with one file
Combinations of I/O statements, attributes, and options
DISPLAY statement input and output
PL/I standard files (SYSPRINT and SYSIN)
Redirecting standard input, output, and error devices
Defining and using consecutive data sets
Printer-destined files
Using stream-oriented data transmission
Defining files using stream I/O
ENVIRONMENT options for stream-oriented data transmission
Creating a data set with stream I/O
Accessing a data set with stream I/O
Using PRINT files
Using SYSIN and SYSPRINT files
Controlling input from the console
Using files conversationally
Format of data
Stream and record files
Capital and lowercase letters
End of file
Controlling output to the console
Format of PRINT files
Stream and record files
Example of an interactive program
Using record-oriented I/O
Defining files using record I/O
ENVIRONMENT options for record-oriented data transmission
Creating a data set with record I/O
Accessing and updating a data set with record I/O
Defining and using regional data sets
Defining files for a regional data set
Specifying ENVIRONMENT options
Essential information for creating and accessing regional data sets
Using keys with regional data sets
Using REGIONAL(1) data sets
Dummy records
Creating a REGIONAL(1) data set
Example
Accessing and updating a REGIONAL(1) data set
Sequential access
Direct access
Example
Defining and using workstation VSAM data sets
Moving data between the workstation and mainframe
Workstation VSAM organization
Creating and accessing workstation VSAM data sets
Determining which type of workstation VSAM data set you need
Accessing records in workstation VSAM data sets
Using keys for workstation VSAM data sets
Choosing a data set type
Defining files for workstation VSAM data sets
Specifying options of the PL/I ENVIRONMENT attribute
Adapting existing programs for workstation VSAM
Using workstation VSAM sequential data sets
Using a sequential file to access a workstation VSAM sequential data set
Defining and loading a workstation VSAM sequential data set
Workstation VSAM keyed data sets
Loading a workstation VSAM keyed data set
Using a SEQUENTIAL file to access a workstation VSAM keyed data set
Using a DIRECT file to access a workstation VSAM keyed data set
Workstation VSAM direct data sets
Loading a workstation VSAM direct data set
Using a SEQUENTIAL file to access a workstation VSAM direct data set
Using a DIRECT file to access a workstation VSAM direct data set
Using PL/I with databases
Open Database Connectivity
Introducing ODBC
Background
ODBC Driver Manager
Choosing embedded SQL or ODBC
Using the ODBC drivers
Online help
Environment-specific information
Connecting to a data source
Error messages
ODBC APIs from PL/I
CALL interface convention
Using the supplied include files
Mapping of ODBC C types
Setting licensing information for ODBC Driver Manager/driver
Sample program using supplied include files
Using java Dclgen
Understanding java Dclgen terminology
PL/I java Dclgen support
Creating a table declaration and host structure
Selecting a database
Selecting a table and generation a PL/I declaration
Modifying and saving the generated PL/I declaration
Exiting java Dclgen
Including data declarations in your program
Advanced topics
Using the Program Maintenance Utility, NMAKE
Why use NMAKE?
Running NMAKE
Using the command line
Using NMAKE command files
NMAKE options
Produce error file (/X)
Build all targets (/A)
Suppress messages (/C)
Display modification dates (/D)
Override environment variables (/E)
Specify description file (/F)
Display help (/HELP or /?)
Ignore exit codes (/I)
Display commands (/N)
Suppress sign-on banner (/NOLOGO)
Print macro and target definitions (/P)
Return exit code (/Q)
Ignore TOOLS.INI file (/R)
Suppress command display (/S)
Change target modification dates (/T)
Description files
Description blocks
Special features
Targets in several description blocks
Using macros
Macros example
Special features
Macros in a description file
Macros on the command line
Inherited macros
Defined macros
Macro substitutions
Special macros
Special macros examples
File-specification parts
Characters that modify special macros
Modified special macros example
Macro precedence rules
Inference rules
Special features
Inference rules example
Inference-rule path specifications
Predefined inference rules
Directives
Directives example
Pseudotargets
Predefined pseudotargets
Inline files
Inline files example
Escape characters
Characters that modify commands
Turn error checking off (-)
Dash command modifier examples
Suppress command display (@)
At sign (@) command modifier example
Execute command for dependents (!)
Exclamation point (!) command modifier examples
EXTMAKE Syntax
Macros and inference rules in TOOLS.INI
TOOLS.INI example
Improving performance
Selecting compile-time options for optimal performance
OPTIMIZE
IMPRECISE
GONUMBER
SNAP
RULES
PREFIX
DEFAULT
Summary of compile-time options that improve performance
Coding for better performance
DATA-directed input and output
Input-only parameters
String assignments
Loop control variables
PACKAGEs versus nested PROCEDUREs
REDUCIBLE functions
DEFINED versus UNION
Named constants versus static variables
Avoiding calls to library routines
Using user exits
Using the compiler user exit
Procedures performed by the compiler user exit
Activating the compiler user exit
The IBM-supplied compiler exit, IBMUEXIT
Customizing the compiler user exit
Using the CICS run-time user exit
Prior to program invocation
After program termination
Modifying CEEFXITA
Using data conversion tables
Building dynamic link libraries
Creating DLL source files
Compiling your DLL source
Preparing to link your DLL
Specifying exported names under Windows
Linking your DLL
Using your DLL
Sample program to build a DLL
Using FETCH and RELEASE in your main program
Exporting data from a DLL
Using IBM Library Manager on Windows
Running ILIB
Using the command line
Using the ILIB environment variable
Using an ILIB response file
Examples specifying ILIB parameters
Controlling ILIB input
Controlling ILIB output
Controlling ILIB output
ILIB objects
Summary of ILIB objects
Add/Replace
/EXTRACT
/REMOVE
ILIB options
Summary of ILIB options
/?
/BACKUP
/DEF
/FREEFORMAT
/GENDEF
/GI
/HELP
/LIST
/NOEXT
/OUT
/QUIET
/WARN
Calling conventions
Understanding linkage considerations
OPTLINK linkage
Features of OPTLINK
Tips for using OPTLINK
General-purpose register implications
Parameters
Examples of passing parameters
SYSTEM linkage
Features of SYSTEM
Example using SYSTEM linkage
STDCALL linkage (Windows only)
Features of STDCALL
Examples using the STDCALL convention
Using WinMain (Windows only)
CDECL linkage
Features of CDECL
Examples using the CDECL convention
Using PL/I in mixed-language applications
Matching data and linkages
What data is passed
How data is passed
Where data is passed
Maintaining your environment
Invoking non-PL/I routines from a PL/I MAIN
Invoking PL/I routines from a non-PL/I main
Using ON ANYCONDITION
Interfacing with Java
What is the Java Native Interface (JNI)?
JNI Sample Program #1 - ’Hello World’
Step 1: Writing the Java Program
Step 2: Compiling the Java Program
Step 3: Writing the PL/I Program
Step 4: Compiling and Linking the PL/I Program
Step 5: Running the Sample Program
JNI Sample Program #2 - Passing a String
Step 1: Writing the Java Program
Step 2: Compiling the Java Program
Step 3: Writing the PL/I Program
Step 4: Compiling and Linking the PL/I Program
Step 5: Running the Sample Program
JNI Sample Program #3 - Passing an Integer
Step 1: Writing the Java Program
Step 2: Compiling the Java Program
Step 3: Writing the PL/I Program
Step 4: Compiling and Linking the PL/I Program
Step 5: Running the Sample Program
Determining equivalent Java and PL/I data types
Using sort routines
Comparing S/390 and workstation sort programs
Preparing to use sort
Choosing the type of sort
Specifying the sorting field
Specifying the records to be sorted
Calling the sort program
PLISRT examples
Determining whether the sort was successful
Sort data input and output
Sort data handling routines
E15 -- input-handling routine (sort exit E15)
E35 -- output-handling routine (sort exit E35)
Calling PLISRTA
Calling PLISRTB
Calling PLISRTC
Calling PLISRTD, example 1
Calling PLISRTD, example 2
Using the SAX parser
Overview
The PLISAXA built-in subroutine
The PLISAXB built-in subroutine
The SAX event structure
start_of_document
version_information
encoding_declaration
standalone_declaration
document_type_declaration
end_of_document
start_of_element
attribute_name
attribute_characters
attribute_predefined_reference
attribute_character_reference
end_of_element
start_of_CDATA_section
end_of_CDATA_section
content_characters
content_predefined_reference
content_character_reference
processing_instruction
comment
unknown_attribute_reference
unknown_content_reference
start_of_prefix_mapping
end_of_prefix_mapping
exception
Parameters to the event functions
Coded character sets for XML documents
Supported EBCDIC code pages
Supported ASCII code pages
Specifying the code page
Exceptions
Example
Continuable exception codes
Terminating exception codes
Using PL/I MLE in your applications
Applying attributes and options
DATE attribute
RESPECT compile-time option
WINDOW compile-time option
RULES compile-time option
Understanding date patterns
Patterns and windowing
Using built-in functions with MLE
DAYS
DAYSTODATE
Performing date calculations and comparisons
Explicit date calculations
Implicit date calculations
Implicit date comparisons
Implicit DATE assignments
Using MLE with the SQL preprocessor
Appendixes
Notices
Programming interface information
Macros for customer use
Trademarks
Bibliography
Enterprise PL/I publications
DB2 UDB for OS/390 and z/OS
CICS Transaction Server
Glossary
Index
Terms of use
|
Feedback
This information center is powered by Eclipse technology. (http://www.eclipse.org)