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
 

 

Business Requirement : Matching records...

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Business Requirement : Matching records...
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    Post subject: Reply to: Business Requirement : Matching records...
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    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 Business Rule extraction frozenblood CLIST & REXX 9 Tue Dec 27, 2016 10:06 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Matching with Key at different postions. rajatbagga DFSORT/ICETOOL 12 Wed Nov 09, 2016 10:58 am
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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