Monday, September 26, 2011

SORT: SPLICE parameter with simple examples

SORT SPLICE parameter is explained below with various examples.

T1 file

----+----1----+----2----+
1111111111 FILE1 REC1   1
1111111111 FILE1 REC2   2
1111111111 FILE1 REC3   3
2222222222 FILE1 REC1   1
2222222222 FILE1 REC2   2
3333333333 FILE1 REC1   1
4444444444 FILE1 REC1   1

Eg.1 SPLICE FROM(T1) TO(OUT) ON(1,10,CH) WITH(25,1)

O/P
1111111111 FILE1 REC1   3
2222222222 FILE1 REC1   2

Eg.2 SPLICE FROM(T1) TO(OUT) ON(1,10,CH) WITHEACH WITH(25,1)

O/P
1111111111 FILE1 REC1   2
2222222222 FILE1 REC1   2

Eg.3 SPLICE FROM(T1) TO(OUT) ON(1,10,CH) WITHALL WITH(25,1)

O/P

1111111111 FILE1 REC1   2
1111111111 FILE1 REC1   3
2222222222 FILE1 REC1   2

Eg.3 SPLICE FROM(T1) TO(OUT) ON(1,10,CH) WITH(25,1) KEEPNODUPS

O/P
1111111111 FILE1 REC1   3
2222222222 FILE1 REC1   2
3333333333 FILE1 REC1   1
4444444444 FILE1 REC1   1


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.