Page 1 of 1

Problem in SORT

PostPosted: Sun Mar 11, 2012 12:50 am
by shailaja85
Hi can some one help me please?

Here are my below input files and control card and obtained output.

JOINKEYS FILES=F1,FIELDS=(1,7,A)
JOINKEYS FILES=F2,FIELDS=(1,7,A)
REFORMAT FIELDS=(F1:1,20,F2:9,32)
SORT FIELDS=COPY                 
OUTFIL FILES=01 


SORTJNF1
----+----1----+----2
AAAAA    AAA1  AAA11
BBBBB    BBB2  BBB22
CCCC     CCC3  CCC33
DDDDD    DDD4  DDD44
EEEEE    EEE5  EEE55
FFFFF    FFF6  FFF66
BBBBB    BBB2  BBB22
AAAAA    AAA1  AAA11
DDDDD    DDD4  DDD44


SORTJNF2
----+----1----+----2----+----3----+----4----+----5
FFFFF   TEXT-F-F2  TEXT-F-F3
EEEEE   TEXT-E-F2  TEXT-E-F3
DDDDD1  TEXT-D-F2  TEXT-D-F3
CCCC    TEXT-C-F2  TEXT-C-F3
BBBBB   TEXT-B-F2  TEXT-B-F3
AAAAA   TEXT-A-F2  TEXT-A-F3


Obtained Out Put
----+----1----+----2----+----3----+----4----+----5
AAAAA    AAA1  AAA11TEXT-A-F2  TEXT-A-F3
AAAAA    AAA1  AAA11TEXT-A-F2  TEXT-A-F3
BBBBB    BBB2  BBB22TEXT-B-F2  TEXT-B-F3
BBBBB    BBB2  BBB22TEXT-B-F2  TEXT-B-F3
CCCC     CCC3  CCC33TEXT-C-F2  TEXT-C-F3
EEEEE    EEE5  EEE55TEXT-E-F2  TEXT-E-F3
FFFFF    FFF6  FFF66TEXT-F-F2  TEXT-F-F3


BUT I need out in below format, i.e., the order of records would be in the similar order of input file-1
For the above instance my expected output should be like below

Expected Out put
----+----1----+----2----+----3----+----4----+----5
AAAAA    AAA1  AAA11TEXT-A-F2  TEXT-A-F3
BBBBB    BBB2  BBB22TEXT-B-F2  TEXT-B-F3
CCCC     CCC3  CCC33TEXT-C-F2  TEXT-C-F3
EEEEE    EEE5  EEE55TEXT-E-F2  TEXT-E-F3
FFFFF    FFF6  FFF66TEXT-F-F2  TEXT-F-F3
BBBBB    BBB2  BBB22TEXT-B-F2  TEXT-B-F3
AAAAA    AAA1  AAA11TEXT-A-F2  TEXT-A-F3

Re: Problem in SORT

PostPosted: Sun Mar 11, 2012 2:09 am
by BillyBoyo
Are you saying that you want to use your key (1,7) for the join, but you then want the output file in the same order as the original SORTJNF1 input file?

You will need to append a sequence number to each record when reading the input file, then after the join sort on the sequence number, and strip it off since you will have finished with it.

What version of Syncsort are you using? Does it support a JNF1CNTL dataset for the join? Otherwise you will have to add the sequence number in a second step. The SORT and stripping-off can be done following the REFORMAT in the existing step.

Re: Problem in SORT

PostPosted: Sun Mar 11, 2012 6:40 pm
by shailaja85
Thanks a lot BillyBoyo,

I am glad to say that, now it is working fine.

Because of you and Boda3Nath and all other big shots of our forum I am confident enough to work on mainframe technologies.

Thanks Thanks a lot for all Big shots of our forum.

Re: Problem in SORT

PostPosted: Tue Mar 13, 2012 1:19 pm
by BillyBoyo
If you got the solution just from what I said and without waiting for someone to give you the code, you're doing OK.

Self-confidence is important. You've earned some.

99% of what you should be able to get out of here, is finding out how to do things for yourself. If you crack that, and believe in yourself, and accept that it is your fault when something goes wrong with what you are doing, then you will have taken a very big step.