Page 1 of 1

SORT using WHEN=GROUP

PostPosted: Fri Nov 29, 2013 11:11 pm
by jorgess
Hi,

Could someone help me with this please?

Input:
<...+....1....+....2....+....3....+....
     ABC 13.02.2013            5203,42
     BOP 13.02.2013         2731356,48
     RRR 13.02.2013               0,00
     ABC 14.02.2013         3034718,66
     ABC 14.02.2013             749,44
     BOP 14.02.2013           27013,82
     RRR 14.02.2013               0,00
     BOP 15.02.2013          738599,25
     RRR 15.02.2013               0,00
     ABC 18.02.2013           10808,49
     BOP 18.02.2013          129649,51
     RRR 18.02.2013               0,00
     BOP 20.02.2013          929333,96
     RRR 20.02.2013               0,00
     RCB 20.02.2013              30,59


Expected Output:

<...+....1....+....2....+....3....+....
     ABC 13.02.2013            5203,42
     BOP 13.02.2013         2731356,48
     RRR 13.02.2013               0,00
     ABC 14.02.2013         3034718,66
     ABC 14.02.2013             749,44
     BOP 14.02.2013           27013,82
     RRR 14.02.2013               0,00
     ABC 18.02.2013           10808,49
     BOP 18.02.2013          129649,51
     RRR 18.02.2013               0,00


Important Points:
1. Each groups has the same date, 10-19, (e.g. 13.02.2013 group has three lines,
group 20.02.2013 has two lines. There is not a defined number of possible lines);

2. The output will have only the groups that have ABC and RRR identifiers, 6-8. In the example listed above,
group 15.02.2013 and 20.02.2013 will not be part of the output.Identifiers may appear more than once in a group.



Query:

I know I need to use IFTHEN(WHEN=GROUP).
How do I do it?

Code'd

Re: SORT using WHEN=GROUP

PostPosted: Sat Nov 30, 2013 2:24 am
by BillyBoyo
Use IFTHEN=(WHEN=GROUP with KEYBEGIN= for the data. PUSH the identifier.

OUTFIL INCLUDE= for the identifier(s) you want.