Hi all,
i would like to club five fields to one (in my easytrieve pgm) from file A to file B . can someone suggest me a logic or piece of code . (i am very new to easytrieve)
thanks in advance.
club five fields into one in easytrieve program.
Moderators: DikDude, Moderator Group
Below is the Easytrive program . it may help you to code your program.
Code: Select all
PARM LINK (EZSAMPLE R) ABEXIT (SNAP) DEBUG (DMAP)
*
************************************************************************
* FILES DEFINITION *
************************************************************************
FILE INPUT1 FB (5 0)
INPUT1-REC 1 5 A
INPUT1-FILED-1 1 1 A
INPUT1-FILED-2 2 1 A
INPUT1-FILED-3 3 1 A
INPUT1-FILED-4 4 1 A
INPUT1-FILED-5 5 1 A
*
WS-OUTPUT-REC W 5 A
WS-FIELD-1 WS-OUTPUT-REC 1 A
WS-FIELD-2 WS-OUTPUT-REC +1 1 A
WS-FIELD-3 WS-OUTPUT-REC +2 1 A
WS-FIELD-4 WS-OUTPUT-REC +3 1 A
WS-FIELD-5 WS-OUTPUT-REC +4 1 A
*
FILE OUTFILE FB (5 0)
OUTPUT-REC 1 5 A
*
*COUNTERS
WS-INPUT-CTR W 14 N +
MASK('ZZ,ZZZ,ZZZ,ZZZ,ZZ9')
WS-OUTPUT-CTR W 14 N +
MASK('ZZ,ZZZ,ZZZ,ZZZ,ZZ9')
************************************************************************
JOB INPUT (INPUT1) START (1000-START) FINISH (9000-FINISH)
************************************************************************
*
WS-INPUT-CTR = WS-INPUT-CTR + 1
*
WS-FIELD-1 = INPUT1-FILED-1
WS-FIELD-2 = INPUT1-FILED-2
WS-FIELD-3 = INPUT1-FILED-3
WS-FIELD-4 = INPUT1-FILED-4
WS-FIELD-5 = INPUT1-FILED-5
OUTPUT-REC = WS-OUTPUT-REC
PUT OUTFILE
WS-OUTPUT-CTR = WS-OUTPUT-CTR + 1
*
************************************************************************
1000-START. PROC
************************************************************************
DISPLAY '***********************************************************'
DISPLAY '***** PGM EZSAMPLE BEGINS *****'
DISPLAY '***********************************************************'
DISPLAY 'EXECUTION START TIME : ' SYSTIME
DISPLAY '***********************************************************'
WS-OUTPUT-CTR = 0
WS-INPUT-CTR = 0
END-PROC
************************************************************************
9000-FINISH. PROC
************************************************************************
DISPLAY '***********************************************************'
DISPLAY '***** PGM EZSAMPLE BEGINS *****'
DISPLAY '***********************************************************'
DISPLAY 'EXECUTION END TIME : ' SYSTIME
DISPLAY '***********************************************************'
DISPLAY '*******************************'
DISPLAY '*******************************'
DISPLAY 'TOTAL INPUT RECORDS :' RECORD-COUNT(INPUT1)
DISPLAY 'TOTAL OUTPUT RECORDS :' RECORD-COUNT(OUTFILE)
DISPLAY '*******************************'
END-PROC
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page