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

Help on sorting and merging


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

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Tue Aug 07, 2012 2:14 am
Reply with quote

Hi All,

Could any one please help me on the below issue,

File - 1
*******
Key = 1 to 5 characters
FB, LRECL=10

Code:

11111ppppp
AAAAALLLLL
BBBBBOOOOO
ZZZZZ99999



File - 2
*******
FB, LRECL=10

Key = 1 to 5 characters
Code:

KKKKKppppp
BBBBB11111
ZZZZZSSSSS


The output should be of LRECL=15 and FB. It should look like below,

Code:

BBBBBOOOOO11111
ZZZZZ99999SSSSS


Condition:

If the key matches, then the oputput file should be of lrecl of 15 and the value should be 1 to 10 bytes from file 1 and 6 to 10 bytes of file 2 should be append to 11 to 15 of output file.

Thanks in advance.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Aug 07, 2012 2:26 am
Reply with quote

Why not try joinkeys and reformat?

Numerous examples in forum
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Aug 07, 2012 2:26 am
Reply with quote

Niki,


Code:

//STEP0100 EXEC PGM=SORT           
//SYSOUT   DD SYSOUT=*             
//INA      DD *                   
----+----1----+----2----+----3----+
11111PPPPP                         
AAAAALLLLL                         
BBBBBOOOOO                         
ZZZZZ99999                         
//INB      DD *                   
KKKKKPPPPP                         
BBBBB11111                         
ZZZZZSSSSS                         
//SORTOUT  DD SYSOUT=*             
//SYSIN    DD *                   
  OPTION COPY                     
  JOINKEYS F1=INA,FIELDS=(1,5,A)   
  JOINKEYS F2=INB,FIELDS=(1,5,A)   
  REFORMAT FIELDS=(F1:1,10,F2:6,5)
//*
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
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts Merging 2 datasets into one DFSORT/ICETOOL 1
No new posts Sorting a record spanned over multipl... DFSORT/ICETOOL 13
No new posts Merging 2 files but ignore duplicate... DFSORT/ICETOOL 1
No new posts Syncsort- Merging two records into on... SYNCSORT 5
Search our Forums:

Back to Top