Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Compare yesterday's date to the one o... migusd SYNCSORT 5 Fri Sep 22, 2017 11:35 pm
No new posts it is possible output a SET value fro... Martylin JCL & VSAM 4 Fri Sep 22, 2017 7:08 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Hardcoded negative sign value in output scdinesh SYNCSORT 8 Fri Sep 08, 2017 5:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us