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

addition of two feilds using sort of two diff files


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

New User


Joined: 08 Oct 2006
Posts: 2

PostPosted: Sun Oct 08, 2006 2:18 pm
Reply with quote

Hi,

could any one please let me know how to add two feilds, each one is from two differnt files using sort,

Input file1 has a record as shown, from col 1 to 16 ;
Total Empe 00005

Input file2 has a record as shown, from col 1 to 16 ;
Total Empe 00005

output file using sort should show as(i.e from 1 to 10 we ahve to remove duplicate and from 12 to 16 we have to add value;
Total Empe 000010

Thanks much in adavance.
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: Sun Oct 08, 2006 11:36 pm
Reply with quote

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

Code:

//S1    EXEC  PGM=ICEMAN       
//SYSOUT    DD  SYSOUT=*       
//SORTIN DD DSN=...  input file1                 
//       DD DSN=...  input file2                                 
//SORTOUT DD DSN=...  output file     
//SYSIN    DD    *             
  SORT FIELDS=(1,10,CH,A)     
  OPTION ZDPRINT               
  SUM FIELDS=(12,5,ZD)         
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
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 How to split large record length file... DFSORT/ICETOOL 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top