Hello,
at present, I have a file like this in SORTIN
TEAM LIVERPOOL
CITY PARIS
PLAYER ZINEDINE ZIDANE
PLAYER DIEGO MARADONA
TEAM REAL MADRID
CITY JAIPUR
Use ICETOOL, and complete two (or more) SORT stages in one single job step.
Another way:
Code:
INREC - shift all records except PLAYER 7 bytes to the right
SORT FIELDS=(8,50,CH,A)
OUTFIL FNAMES=F1,INCLUDE=(no PLAYER),BUILD=(8,50)
OUTFIL FNAMES=F2,SAVE,BUILD=(1,50)
TEAM LIVERPOOL
CITY PARIS
PLAYER ENZO FRANCESCOLI
PLAYER DIEGO MARADONA
TEAM REAL MADRID
CITY JAIPUR
I want two output
First ouput (all except records starting by PLAYER) sorted by position 6
Second output (records starting by PLAYER) sorted by name position 18
The INPUT was in fact a VB 400 and I would keep the format for the two outputs.
TEAM LIVERPOOL
CITY PARIS
PLAYER ENZO FRANCESCOLI
PLAYER DIEGO MARADONA
TEAM REAL MADRID
CITY JAIPUR
I want two output
First ouput (all except records starting by PLAYER) sorted by position 6
Second output (records starting by PLAYER) sorted by name position 18
The INPUT was in fact a VB 400 and I would keep the format for the two outputs.
Hoping it's clearer and not wrong this time
Nablokov
I gave you two solutions, both almost ready to use.
You have ignored all of them.
If so, there is no need to ask any questions; it’s wasting of time.
The original question was "Is it possible to do it in one step ?" , Answer is, it might be possible. TS is not asking how to do it , since its pretty simple to do it in multiple steps or one giant ICETOOL step with multiple COPY and CTL* statement/passes.
This is the dirty way in one step with multiple passes.
Use ICETOOL, and complete two (or more) SORT stages in one single job step.
Another way:
Code:
INREC - shift all records except PLAYER 7 bytes to the right
SORT FIELDS=(8,50,CH,A)
OUTFIL FNAMES=F1,INCLUDE=(no PLAYER),BUILD=(8,50)
OUTFIL FNAMES=F2,SAVE,BUILD=(1,50)
Joined: 15 Aug 2015 Posts: 1245 Location: Bamberg, Germany
Rohit Umarjikar wrote:
sergeyken wrote:
The simplest way:
..
Another way:
Code:
INREC - shift all records except PLAYER 7 bytes to the right
SORT FIELDS=(8,50,CH,A)
OUTFIL FNAMES=F1,INCLUDE=(no PLAYER),BUILD=(8,50)
OUTFIL FNAMES=F2,SAVE,BUILD=(1,50)
Sorry Sergeyken,
I didn't understand your solutions, I had made a mistake in the INREC and I ve believed that's because I was wrong in the wording of the problem.
It works now.
So, I am numbskull on this case.
Thank you again for your solution and your time ! and to Rohit and Joerg also to confirm I had to read and test !
Two output files become different LRECL (F1 - 55 bytes, F2 - 50 bytes).
For exercise purposes it’s OK, but in a real production task it may cause problems in the future.