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

How to compare two cloumn using FILEAID


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sadashiv.a.bhosure

New User


Joined: 01 Feb 2007
Posts: 15
Location: india

PostPosted: Fri Mar 23, 2007 6:15 pm
Reply with quote

Hi,

I have a file like
-----------------------------------------------------------
name cnt1 val1 cnt2 val2 indicator
-----------------------------------------------------------
aaaa 01 91 01 91
bbbb 02 85 02 90
cccc 01 20 02 40

if (cnt1 not equal to cnt2) and (val1 not equal to val2) then i want to update indicator field to '***'

i.e.
I want output as follows

-----------------------------------------------------------
name cnt1 val1 cnt2 val2 indicator
-----------------------------------------------------------
aaaa 01 91 01 91
bbbb 02 85 02 90 ***
cccc 01 20 02 40 ***


HOW will we do it using FILEAID..........

waiting for reply. is there any other solution without fileaid?
Can we do it using sort utility.......


Thanks
Sadashiv.
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: Fri Mar 23, 2007 7:37 pm
Reply with quote

Hello,

This is most likely a better job for the sort than for file-aid.

Which sort product does your location use (most likely DFSORT or Syncsort)?
Back to top
View user's profile Send private message
sadashiv.a.bhosure

New User


Joined: 01 Feb 2007
Posts: 15
Location: india

PostPosted: Mon Mar 26, 2007 5:25 pm
Reply with quote

we are using syncsort......
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: Tue Mar 27, 2007 1:20 am
Reply with quote

Hello,

I'm not positive, but i believe you can do what you want with Syncsort. Someone strong with Syncsort might contribute suggestions.

It may take a bit of digging in the Fine Manual. If you do not have the documentation, it may be gotten for free from Syncsort (if your organization is a licensed user).
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Tue Mar 27, 2007 11:43 am
Reply with quote

Hi There,

I have done these in three step
First step : To Insert Seq number at the end
Code:
Sort card
//SYSIN    DD  *                 
   OPTION COPY                   
   INREC FIELDS=(1,80,SEQNUM,8,ZD)
/*                               


Second step:To insert *** starting at 13 th byte if cnt1 not equal to cnt2 or val1 not equal to val2 .Its taking the input from prev sortout file
Sort Card
Code:
//SYSIN    DD  *                                             
   OPTION COPY                                               
   OUTFIL FILES=A,OUTREC=(1,12,C'***',16,73),               
             INCLUDE=(5,2,ZD,NE,9,2,ZD,OR,7,2,ZD,NE,11,2,ZD)
   OUTFIL FILES=B,OUTREC=(1,88),                             
             INCLUDE=(5,2,ZD,EQ,9,2,ZD,AND,7,2,ZD,EQ,11,2,ZD)
/* 

Third Step:To Concatenate both the file by using seq number
Code:
Sort card:
//SYSIN    DD  *           
   SORT FIELDS=(81,8,ZD,A) 
   OUTREC FIELDS=(1,80)     
/*     


Its not optimized solution but its giving desired result
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Compare two files with a key and writ... SYNCSORT 3
Search our Forums:

Back to Top