SYNSORT_PLEASE ASSIST



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

SYNSORT_PLEASE ASSIST

Postby dash123 » Thu Nov 03, 2011 12:49 am

LRECL=80 and input file has following record structure


XXXXXXX.TEST.SORTIN3
----+----1----+----2----+---
1400000109112100002816
1400400109112100002815
1400100109112200002816
1400300109112200002816
1400200109112100002815



Following SORT card used

//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(11,4,CH,EQ,C'1121'),
BUILD=(1,80))
/*



Job sucessfully submitted with return code ZERO but REQUIRED RECORDS DO NOT POPULATED IN OUTPUT FILE

Desired output file should have 3 records. record 1, 2, 5

But in output file all the 5 records from input file appears as such.


Spool Message
-------------
SYNCSMF CALLED BY SYNCSORT; RC=0000

SYNSORT version used in our installation --> RELEASE 1.3 BATCH 0506 TPF LEVEL 2.1


Please assist.
dash123
 
Posts: 8
Joined: Wed Nov 02, 2011 5:42 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SYNSORT_PLEASE ASSIST

Postby enrico-sorichetti » Thu Nov 03, 2011 1:12 am

why not use a simple INCLUDE/OMIT without complicating things with the BUILD ???
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: SYNSORT_PLEASE ASSIST

Postby Akatsukami » Thu Nov 03, 2011 1:22 am

OUTFIL reformats records after they have been sorted...and since you specified
SORT FIELDS=COPY

that selects all the records. You want to use an INCLUDE card, viz.
INCLUDE COND=(11,4,CH,EQ,C'1121')
"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: SYNSORT_PLEASE ASSIST

Postby dash123 » Thu Nov 03, 2011 8:03 pm

Thank you all for your valuable suggestions.

But as my above post is a part of a larger requirement as mentioned below, usage IF-THEN-ELSE might be required.

Requirement
---------------

Input file-1 (LRECL=80)
---------------------------

XXXXXXX.TEST.SORTIN1
----+----1----+----2--
1400400109110000002815
1400100109110000002816
1400300109112200002816
1400200109112100002815

1402000109110000002815
1402100109110000002815




Input file-2 (LRECL=80)
---------------------------

IA0123A.TEST.SORTIN2
----+----1----+----2--
1400100109110000002815
1400200109112100002815
1400300109112200002815
1400400109110000002815

1401000109110000002815
1401100109110000002815



Requirement
---------------
Above 2 input files are to be compared and 2 output files are to be created after matched by a key field
Output file 1 need to include matched records from input file 1

Further,

Output file 1 need to include records having either '1121' / '1122' at 11-14 column of input file 1
Output file 2 need to include remaining records of input file 1


SORT CARD
-------------
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(1,5,A)
JOINKEYS FILES=F2,FIELDS=(1,5,A)
REFORMAT FIELDS(F1:1,80,F2:81,80)
JOIN UNPAIRED,F1,F2
SORT FIELDS=COPY
OUTFIL FILES=1,
INCLUDE=(1,5,CH,EQ,81,5,CH,AND,
(11,4,CH,EQ,C'1121',OR,11,4,CH,EQ,C'1122')),OUTREC=(1,80)
OUTFIL FILES=2,
INCLUDE=(1,5,CH,EQ,81,5,CH,AND,
(11,4,CH,NE,C'1121',OR,11,4,CH,NE,C'1122')),OUTREC=(1,80)
/*


XXXXXXX.TEST.SORTOUT1
----+----1----+----2--
1400200109112100002815
1400300109112200002816


XXXXXXX.TEST.SORTOUT2
----+----1----+----2--
1400100109110000002816
1400200109112100002815
1400300109112200002816
1400400109110000002815



Improvements required
---------------------------
(1) In output file 2, as ELSE part, required records with keys are 14001,14004,14020,14021
but current population : records with keys 14001,14002,14003,14004

So, Please suggest how to get above 4 desired records in output file 2.


(2) Matching of records between 2 input files (=> 9,10,CH,EQ,201,10,CH) is done twice
but matching need to be done once to improve efficiency of code and
this will happen when processing of both output files are joined by IF-THEN-ELSE CONDITION

So, Please suggest how to achieve this using IF-THEN-ELSE in OUTFIL.


Thanks in advance.
dash123
 
Posts: 8
Joined: Wed Nov 02, 2011 5:42 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SYNSORT_PLEASE ASSIST

Postby enrico-sorichetti » Thu Nov 03, 2011 8:37 pm

But as my above post is a part of a larger requirement as mentioned below, usage IF-THEN-ELSE might be required.


if You have decided that IF-THEN-ELSE might be required why waste everybody' s time asking useless questions ? :evil:
You posted a question , we gave You a good answer period

When You ask You should be ready to accept the replies You get, and not whine that what You received is not what you expected.

also good manners dictate that the whole requirement be posted to start with, in order that people would not waste time testing partial solutions.
YES... You might not care about it , but usually people test their replies and code snippets when answering


So, Please suggest how to achieve this using IF-THEN-ELSE in OUTFIL.

stupid begging ,
people replying will give a working solution using the best constructs suited/needed for the task at hand
not those You imagine or feel .
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: SYNSORT_PLEASE ASSIST

Postby dash123 » Fri Nov 04, 2011 8:01 am

Hi Enrico,

<< stupid begging >>

Don't you know good manner to talk in public forum ?

Your whole bllaaa... talk is no less than arrogant/offensive gossiping in this elite forum !

Coming to SORT issue, if you read, you can understand, suggestions are required on ELSE part of SORT logic.

If any thing not clear, kindly let me know.

Plainly speaking, if you know or if you can, then reply. Your suggestions will be highly appreciated.

Else,if don't know, then keep quiet and kindly don't use arrogant/offensive words in this forum anymore.

Thanks.
dash123
 
Posts: 8
Joined: Wed Nov 02, 2011 5:42 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SYNSORT_PLEASE ASSIST

Postby NicC » Fri Nov 04, 2011 1:00 pm

dash123

You should talk! Your requirement is completely different to what you originally posted thus wasting people's time - time that is given voluntarily and without charge to you or payment to them. If you check other posts by Enrico you will see that he calls a spade a spade, does not beat around the bush and knows what he is talking about.
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: SYNSORT_PLEASE ASSIST

Postby enrico-sorichetti » Fri Nov 04, 2011 1:37 pm

I wonder why people who pretend to belong to the elite ( TS opinion, not mine :geek: )
have so many issues handling simple logic predicates

Output file 1 need to include records having either '1121' / '1122' at 11-14 column of input file 1
Output file 2 need to include remaining records of input file 1


if... to determine the elements which belong to a (sub)set you apply a logic selection predicate
then ... to determine the elements which do not belong to the same (sub)set You must apply the <inverse> logic selection predicate

and from the TS include constructs ....
the 2nd predicate .... (1,5,CH,EQ,81,5,CH,AND, (11,4,CH,NE,C'1121',OR,11,4,CH,NE,C'1122'))
is not the <inverse> of the first one .... (1,5,CH,EQ,81,5,CH,AND, (11,4,CH,EQ,C'1121',OR,11,4,CH,EQ,C'1122'))
what about (1,5,CH,EQ,81,5,CH,AND, (11,4,CH,NE,C'1121',AND,11,4,CH,NE,C'1122'))

I used the (sub)set construct because 1,5,CH,EQ,81,5,CH is a straight inclusion for both predicates and does not influence the include/exclude logic for the rest

going thru many posts dealing with include/exclude logic with multiple conditions I see that this is the most common error
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: SYNSORT_PLEASE ASSIST

Postby BillyBoyo » Fri Nov 04, 2011 3:51 pm

Dash,

It may have been your faultless mistake, but you didn't provide all the information up front. Simple, dumb, faultless, mistake. Could have happened to anyone who is not systematic in their thinking. You have to work on that. You have to accept your mistakes, because you made them, and with a computer there is no way of hiding them (same input, computer produces the same result - you can't whine that the wind was blowing the wrong way at the time).

Until you accept your mistakes, you won't get genuinely far in this business. When anything you have written goes wrong, your first thought must always be "how the heck did I screw that up?". Then you find out exactly how. Then you know not to repeat the mistake.

Another thing you need to learn is that clarity and maintainability are ususally more important than performance.

If performance is important for this particular sort because of the size of the files we have no way of knowing that without you telling us. If the size of your files indicates the unlikelihood of a performance issue (saving 0.1% of CPU on a five-minute-elapsed job is never likely to be much use) then you should be able to work out that there are things more important than performance.

It is always worth considering the order of things for your conditions in a sort. It is horribly common to see "it's the first field, so I'm putting it first". What I like to see is the most logical relating to the business requirement coming first. [b]Unless[/b] there is some big performance reason otherwise. Opposite of what you seem to think?

I would always get rid of what I don't want as soon as possible.

To me, it is absurd to process the whole file, to try to allow for some "ELSE", for some "performance" reason.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: SYNSORT_PLEASE ASSIST

Postby dash123 » Fri Nov 04, 2011 5:21 pm

Hi Enrico,

Thanks for your valuable suggestion on first requirement.

Still I need suggestion, on second requirement, as mentioned above in my post.

Here for both the output files, we are doing same processing (1,5,CH,EQ,81,5,CH).

To increase efficiency of code, I need to do the above processing once, still get the same result in both output file.

Please suggest how it can be achieved.

I tried using IF=THEN but the IF=THEN construct itself not working for my SYNSORT. (Please refer my top most post)

Is there any way we can achieve this ?

Thanks.
dash123
 
Posts: 8
Joined: Wed Nov 02, 2011 5:42 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Syncsort/Synctool