CSP programming language supplement


QUICKSTART requires that a CSP application program generates COBOL code for compilation and execution.

The 77 Level fields of QS_JOBNAME and SAMN_DEFINITION may be placed in your normal working storage (usually called WS). This area will NOT be saved by QUICKSTART.

The additional working storage records QS_AREA1_START, QS_IOAREA1, and QS_AREA1_END may be called anything you like as long as all references to them are changed also. Additional working storage records may be added in between QS_AREA1_START and QS_AREA1_END and may be added in any order. All of these areas will be considered saved working storage.

CALLs to QUICKSAM must reference a working storage record name. This I/O area may or may not be required to be in the saved area, depending on your application. The 77 Level SAMN_DEFINITION is a temporary holding area when making calls to QUICKSAM. This restriction is due to the CSP restriction of only being able to pass 77 level or working storage records as opposed to individual fields to a called program. Therefore, each CALL to QUICKSAM must be preceded by a MOVE to SAMN_DEFINITION and followed with a MOVE from SAMN_DEFINITION. For example:

MOVE SAM2_DEFINITION TO SAMN_DEFINITION;
CALL QUICKSAM SAMN_DEFINITION,QS_IOAREA1 (NONCSP,NOMAPS;
MOVE SAMN_DEFINITION TO SAM2_DEFINITION;

Any QUICKSTART program called more than once should be first loaded into memory with a call similar to:

CALL LOADHLL 'Y','BTCHCKPT','QUICKSAM' (NONCSP,NOMAPS;

This may not be necessary since you will be always generating COBOL code first. Try it without first, and if problems result during the second checkpoint, put it back in.

The following initialization code should be placed in the very beginning of each program unless the COBOL generated code places VALUE clauses in the working storage definitions. If so, only the fields which have non-empty values (CKPT_PGM_NAME, NBR_OF_SAMS, etc.) need be initialized.

MOVE ' ' TO CKPT_PGM_NBR;
MOVE ' ' TO CKPT_INTERNAL;
MOVE ' ' TO CKPT_RETURN_CODE;
MOVE ' ' TO CKPT_TAKEN_FLAG;
MOVE ' ' TO CKPT_FILLER1;
MOVE ' ' TO CKPT_ROLLBACK;
MOVE ' ' TO CKPT_FILLER2;
MOVE ' ' TO SAM1_RETURN_CODE;
MOVE ' ' TO SAM1_FILLER1;
MOVE ' ' TO SAM1_VSAM_RECFM;
MOVE ' ' TO SAM1_FILLER2;
MOVE ' ' TO SAM2_RETURN_CODE;
MOVE ' ' TO SAM2_FILLER1;
MOVE ' ' TO SAM2_VSAM_RECFM;
MOVE ' ' TO SAM2_FILLER2;
MOVE 'QWIKDEMO' TO CKPT_PGM_NAME;
MOVE 'JOBNAME ' TO CKPT_JOB_NAME;
MOVE 'T002' TO CKPT_FREQUENCY;
MOVE 2 TO NBR_OF_SAMS;
MOVE 'INFILEA ' TO SAM1_DDNAME;
MOVE 'I' TO SAM1_FILE_TYPE;
MOVE 'OPEN' TO SAM1_REQUEST_TYPE;
MOVE 'OUTFILED' TO SAM2_DDNAME;
MOVE 'O' TO SAM2_FILE_TYPE;
MOVE 'OPEN' TO SAM2_REQUEST_TYPE;
MOVE 'S' TO CKPT_REQUEST_TYPE;
MOVE '** CKPT AREA END ** '
TO CKPT_AREA_END;

After this initial initialization, initialize the QUICKSTART environment with code such as:

/*
/* initialize the QUICKSTART environment
/*
PERFORM CKPT_RTN;
IF CKPT_RETURN_CODE NE 'R';
   PERFORM your application one-time initialization;
END;

Before successfully terminating your program, clean up the QUICKSTART environment with:

/*
/* cleanup and terminate
/*
MOVE 'E' TO CKPT_REQUEST_TYPE;
PERFORM CKPT_RTN;

The PROCESSES CKPT_RTN, CKPT_START_READ, CKPT_START_INSERT, CKPT_NORMAL_READ, CKPT_UPDATE1, and CKPT_UPDATE along with the record CKPTCNTL_RECORD will all be included in every application.

See demo program CSPDEMO in the SAMPLIB for an example of using QUICKSTART with CSP.

Related topic

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*