Table of Contents

Search

  1. Preface
  2. PowerExchange Navigator Introduction
  3. Data Maps
  4. Data Maps for Specific Data Sources
  5. Copybooks
  6. Registration Groups and Capture Registrations
  7. Extraction Groups and Extraction Maps
  8. Personal Metadata
  9. Database Row Test
  10. PowerExchange Navigator Examples
  11. Appendix A: PowerExchange Functions for User-Defined Fields
  12. Appendix B: User Access Method Programs
  13. Appendix C: Application Groups and Applications
  14. Appendix D: Data Map Properties
  15. Appendix E: Record, Field, and Table Properties
  16. Appendix F: DTL__CAPXTIMESTAMP Time Stamps
  17. Appendix G: Trace for Creating a Memory Map When Importing a COBOL Copybook

Navigator User Guide

Navigator User Guide

CL Program Linkage - Example

CL Program Linkage - Example

The following code shows an example of CL program linkage:
PGM PARM(&NBRFLDS &RC &MSGBUFF &MSGBUFFSZ &TEXT &TEXTLEN &NUM &NUMLEN) /*----------------------------------------------------------------*/ /* ARGUMENTS */ /*----------------------------------------------------------------*/ DCL VAR(&NBRFLDS) TYPE(*CHAR) LEN(4) DCL VAR(&RC) TYPE(*CHAR) LEN(4) DCL VAR(&MSGBUFF) TYPE(*CHAR) LEN(128) DCL VAR(&MSGBUFFSZ) TYPE(*CHAR) LEN(4) DCL VAR(&TEXT) TYPE(*CHAR) LEN(15) DCL VAR(&TEXTLEN) TYPE(*CHAR) LEN(4) DCL VAR(&NUM) TYPE(*CHAR) LEN(4) DCL VAR(&NUMLEN) TYPE(*CHAR) LEN(4)
In the example program, two fields are passed to the CL program.
The first field is called TEXT that has a fixed length of 15. Data can be moved to it and from it using the 5th argument &TEXT. If it is not a fixed-length CHAR field, then the data length must be used to determine the actual length, such as field &TEXTLEN.
Unfortunately, the CL language does not support integers directly. To get the numeric value, the contents of &TEXTLEN must be moved to a packed decimal using a statement like:
CHGVAR VAR(&DECTEXTLEN) VALUE(%BIN(&TEXTLEN 1 4))
If the length is changed by the program then the new length has to be moved into the TEXTLEN field using a statement like:
CHGVAR VAR(%BINARY(&TEXTLEN)) VALUE(&DECTEXTLEN)

0 COMMENTS

We’d like to hear from you!