sort two files with same sort condition

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
anu.slaksh
Member
Posts: 11
Joined: Tue Nov 13, 2007 1:57 pm

sort two files with same sort condition

Post by anu.slaksh » Wed Jan 02, 2008 7:25 pm

how to sort two files with same sort cond n write it into two diff output files

That is to be still more clear,
i have two input files: input1 and input2

i have to sort the files with same sort condt: sort fields=copy

and need two diff output files : output1(corresponding to input1) and output2(corresponding to input2)

tis is possible with two sort steps..
but is there any way to have this process in a single sort step??
anu

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Wed Jan 02, 2008 8:51 pm

Your explanation of what you want to do is very unclear.
i have to sort the files with same sort condt: sort fields=copy
SORT FIELDS=COPY copies the files - it does NOT sort them. So I have no idea what it is you're trying to do.

Show an example of the records in each input file and the records you expect in each output file, and explain the rules for getting from input to output. Give the RECFM and LRECL of the input files. Give the starting position, length and format of each relevant field (if any).
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

anu.slaksh
Member
Posts: 11
Joined: Tue Nov 13, 2007 1:57 pm

Post by anu.slaksh » Thu Jan 03, 2008 6:27 pm

ok, here is an example:
Input file 1: Lrecl = 80
Input file 2: Lrecl = 120

Sort cond : sort field= (9,9,ch,a)

output file 1: Lrecl = 80
Output file 2: Lrecl = 120

I want to sort two different files with same sort condition and write it into two different corresponding output files..

Is there any way to do this in a single step.. instead of two steps for each file??

do u want me to be still more clear?? please do let me know
anu

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Thu Jan 03, 2008 9:12 pm

You can do it in one step with DFSORT's ICETOOL as follows (but it will take two passes):

Code: Select all

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/80)
//IN2 DD DSN=...  input file2 (FB/120)
//OUT1 DD DSN=...  output file1 (FB/80)
//OUT2 DD DSN=...  output file2 (FB/120)
//TOOLIN DD *
SORT FROM(IN1) TO(OUT1) USING(CTL1)
SORT FROM(IN2) TO(OUT2) USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(9,9,CH,A)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

User avatar
yamank
Member
Posts: 2
Joined: Mon Jan 14, 2008 3:18 pm
Location: bangalore

its a really good

Post by yamank » Fri Jan 25, 2008 12:33 pm

hi
this is really a good thing to improve the knowledge.
i am a fresher so its very good site for me.

User avatar
arrbee
Active Member
Posts: 144
Joined: Fri Feb 24, 2006 11:33 am

Post by arrbee » Wed Mar 05, 2008 7:58 pm

WOW......this is really nice trick.....

Would anybody please suggest a syncsort version of this?

Thx.
Arr Bee
-------------
?My joy in learning is partly that it enables me to teach? - Seneca(Roman philosopher, mid-1st century AD)

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others