SyncSort - Inserting Sequence Number



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

SyncSort - Inserting Sequence Number

Postby tivrfoa » Wed Jan 02, 2013 6:13 pm

Hi, happy new year everyone.

I'm following DFSORT tutorial. I have this dataset:
COMPUTER LANGUAGES MURRAY ROBERT FERN COMP 561
LIVING WELL ON A SMALL BUDGET DEWAN FRANK COR 108
...

The problem is that SEQNUM is get "aleatory" occurrence and not the first occurrence.
Like, the first occurence for COMP should be 00000001, but I'm getting 00000009 instead.

//SYSIN    DD *

  INREC FIELDS=(01:57,05,X,63,04,UFF,EDIT=(TTTTT),SEQNUM,8,ZD)
  SORT  FIELDS=(01,05,CH,A)
  SUM   FIELDS=(08,04,ZD)

/*


Thanks folks.
tivrfoa
 
Posts: 84
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 60 times
Been thanked: 0 time

Re: SyncSort - Inserting Sequence Number

Postby BillyBoyo » Wed Jan 02, 2013 7:05 pm

You are adding a sequence number to the unsorted data. The record which appears first, is that which has the lowest "collating" value for columns one to five (57,5 on your input). If that happens to be the ninth record on your input file, then you will get nine as your first sequence number.

If you want sequence numbers on the output, in number order, change INREC to OUTREC, which will also only process records after the SUM has operated and removed any duplicates.

These users thanked the author BillyBoyo for the post:
tivrfoa (Wed Jan 02, 2013 8:48 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: SyncSort - Inserting Sequence Number

Postby NicC » Wed Jan 02, 2013 8:54 pm

Why do you think that there is a section of the forum entitled Syncsort/Synctool? Just so that you could ignore it? Both topics moved.

Also note that DFSort is NOT the same as Syncsort although there is a high degree of compatability.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: SyncSort - Inserting Sequence Number

Postby tivrfoa » Wed Jan 02, 2013 8:59 pm

ops xD sorry NicC. I didn't even look, because I was reading a topic in DFSORT and the question was about Syncsort and the moderator replied to post Syncsort questions in the JCL forum ...
BillyBoyo wrote:You are adding a sequence number to the unsorted data. The record which appears first, is that which has the lowest "collating" value for columns one to five (57,5 on your input). If that happens to be the ninth record on your input file, then you will get nine as your first sequence number.

Hi. Lowest "collating"? I don't understand, because this is the field that I'm using to group by the sum and sorting, so the value in the first and ninth records are the same:
First: 000001 COMPUTER LANGUAGES MURRAY ROBERT FERN COMP 561
Ninth: 000009 NUMBERING SYSTEMS BAYLESS WILLIAM FERN COMP 486

Thank you.
tivrfoa
 
Posts: 84
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 60 times
Been thanked: 0 time

Re: SyncSort - Inserting Sequence Number

Postby Akatsukami » Wed Jan 02, 2013 9:15 pm

tivrfoa wrote:Hi. Lowest "collating"? I don't understand

Collation.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: SyncSort - Inserting Sequence Number

Postby tivrfoa » Wed Jan 02, 2013 9:25 pm

Akatsukami wrote:
tivrfoa wrote:Hi. Lowest "collating"? I don't understand

Collation.

Hi, thanks, but did you stop reading in the word "understand"? How does the link help here?
tivrfoa
 
Posts: 84
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 60 times
Been thanked: 0 time

Re: SyncSort - Inserting Sequence Number

Postby BillyBoyo » Wed Jan 02, 2013 9:46 pm

tivrfoa,

Sit down with a SyncSort manual. Find the place where it shows a diagram of how the different parts (ie INREC, SORT, SUM, OUTREC, OUTFIL) relate to each other.

What did you not understand? You are putting the sequence numbers on the unsorted data. Then SORTing the data. Then you SUM the data, which will consolidate records with equal keys, using the first record of that key from the output of the SORT.

Now, what were you expecting? Sequence number one for the first output record? Well, if the data has the lowest key in the collating sequence as the first record, and that particular key is not duplicate, then your first output record will be one. The second will likely not be two, however.

Also look at EQUALS and NOEQUALS to with regards to how SUM works.

If you don't give enough information to give a definitive answer, then you have little expectation to be able to quibble about what any comment that anyone makes.

These users thanked the author BillyBoyo for the post:
tivrfoa (Wed Jan 02, 2013 9:56 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: SyncSort - Inserting Sequence Number

Postby tivrfoa » Wed Jan 02, 2013 10:07 pm

BillyBoyo wrote:What did you not understand? You are putting the sequence numbers on the unsorted data.

The first record in the input dataset is:
000001 COMPUTER LANGUAGES MURRAY ROBERT FERN COMP 561
But it is giving a sequence number of the second occurence, which in this case is line nine:
000009 NUMBERING SYSTEMS BAYLESS WILLIAM FERN COMP 486
BillyBoyo wrote: Now, what were you expecting? Sequence number one for the first output record?

I was expecting the sequence number for COMP to be 00000001 instead of 00000009.
I understand that the first output record will have a sequence number that corresponds to its first occurence in the input dataset.
tivrfoa
 
Posts: 84
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 60 times
Been thanked: 0 time

Re: SyncSort - Inserting Sequence Number

Postby BillyBoyo » Wed Jan 02, 2013 10:15 pm

You are not putting a sequence number on the output data.

KEY1 00000001
KEY2 00000002
KEY1 00000003
KEY3 00000001


When you SORT, with equal keys, the order of your output depends on EQUALS/NOEQUALS. You have SUM, which also will give potentially different results depending on EQUALS/NOEQUALS.

Unless you are specific about what you want, that's about it. You are numbering on the input, sorting, and then wondering why you don't get your output in number sequence. You have put the sequence numbers on the unsorted data, then SORT it - how would you expect the sequence numbers to be in order? Then, within the same key, you have not bothered to look up EQUALS/NOEQUALS.

If you're not going to explain what you want, clearly and fully, and you're not going to take advice, then I'm not sure how we can help.

These users thanked the author BillyBoyo for the post:
tivrfoa (Wed Jan 02, 2013 10:33 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: SyncSort - Inserting Sequence Number

Postby dick scherrer » Wed Jan 02, 2013 10:28 pm

Hello,

Suggesst you post the first 15 records (using the Code tag andleaving out the "bold" and the "first: / ninth:" designation and the output you want when the process is run (again with the Code tag). Use the Preview function to see your post as it will appear to the forum and when it looks as you wish, Submit.
Hope this helps,
d.sch.

These users thanked the author dick scherrer for the post:
tivrfoa (Wed Jan 02, 2013 10:34 pm)
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post