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
 

 

Combine three files using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
harijax

New User


Joined: 16 Jul 2008
Posts: 22
Location: Bangalore

PostPosted: Fri Jun 05, 2009 4:03 pm    Post subject: Combine three files using DFSORT
Reply with quote

Hi,

I have three files like below.
AAABangalore
BBBFrankfurt
CCCIslamabad


File - B

AAAIndia
BBBGermany
CCCPakistan

File - C

AAAGold
BBBSilver
CCCBronze

I wanted to combine three files and get output as

AAABangaloreIndiaGold
BBBFrankfurtGermanySilver
CCCIslamabadPakistanBronze
Back to top
View user's profile Send private message

harijax

New User


Joined: 16 Jul 2008
Posts: 22
Location: Bangalore

PostPosted: Fri Jun 05, 2009 4:50 pm    Post subject:
Reply with quote

A slight changes. I wanted in this way. Can you please help me.

INFILE - A

AAABangalore
BBBFrankfurt
CCCIslamabad
DDDColombo
EEETokyo

INFile - B

AAAIndia
BBBGermany
CCCPakistan
DDDSrilanka

INFile - C

AAAGold
BBBSilver
CCCBronze
EEEDiamond

Output:
AAABangaloreIndiaGold
BBBFrankfurtGermanySilver
CCCIslamabadPakistanBronze
DDDColomboSrilanka
EEETokyo Diamond


Regards
harijax
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: Fri Jun 05, 2009 9:09 pm    Post subject:
Reply with quote

What is the rule by which the EEE record has blanks after Tokyo but the other records don't? I'm going to assume that you really don't want the fields squeezed together like that. If you do, then you're going to have to explain the rules for that. I also assumed the maximum length for a field is 10 characters.

You can use a DFSORT job like the following to do what I think you want.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD *
AAABangalore
BBBFrankfurt
CCCIslamabad
DDDColombo
EEETokyo
/*
//IN2 DD *
AAAIndia
BBBGermany
CCCPakistan
DDDSrilanka
/*
//IN3 DD *
AAAGold
BBBSilver
CCCBronze
EEEDiamond
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/40)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
COPY FROM(IN3) TO(T1) USING(CTL3)
SPLICE FROM(T1) TO(OUT) ON(1,3,CH) KEEPNODUPS WITHANY -
  WITH(16,10) WITH(27,10)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(40:X)
/*
//CTL2CNTL DD *
  INREC BUILD=(1,3,16:4,10,40:X)
/*
//CTL3CNTL DD *
  INREC BUILD=(1,3,27:4,10,40:X)
/*



OUT would have:

Code:

AAABangalore   India      Gold     
BBBFrankfurt   Germany    Silver   
CCCIslamabad   Pakistan   Bronze   
DDDColombo     Srilanka             
EEETokyo                  Diamond   
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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm


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