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

comparision of values from three different file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Raghavendra P K

New User


Joined: 24 Aug 2007
Posts: 24
Location: bangalore

PostPosted: Thu Sep 13, 2007 1:46 pm
Reply with quote

Hi,
i have 3 files of RECFM=FB.record length =80.

Format of all the three files are like this.

File1:
Code:
field1 field2     field3
 2222 333333 555.66 333
 3333 454544 333.33 234


File2:
Code:
 field1    field2   field3
 visa     444444 natwest
 master 777777 hsbc


File3:
Code:
field1         field2   
             lowrange  uprange   
 Visa     444440 - 444445     hsbc
 master 555551 - 555556     natwest



My requirement is I have to check the values present in Field2 of File1
is present in Field2 of FIle2. If not found then check whether the value in Field2 of File1 is present in the Field2 of File3.If it is not found write those records from FILE1 into a file.

But the value present in the FIeld2 of FILE3 has range . we need to check the value from FILE1 lies in that range or not.

Coudl you please help me to accoplish this using DFSORT.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Sep 13, 2007 8:27 pm
Reply with quote

What is the approximate maximum number of records in each file?
Back to top
View user's profile Send private message
Raghavendra P K

New User


Joined: 24 Aug 2007
Posts: 24
Location: bangalore

PostPosted: Mon Sep 17, 2007 12:44 pm
Reply with quote

Hi Frank,
My first file has 20 million records.
Second file has 600 records.
third file has 140 records.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Sep 17, 2007 9:42 pm
Reply with quote

Based on the information you've given, I think this DFSORT/ICETOOL job will do what you asked for. I assumed File1 Field2 is in positions 7-12, File2 Field2 is in positions 11-16, File3 lowrange is in positions 11-16 and File3 uprange is in positions 20-25. You can change the positions as appropriate.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1
//IN2 DD DSN=...  input file2
//IN3 DD DSN=...  input file3
//C3 DD DSN=&&C3,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file
//TOOLIN   DD    *
COPY FROM(IN2) TO(C3) USING(CTL1)
COPY FROM(IN3) TO(C3) USING(CTL2)
COPY FROM(IN1) TO(OUT) USING(CTL3)
//CTL1CNTL DD *
  INREC BUILD=(3X,C'7,6,EQ,C''',11,6,C''',OR,',80:X)
/*
//CTL2CNTL DD *
  INREC BUILD=(3X,C'(7,6,GE,C''',11,6,
               C''',AND,7,6,LE,C''',20,6,C'''),OR,',80:X)
/*
//CTL3CNTL DD *
  OPTION COPY
  OMIT FORMAT=CH,COND=(1,1,NE,1,1,OR,
/*
//    DD DSN=*.C3,VOL=REF=*.C3,DISP=(OLD,PASS)
//  DD *
   1,1,NE,1,1)
/*
Back to top
View user's profile Send private message
Raghavendra P K

New User


Joined: 24 Aug 2007
Posts: 24
Location: bangalore

PostPosted: Tue Sep 18, 2007 2:26 pm
Reply with quote

Hi Frank,

Thanks for you help.It worked fine.
Back to top
View user's profile Send private message
KMV

New User


Joined: 15 May 2007
Posts: 22
Location: Coimbatore

PostPosted: Fri Oct 05, 2007 7:47 pm
Reply with quote

Hi Frank,
Could you please explain this INREC BUILD?
I am getting confused.


Frank Yaeger wrote:

Code:

//CTL1CNTL DD *
  INREC BUILD=(3X,C'7,6,EQ,C''',11,6,C''',OR,',80:X)
/*
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Oct 05, 2007 9:40 pm
Reply with quote

Quote:
Could you please explain this INREC BUILD?


You can code it this way to see the various elements:

Code:

  INREC BUILD=(3X,
     C'7,6,EQ,C''',
     11,6,
     C''',OR,',
     80:X)


We are building conditions like this from the file2 input records:

Code:

  7,6,EQ,C'variable',OR,


3X -> three blanks
C'7,6,EQ,C''', -> 7,6,EQ,C'
Note that you must code two apostrophes for each apostrophe you want in the output record, so C'' = C'
11,6 -> positions 11-16 from the file2 input record (e.g. 444444)
C''',OR,', -> ',OR,
80:X - pads the records out with blanks to 80 characters
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top