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

Business Requirement : Matching records...


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

New User


Joined: 08 Apr 2008
Posts: 5
Location: Gurgaon

PostPosted: Wed Jun 04, 2008 11:34 am
Reply with quote

Below is my requirement Requirement
-----------------

File1
------
00 0000
B1 A1
B2 A2
B1 A3
B3 A4
99 9999

Here, '00 0000' is Header. '99 9999' is Trailer record.

FILE 2
--------
B1 S1
B2 S2
B3 S3
B4 S4
B5 S5

File1 and File2 are Input files and compared.

Output S* files such that Header contains current date. Trailer contains Record Count.
---------------------

File S1
------------
00 0000 S1 020080603
B1 A1 S1
B1 A3 S1
99 9999 02


File S2
------------
00 0000 S2 020080603
B2 A2 S2
99 9999 01


File S3
------------
00 0000 S3 020080603
B3 A4 S3
99 9999 01
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jun 05, 2008 1:46 am
Reply with quote

The following DFSORT/ICETOOL JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=ICETOOL                                 
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN1      DD *                                             
00 0000                                                     
B1 A1                                                       
B2 A2                                                       
B1 A3                                                       
B3 A4                                                       
99 9999                                                     
//IN2      DD *                                             
B1 S1                                                       
B2 S2                                                       
B3 S3                                                       
B4 S4                                                       
B5 S5                                                       
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//OUT1     DD SYSOUT=*                                       
//OUT2     DD SYSOUT=*                                       
//OUT3     DD SYSOUT=*                                       
//TOOLIN   DD *                                             
  COPY FROM(IN2) USING(CTL1)                                 
  COPY FROM(IN1) USING(CTL2)                                 
  SPLICE FROM(T1) TO(OUT1) ON(1,2,CH) KEEPNODUPS KEEPBASE - 
  WITHALL WITH(01,80) USING(CTL3)
//CTL1CNTL DD *                                       
  OUTFIL FNAMES=T1,BUILD=(1,2,78X,1,5)                 
//CTL2CNTL DD *                                       
  OMIT COND=(1,2,SS,EQ,C'00,99')                       
  OUTFIL FNAMES=T1,OVERLAY=(81:5X)                     
//CTL3CNTL DD *                                       
  OUTFIL FNAMES=OUT1,BUILD=(01,5,83,3,80:X),REMOVECC, 
  INCLUDE=(3,78,CH,NE,C' ',AND,81,2,CH,EQ,C'B1'),     
  HEADER1=('00 0000 ',83,3,X,DATENS=(4MD)),           
  TRAILER1=('99 9999 ',COUNT=(M11,LENGTH=2))           
                                                       
  OUTFIL FNAMES=OUT2,BUILD=(01,5,83,3,80:X),REMOVECC, 
  INCLUDE=(3,78,CH,NE,C' ',AND,81,2,CH,EQ,C'B2'),     
  HEADER1=('00 0000 ',83,3,X,DATENS=(4MD)),           
  TRAILER1=('99 9999 ',COUNT=(M11,LENGTH=2))           
                                                       
  OUTFIL FNAMES=OUT3,BUILD=(01,5,83,3,80:X),REMOVECC, 
  INCLUDE=(3,78,CH,NE,C' ',AND,81,2,CH,EQ,C'B3'),     
  HEADER1=('00 0000 ',83,3,X,DATENS=(4MD)),           
  TRAILER1=('99 9999 ',COUNT=(M11,LENGTH=2))           
/*
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 Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top