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

Want my output file as below using DFSORT


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

New User


Joined: 11 Jul 2005
Posts: 87

PostPosted: Mon Dec 18, 2006 1:49 pm
Reply with quote

I have two files A and B

FileA Contains ID X(5), DEPT X(20) as field names.

FileB Contains ID X(5), Name X(20) and Revenue S9(7)V9(2) comp-3 as filed names

Lets say

FileA
======

Code:

ID         DEPT
12345      Marketing
23415      Finance


File B
=====

Code:

ID         Name             Revenue
12345      Rohan             12345.50
111345     Rakesh            24567.70
23415      Frank            123956.60


I want my output file FIleC as belows:

Code:

DEPT             Revenue
Marketing         12345.50
Finance          123956.60


Can this be done using DFSORT?

Thanks in advance,
Chinni.
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: Mon Dec 18, 2006 9:11 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. However, I suspect the example you showed does not fully describe what you want.
You only show one ID associated with Marketing and one ID associated with Finance. Are there really multiple IDs associated with each and if so, do you want totals or what? I also assumed that you wanted the output Revenue field as a PD value rather than as a displayable value. Is that the case?

If there is more to what you want, please show me a more complete example of the input and output records and explain more clearly what you want.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/25)
//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/25)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(26,5,CH) -
  WITH(21,5) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC BUILD=(1:6,20,26:1,5)
/*
//CTL2CNTL DD *
  INREC BUILD=(21:26,5,26:1,5)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,BUILD=(1,25)
/*
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top