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
 

 

Want my output file as below using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Want my output file as below using DFSORT
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Dec 18, 2006 9:11 pm    Post subject:
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    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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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