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
 

 

Need help to compare two files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
jaganmoni1

New User


Joined: 31 Oct 2008
Posts: 33
Location: CANADA

PostPosted: Thu Mar 26, 2009 4:31 pm    Post subject: Need help to compare two files
Reply with quote

Hi,
I have two input PS files. File-1 contains 5 digit branch numbers of type 9(05).
File-1 is FB and record length is 5

File -2 also contains the 5 digit branch number in packed format i.e. S9(05) comp-3.
File-2 is FB and record length is 30. Branch number is the first filed.

Output file must contain the records of file-2 only if file-2 branch number is available in file-1.
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 Mar 26, 2009 9:25 pm    Post subject:
Reply with quote

Please show an example of the records in each input file (relevant fields only) and what you expect for output. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Back to top
View user's profile Send private message
jaganmoni1

New User


Joined: 31 Oct 2008
Posts: 33
Location: CANADA

PostPosted: Mon Mar 30, 2009 11:53 am    Post subject: Reply to: Need help to compare two files
Reply with quote

Hi Frank,

Please see below for requested information.
File-1 Layout:
Code:
01 BRANCH-RECORD.                 
   05 LTB-BRNACH-NO    PIC 9(05).
   05 FILLER           PIC X(75).

File-1 always contains only unique records.
Please see below for the data how it looks like in File-1:

Code:
----+----1----+----2----+----3----+----4----+----5----
***************************** Top of Data ************
00331                                                 
50088                                                 
80002                                                 
**************************** Bottom of Data **********


File-2 Layout:
Code:
01  FINAL-BALANCE-RECORD.                               
     05 FINBAL-TRANSIT                   PIC S9(5)    COMP-3
*                BRANCH NUMBER                           
     05 FINBAL-ACCOUNT                   PIC S9(7)    COMP-3
*                ACCOUNT NUMBER                         
     05 FINBAL-LOAN                      PIC X(1).       
*                LOAN NUMBER (2 BCD DIGITS)             
     05 FINBAL-OS-BALANCE                PIC S9(9)V99 COMP-3
*                YESTERDAY'S OS BALANCE (ADJUSTED)       
     05 FINBAL-PROCESS-TYPE              PIC X(1).       
*                PROCESSING TYPE                         
     05 FINBAL-SUBTYPE                   PIC X(3).       
*                SUBTYPE FOR LOAN                       
     05 FINBAL-REGION                    PIC X(1).       
*                REGION CODE 'E'=EAST,'W'=WEST           
     05 FINBAL-SIC-CODE                  PIC S9(5)    COMP-3
*                SIC CODE                               
     05 FINBAL-AGGR-TOTAL-BKDTE-BAL      PIC S9(13)V99 COMP-3
*                AGGREGATED TOTAL OF BACKDATES' BALANCE 


File-2 may contain duplicate branch numbers.

Code:
----+----1----+----2----+----3----+----4----+----5----+----6
 -----------------------------------------------------------
********************************* Top of Data **************
                                                           
                                                           
 -----------------------------------------------------------
.....ä........3190E.á*........                             
02300420001111FFFFC04500000000                             
07C003C100111C3190505C0000000C                             
 -----------------------------------------------------------
.....ä........3190E.á*........                             
02300420001111FFFFC04500000000                             
07C003C500111C3190505C0000000C                             
 -----------------------------------------------------------
......æ....Ø..3189E.á*........                             
03100090000800FFFFC04500000000                             
03C000C100300C3189505C0000000C                             
 -----------------------------------------------------------
......æ.....e.3085E.á*........                             
03100090000280FFFFC04500000000                             
03C000C200705C3085505C0000000C                             
 -----------------------------------------------------------


If file-2 branch number is available in File-1, then only File-2 record must be written on output file.
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 Mar 30, 2009 9:15 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/5)
//IN2 DD DSN=...  input file2 (FB/30)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/30)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,3,PD) WITHALL WITH(1,31) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC BUILD=(1,5,ZD,TO=PD,LENGTH=3,31:C'BB')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(31:C'VV')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(31,2,CH,EQ,C'VB'),BUILD=(1,30)
/*
Back to top
View user's profile Send private message
jaganmoni1

New User


Joined: 31 Oct 2008
Posts: 33
Location: CANADA

PostPosted: Thu Apr 02, 2009 11:49 am    Post subject: Reply to: Need help to compare two files
Reply with quote

Hi Frank,

I am very sorry to give the late reply as I am out of office from past three days.
This job is working fine without any issues. Thanks a lot for your quick reply. Looks like this ICETOOL is amazing and we can reduce most of the cobol programs which handle the files processing.
By seeing your answers for different queries I am very much interesting to acquire more and more knowledge on ICETOOL.

Once again thanks a lot for your help on same
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 Apr 02, 2009 8:31 pm    Post subject:
Reply with quote

I'm glad I could help and happy to hear you like DFSORT's ICETOOL.
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 compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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