MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

More than one field match in EZT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
apiyan
Beginner


Joined: 16 May 2009
Posts: 9
Topics: 5

PostPosted: Sun May 17, 2009 12:47 am    Post subject: More than one field match in EZT Reply with quote

I have a input file as below:

input file: FB 300
Code:

F1      F2      F3     F4      F1      F2        F3      F4

451    MIK      B1    001     389      MIK       C2      987
973    BOL      C8    002     973      VIO       L7      369
024    ADAM     P8    008     807     OWEN       P8      401

I am looking for output file as
Output file:
Code:

F1     F2     F3    F4    F1     F2   F3   F4   MF1   MF2   MF3

451    MIK    B1    001   389    MIK  C2   987    N    Y     N   
973    BOL    C8    002   973    VIO  L7   369    Y    N     N
024    ADAM   P8    008   807   OWEN  P8   401    N    N     Y


(MF1 , MF2 & MF3 are Flag fields of length 1 byte)

I want to read the three fields (F1, F2 & F3) out of four fields from the input file, and if its matched/Same , i want to write it in a output file with a new field called MF1, MF2 & MF3 which is called flag field,

If matched/Same , i want to write as Y
If not matched/not same , i want to write as N

I am expecting output exactly same as above.

Can anyone please help me?!

Thanks in advance
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sun May 17, 2009 4:46 am    Post subject: Reply with quote

apiyan,

This is the simplest program you can get and yet you need help? bonk It is just a bunch of IF statements. Just define the fields and positions and use a simple IF

untested code

Code:

FILE INFILE
     IN-REC          001 300 A
     IN-F1           001 003 A
     IN-F2           006 004 A
     IN-F3           012 002 A
     IN-F4           016 004 A
     IN-F5           022 003 A
     IN-F6           028 004 A
     IN-F7           033 002 A

FILE OUTFILE
     OUT-REC         001 300 A
     OUT-MF1         301 001 A
     OUT-MF2         302 001 A
     OUT-MF3         303 001 A


JOB INPUT INFILE

  OUT-REC    = IN-REC

  IF IN-F1   = IN-F5
     OUT-MF1 = 'Y'
  ELSE
     OUT-MF1 = 'N'
  END-IF

  IF IN-F2   = IN-F6
     OUT-MF2 = 'Y'
  ELSE
     OUT-MF2 = 'N'
  END-IF

  IF IN-F3   = IN-F7
     OUT-MF3 = 'Y'
  ELSE
     OUT-MF3 = 'N'
  END-IF

  PUT OUTFILE
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group