IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

setting the field as per the records in EZT


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rkarthik22

New User


Joined: 18 Apr 2009
Posts: 47
Location: India

PostPosted: Wed Jun 24, 2009 4:36 pm
Reply with quote

Hi Experts,

I have a requirement below!

Input LRECL = 75 RECFM = FB

Quote:
FILE INFILE FB(75 0)

123 mart0000 26-11 678
123 call0318 26-11 678
8910 boox0001 25-54 789
5423 lisp0001 32-99 12555
4921 java0319 89-10 789
4921 java0000th 89-10 789


Code:
Expected output file

Match key   REF    ID    Mart-flg    call0318   boox0001  lisp0001  java0319  java0000th
123        26-11   678       Y          Y          N         N         N         N
8910       25-54   789       N          N          Y         N         N         N
5423       32-99   12555     N          N          N         Y         N         N   
4921       89-10   789       N          N          N         N         Y         Y


This is my EZT code

Code:
FILE INFILE FB(75 0)                         
*                                             
 IN-REC                        1     75   A     
  MATCH-KEY                    01    11   A
  TEXT                         12    20   A
  REF                          32    26   A
  ID                           58    18   A



FILE OUTFILE FB(63 0)

OUT-REC                         1   213  A     
 O-MATCH-KEY                    01   11   A 
 O-REF                          12   26   A 
 O-ID                           38   18   A 
 Mart-flg                       56   1    A 
 call0318-flg                   57   1    A 
 boox0001-flg                   58   1    A 
 lisp0001-flg                   59   1    A 
 java0319-flg                   60   1    A 
 java0000th-flg                 61   1    A 
 BAIS0003-flg                   62   1    A 
 BOSS-flg                       63   1    A 

************* WORKING STORAGE       
*                                                               
       
 WS-MATCH-KEY          W    11  A   
 WS-TEXT           W    20  A                                                             
 WS-REF                W    26  A                                 
 WS-ID                 W    18  A                                 
*                                                               
**********************                         

JOB INPUT(NULL)                     
                         
  GET INFILE                               
  DO WHILE NOT EOF INFILE                 
       WS-MATCH-KEY = MATCH-KEY                               
       WS-REF       = REF                 
       WS-ID        = ID               
  GET INFILE                               
    IF NOT EOF INFILE                     
       IF  WS-MATCH-KEY = MATCH-KEY         
           O-MATCH-KEY  = WS-MATCH-KEY       
           O-REF        = WS-REF           
           O-ID         = WS-ID       
           IF WS-TEXT  = 'mart0000'   
              Mart-flg  =  'Y'   
           END-IF                 
       ELSE       
      PUT OUTFILE
      WS-COUNTER   =  WS-COUNTER    +  1
       END-IF
END-DO 
GOTO JOB


I dint get my expected results...flags are not setting correctly...can anyone help
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 24, 2009 8:29 pm
Reply with quote

Hello,

Suggest you read the input and build an array of the needed values.

After all of the input is read, process the array and create the output you want.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top