View previous topic :: View next topic
Author
Message
thesumitk Active User Joined: 24 May 2013Posts: 156 Location: INDIA
Hi All,
I have SYNCSORT installed at my Shop and I have a requirement like below
Need to split one sequential file in to 30 equal partition files based on a field defined as S9(13) comp-3
I am using below card but not getting desired results , INput file is having arround 16 millions record but all of them are of 7 digits in file
Code:
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(130,13,PD,LE,3333333333333) ***
OUTFIL FILES=02,INCLUDE=(130,13,PD,GT,333333333333,AND, ***
130,13,PD,LE,666666666666) ***
OUTFIL FILES=03,INCLUDE=(130,13,PD,GT,666666666666,AND, ***
130,13,PD,LE,999999999999) ***
OUTFIL FILES=04,INCLUDE=(130,13,PD,GT,999999999999,AND, ***
130,13,PD,LE,1333333333332) ***
OUTFIL FILES=05,INCLUDE=(130,13,PD,GT,1333333333332,AND, ***
130,13,PD,LE,1666666666665) ***
OUTFIL FILES=06,INCLUDE=(130,13,PD,GT,1666666666665,AND, ***
130,13,PD,LE,1999999999998) ***
OUTFIL FILES=07,INCLUDE=(130,13,PD,GT,1999999999998,AND, ***
130,13,PD,LE,2333333333331) ***
OUTFIL FILES=08,INCLUDE=(130,13,PD,GT,2333333333331,AND, ***
130,13,PD,LE,2666666666664) ***
OUTFIL FILES=09,INCLUDE=(130,13,PD,GT,2666666666664,AND, ***
130,13,PD,LE,2999999999997) ***
OUTFIL FILES=10,INCLUDE=(130,13,PD,GT,2999999999997,AND, ***
130,13,PD,LE,3333333333330) ***
OUTFIL FILES=11,INCLUDE=(130,13,PD,GT,3333333333330,AND, ***
130,13,PD,LE,3666666666663) ***
OUTFIL FILES=12,INCLUDE=(130,13,PD,GT,3666666666663,AND, ***
130,13,PD,LE,3999999999996) ***
OUTFIL FILES=13,INCLUDE=(130,13,PD,GT,3999999999996,AND, ***
130,13,PD,LE,4333333333329) ***
OUTFIL FILES=14,INCLUDE=(130,13,PD,GT,4333333333329,AND, ***
130,13,PD,LE,4666666666662) ***
OUTFIL FILES=15,INCLUDE=(130,13,PD,GT,4666666666662,AND, ***
130,13,PD,LE,4999999999995) ***
OUTFIL FILES=16,INCLUDE=(130,13,PD,GT,4999999999995,AND, ***
130,13,PD,LE,5333333333328) ***
OUTFIL FILES=17,INCLUDE=(130,13,PD,GT,5333333333328,AND, ***
130,13,PD,LE,5666666666661) ***
OUTFIL FILES=18,INCLUDE=(130,13,PD,GT,5666666666661,AND, ***
130,13,PD,LE,5999999999994) ***
OUTFIL FILES=19,INCLUDE=(130,13,PD,GT,5999999999994,AND, ***
130,13,PD,LE,6333333333327) ***
OUTFIL FILES=20,INCLUDE=(130,13,PD,GT,6333333333327,AND, ***
130,13,PD,LE,6666666666660) ***
OUTFIL FILES=21,INCLUDE=(130,13,PD,GT,6666666666660,AND, ***
130,13,PD,LE,6999999999993) ***
OUTFIL FILES=22,INCLUDE=(130,13,PD,GT,6999999999993,AND, ***
130,13,PD,LE,7333333333326) ***
OUTFIL FILES=23,INCLUDE=(130,13,PD,GT,7333333333326,AND, ***
130,13,PD,LE,7666666666659) ***
OUTFIL FILES=24,INCLUDE=(130,13,PD,GT,7666666666659,AND, ***
130,13,PD,LE,7999999999992) ***
OUTFIL FILES=25,INCLUDE=(130,13,PD,GT,7999999999992,AND, ***
130,13,PD,LE,8333333333325) ***
OUTFIL FILES=26,INCLUDE=(130,13,PD,GT,8333333333325,AND, ***
130,13,PD,LE,8666666666658) ***
OUTFIL FILES=27,INCLUDE=(130,13,PD,GT,8666666666658,AND, ***
130,13,PD,LE,8999999999991) ***
OUTFIL FILES=28,INCLUDE=(130,13,PD,GT,8999999999991,AND, ***
130,13,PD,LE,9333333333324) ***
OUTFIL FILES=29,INCLUDE=(130,13,PD,GT,9333333333324,AND, ***
130,13,PD,LE,96666666666657) ***
OUTFIL FILES=30,INCLUDE=(130,13,PD,GT,96666666666657,AND, ***
130,13,PD,LE,99999999999999) ***
Can some one please assist me on this , when I run this card I get data only in five files, one file have 4038 records , 3 files have 1 record few more files have 4 or 2 records and others are empty
Back to top
Robert Sample Global Moderator Joined: 06 Jun 2008Posts: 8700 Location: Dubuque, Iowa, USA
You are telling the sort that you have a 25-digit packed decimal number starting in position 130; try changing 130,13 to 130,7 since packed decimal numbers store 2 digits per byte.
Back to top
Pandora-Box Global Moderator Joined: 07 Sep 2006Posts: 1592 Location: Andromeda Galaxy
Quote:
Need to split one sequential file in to 30 equal partition files
May be if something like below is supported in SYNCSORT then dont need such a big card
Code:
OUTFIL FNAMES=(OUT1,OUT2),SPLIT
Back to top
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10889 Location: italy
Pandora did You notice the logic flaw in the description of the requirement ???
Quote:
Need to split one sequential file in to 30 equal partition files based on a field defined as S9(13) comp-3
somebody must take a decision ...
split on an equal number of records or on a key
Back to top
Pandora-Box Global Moderator Joined: 07 Sep 2006Posts: 1592 Location: Andromeda Galaxy
Yes yes I wanted to ask that too but missed to ask TS
Hope heehs throws some insight
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
Apart from the logical flaw, one more thing I just noticed here.
The TS says key is defined as S9(13) comp-3 . But couple of places the number of digits are 14 and in FILES=01 the condition is not mutually exclusive, ending up same records in multiple files (ofcourse the PD length error is there as well).
Code:
OUTFIL FILES=01,INCLUDE=(130,13,PD,LE,3333333333333) --> 13 digits
OUTFIL FILES=02,INCLUDE=(130,13,PD,GT,333333333333,AND, --> 12 digits
130,13,PD,LE,666666666666) --> 12 digits
OUTFIL FILES=03,INCLUDE=(130,13,PD,GT,666666666666,AND,
130,13,PD,LE,999999999999)
OUTFIL FILES=04,INCLUDE=(130,13,PD,GT,999999999999,AND,
130,13,PD,LE,1333333333332)
OUTFIL FILES=05,INCLUDE=(130,13,PD,GT,1333333333332,AND,
130,13,PD,LE,1666666666665)
Code:
OUTFIL FILES=29,INCLUDE=(130,13,PD,GT,9333333333324,AND, --> 13 digits
130,13,PD,LE,96666666666657) --> 14 digits
OUTFIL FILES=30,INCLUDE=(130,13,PD,GT,96666666666657,AND, --> 14 digits
130,13,PD,LE,99999999999999) --> 14 digits
Back to top
Please enable JavaScript!