Can CA Easytrieve write multiple output files to a single PDS?

Document ID : KB000054379
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

CA Easytrieve can write output files to a single PDS using PUT statements in separate job activities.

Solution:

 In JCL 
 000014 //OUTFILE DD DSN=your.pds.dataset(FIRST),DISP=SHR
 000015 //OUTFILE2 DD DSN=your.pds.dataset(SECOND),DISP=SHR

Sample code.

FILE PERSNL FB(150 1800) 
EMP# 9 5 N HEADING('EMPLOYEE' 'NUMBER') 
REGION 1 1 N 
BRANCH 2 2 N 
NAME 17 20 A HEADING 'EMPLOYEE NAME' 
* 
* 
FILE OUTFILE FB(150 1800) 
EMP# 9 5 N HEADING('EMPLOYEE' 'NUMBER') 
REGION 1 1 N 
BRANCH 2 2 N 
NAME 7 20 A HEADING 'EMPLOYEE NAME' 
* 
FILE OUTFILE2 FB(150 1800) 
EMP# 9 5 N HEADING('EMPLOYEE' 'NUMBER') 
REGION 1 1 N 
BRANCH 2 2 N 
NAME 7 20 A HEADING 'EMPLOYEE NAME' 
* 
WS-FLD1  S 4 N VALUE 0002 
WS-FLD2  W 4 N VALUE 0001 
*** 
JOB INPUT PERSNL 
IF WS-FLD1 = 2 
PUT OUTFILE FROM PERSNL 
END-IF 
* 
JOB INPUT PERSNL 
IF WS-FLD2 = 1 
PUT OUTFILE2 FROM PERSNL 
END-IF 
PRINT RPT1 
* 
REPORT RPT1 
CONTROL FINAL NOPRINT 
LINE 1 REGION BRANCH NAME EMP# 
/*