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
 
Help on sorting and merging

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

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Tue Aug 07, 2012 2:14 am    Post subject: Help on sorting and merging
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

Moderator


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

PostPosted: Tue Aug 07, 2012 2:26 am    Post subject:
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    Post subject: Reply to: Help on sorting and merging
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    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 Sorting on text - but in non-alphabet... Roy Ware SYNCSORT 5 Wed Aug 23, 2017 9:15 pm
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Sorting group data rajella DFSORT/ICETOOL 4 Sun Jan 22, 2017 11:32 pm
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am
No new posts Stripping and Sorting of VB file G SRINIVASA RAO SYNCSORT 5 Wed Sep 14, 2016 1:34 pm

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