also want to include som records



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

also want to include som records

Postby GoranAndersson » Wed Dec 03, 2014 1:00 pm

I have a file where the recorde look like this
i use ICETOOL
The file is format VB
i also want to include only the files who has the number 0146 in the 6 kolumn.
I try a lot but it dont work


I|98|300012723|9814334|55|9F37|0|0|M|5CC7161B||
I|98|300012723|9814334|55|9F41|0|0|M|00000011||
I|98|3012723|9814334|55|9F53|0|0|M|52||
I|98|300012735|9814334|48|0023|0|0|POI|||
I|98|300735|9814334|48|0146|0|0|001901840000000000245978000000000180|||
I|98|300012735|9814334|48|0148|0|0|8402|||

As you see the columns is separeted with |
I sorted this file in kolumn3

INREC PARSE=(%=(ENDBEFR=C'|'),
%=(ENDBEFR=C'|'),
%03=(ENDBEFR=C'|',FIXLEN=10)),
BUILD=(1,4,5:%03,15:5)
SORT FIELDS=(5,10,UFF,A)
OUTREC BUILD=(1,4,15)

Göran Andersson
GoranAndersson
 
Posts: 3
Joined: Tue Dec 02, 2014 8:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: also want to include som records

 

Re: also want to include som records

Postby BillyBoyo » Wed Dec 03, 2014 2:00 pm

You'll need six PARSE fields (five can be dummies, like you have the two so far) to get to the 0146. You then need to temporarily extend your record by that field and select on it if you only want those records written, then you'll need OUTFIL with INCLUDE=. If you don't need the data SORTed, then don't SORT. BUILD=(1,4,%parse-field,5) to store the field, 1,4,15) to get rid of it onces used, in OUTFIL.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: also want to include som records

Postby GoranAndersson » Wed Dec 03, 2014 2:29 pm

I think i try rhis but it dont work

INREC PARSE=(%=(ENDBEFR=C'|'),
%=(ENDBEFR=C'|'),
%03=(ENDBEFR=C'|',FIXLEN=10),
%=(ENDBEFR=C'|'),
%=(ENDBEFR=C'|'),
%06=(ENDBEFR=C'|',FIXLEN=04)),
BUILD=(1,4,5:%03,15:%06,19:5)
SORT FIELDS=(5,10,UFF,A)
OUTFIL FNAMES=B797501,
INCLUDE=(15,4,CH,EQ,C'0146')
OUTREC FIELDS=(1,4,19)

Ineed the sort the prblem is that 6 koliumn whith the value 0146 dont be in a fix position
GoranAndersson
 
Posts: 3
Joined: Tue Dec 02, 2014 8:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: also want to include som records

Postby BillyBoyo » Wed Dec 03, 2014 3:03 pm

 INREC PARSE=(%=(ENDBEFR=C'|'),
      %=(ENDBEFR=C'|'),
      %03=(ENDBEFR=C'|',FIXLEN=10),
      %=(ENDBEFR=C'|'),
      %=(ENDBEFR=C'|'),
      %06=(ENDBEFR=C'|',FIXLEN=05)),
      BUILD=(1,4,%03,%06,5)
      SORT FIELDS=(5,10,UFF,A)
      OUTFIL FNAMES=B797501,
      INCLUDE=(15,5,CH,EQ,C'0146 '),
       BUILD=(1,4,20)


That's first a simplification. I've made the length of number six field five bytes, just to show how to avoid false hits.

Then a correction. You had OUTREC FIELDS= (use BUILD=) after the OUTFIL. It doesn't matter the order you put them in, SORT is going to process them in its standard order, OUTREC before OUTFIL. So try now.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: also want to include som records

Postby GoranAndersson » Wed Dec 03, 2014 4:58 pm

Magic, it works thx
you take fixlen =05 the kolumn its only 4

Many thanks

Göran Andersson
GoranAndersson
 
Posts: 3
Joined: Tue Dec 02, 2014 8:01 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post