club five fields into one in easytrieve program.

Ask/Clarify the questions on EASYTRIEVE

Moderators: DikDude, Moderator Group

Post Reply
jp_swprod
Member
Posts: 2
Joined: Sun Aug 29, 2010 10:17 pm
Location: chennai

club five fields into one in easytrieve program.

Post by jp_swprod » Sun Aug 29, 2010 10:39 pm

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.

User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

Post by Krishna » Mon Aug 30, 2010 3:23 pm

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                                                                
                                                                         


jp_swprod
Member
Posts: 2
Joined: Sun Aug 29, 2010 10:17 pm
Location: chennai

Post by jp_swprod » Mon Aug 30, 2010 5:11 pm

Thankx alot krishna :D

Post Reply

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



Other References
Mainframe Tools and others