Page 1 of 1

sort two files with same sort condition

Posted: Wed Jan 02, 2008 7:25 pm
by anu.slaksh
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??

Posted: Wed Jan 02, 2008 8:51 pm
by Frank Yaeger
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).

Posted: Thu Jan 03, 2008 6:27 pm
by anu.slaksh
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

Posted: Thu Jan 03, 2008 9:12 pm
by Frank Yaeger
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)
/*

its a really good

Posted: Fri Jan 25, 2008 12:33 pm
by yamank
hi
this is really a good thing to improve the knowledge.
i am a fresher so its very good site for me.

Posted: Wed Mar 05, 2008 7:58 pm
by arrbee
WOW......this is really nice trick.....

Would anybody please suggest a syncsort version of this?

Thx.