skip multiple entry of a perticuler field.



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

skip multiple entry of a perticuler field.

Postby Mayank[123] » Thu Nov 01, 2012 10:51 am

I have 1 input file

Sno    Subject     roll-Number        Name
1       English        100            ABC
2       Maths          100            ABC
3       Science        100            ABC
4       Computer       100            ABC 
5       English        200            DEF
6       English        300            GHI
7       Maths          300            GHI
8       Science        400            JKL
9       Computer       500            MNO 
10      English        500            MNO


sorted roll-Number wise
now i just wanna print if roll number repeats then it will show only Ist time, all the other record having same roll number would be blank


Sno  Subject     roll-Number   Name    Print field
1     English         100      ABC     100
2     Maths           100      ABC     ___(Space)   
3     Science         100      ABC     ___(Space)   
4     Computer        100      ABC     ___(Space)   
5     English         200      DEF     200
6     English         300      GHI     300
7     Maths           300      GHI     ___(Space)   
8     Science         400      JKL     400
9     Computer        500      MNO     500

how I can do this using DFSort.
Mayank[123]
 
Posts: 14
Joined: Thu Oct 11, 2012 11:58 am
Has thanked: 0 time
Been thanked: 0 time

Re: skip multiple entry of a perticuler field.

Postby Pandora-Box » Thu Nov 01, 2012 1:45 pm

Try this

  SORT FIELDS=COPY
   INREC IFTHEN=(WHEN=INIT,
     OVERLAY=(100:SEQNUM,5,ZD,RESTART=(24,3))),
         IFTHEN=(WHEN=(100,5,ZD,EQ,1,AND,1,3,CH,EQ,C'SNO'),
     BUILD=(1,42,47:C'PRINT FIELD')),
         IFTHEN=(WHEN=(100,5,ZD,EQ,1),
     BUILD=(1,42,47:24,3)),
         IFTHEN=(WHEN=NONE,
     BUILD=(1,42,80:X))
User avatar
Pandora-Box
 
Posts: 65
Joined: Fri Feb 10, 2012 8:30 pm
Location: Mars
Has thanked: 3 times
Been thanked: 6 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post