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
 
Sorting 2 files with different key-positions

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

New User


Joined: 11 Jan 2006
Posts: 49
Location: Lower Saxony (DE)

PostPosted: Wed Jan 11, 2006 9:44 pm    Post subject: Sorting 2 files with different key-positions
Reply with quote

Some time ago I had the problem to sort two files with different key-positions. I placed my question in an other forum but this is closed now. Maybe Mr. Yaeger remembers me and my problem icon_wink.gif Maybe I gonna have some luck here and now? Maybe, meanwhile there's a tool which provides such a feature?
Concrete: Both dataset have an indicator at position 1, length 1. The first Dataset has it's key i.e. at position 10 and the second at position 2, both in length of ten bytes.
i.e.:
First File
Code:
1        One       ...
1        Two       ...
1        Three     ...
1        Four      ...
1        Five      ...
1        Six       ...

Second file
Code:
2Seven     ...
2Eight     ...
2Nine      ...
2Ten       ...
2Eleven    ...
2Twelve    ...


So the desired result shoud be
Code:
2Eight     ...
2Eleven    ...
1        Five      ...
1        Four      ...
2Nine      ...
1        One       ...
2Seven     ...
1        Six       ...
2Ten       ...
1        Three     ...
2Twelve    ...
1        Two       ...

Has anybody an idea with which tool and which statements I can solve this problem without formating one input-file and reformating the result?
Thank you all for your help
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: Wed Jan 11, 2006 11:29 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for. I assumed your input files have RECFM=FB and LRECL=80. If not, the job can be changed appropriately. You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's IFTHEN and OVERLAY functions. Only DFSORT has these functions, so if you don't have DFSORT, you won't be able to use them. If you do have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file1
//       DD DSN=...  input file2
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),OVERLAY=(81:10,10)),
        IFTHEN=(WHEN=(1,1,CH,EQ,C'2'),OVERLAY=(81:2,10))
  SORT FIELDS=(81,10,CH,A)
  OUTREC FIELDS=(1,80)
/*
Back to top
View user's profile Send private message
Auryn

New User


Joined: 11 Jan 2006
Posts: 49
Location: Lower Saxony (DE)

PostPosted: Mon Jan 16, 2006 2:44 pm    Post subject: Thanxx alot
Reply with quote

Sorry, that I didn't answer earlier, but:
icon_lol.gif Hey, phantastic, it works.
Thank you very much.
Back to top
View user's profile Send private message
gowtham_1982
Warnings : 1

Active User


Joined: 02 Dec 2005
Posts: 109

PostPosted: Mon Jan 16, 2006 5:28 pm    Post subject:
Reply with quote

hai frank,

can you please throw some light on the keyword parameter OVERLAY or help us through a link for the same.

kind regards,

gowtham
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 Jan 16, 2006 10:32 pm    Post subject:
Reply with quote

OVERLAY is new with the Dec, 2004 DFSORT PTF. For complete details on OVERLAY and all of the other new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/
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 Comparing two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am
No new posts How to build one file from two input ... daniele DFSORT/ICETOOL 5 Tue Feb 27, 2018 6:45 pm
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am

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