Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

comparision of values from three different file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: comparision of values from three different file
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 Moderator


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

PostPosted: Thu Sep 13, 2007 8:27 pm    Post subject:
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    Post subject: Reply to: comparision of values from three different file
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 Moderator


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

PostPosted: Mon Sep 17, 2007 9:42 pm    Post subject:
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    Post subject: Reply to: comparision of values from three different file
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    Post subject:
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 Moderator


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

PostPosted: Fri Oct 05, 2007 9:40 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us