MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SORTOUT between 2 runs differs although expected to be same
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
deepa12
Beginner


Joined: 05 Apr 2005
Posts: 131
Topics: 64
Location: chennai

PostPosted: Fri Sep 16, 2005 11:35 pm    Post subject: SORTOUT between 2 runs differs although expected to be same Reply with quote

I have made amendments to a sort step in JCL
The i/p file is LRECL=143 FB for the BASE RUN (AS IN PRODUCTION RUN)
The sort card is as below
Code:

  SORT FIELDS=(142,2,CH,A,           
               1,3,CH,A,             
               4,5,CH,A,             
               10,1,CH,A,             
               11,2,CH,A,             
               14,5,CH,A,             
               116,5,PD,D)           
  OUTREC FIELDS=(C'2',1,143)     

The i/p file to the chaned sort jcl step is FB LRECL=144
The changed card is
Quote:

SORT FIELDS=(142,3,CH,A,
1,3,CH,A,
4,5,CH,A,
10,1,CH,A,
11,2,CH,A,
14,5,CH,A,
116,5,PD,D)
OUTREC FIELDS=(C'2',1,144)


I expect the 1st 142 bytes OF THE SORTOUT of both the runs to compare equal since i the SORTIN dataset is compare equal in the 1st 141 bytes
The difference in the i/p file structures of the 2 runs is that the field @ 142 is 2 bytes in BASE & it is 3 bytes in the CHANGED JCL

The o/p shows paired changes.
So i checked the o/p for each sort card by adding the cards incrementally E.g. a run with
SORT FIELDS=(142,2,CH,A)
then
SORT FIELDS=(142,2,CH,A,
1,3,CH,A)
,etc
In this case the SORTOUT compare equal And after adding all the cards i found no difference as well. I do not understand why. Pls throw some light.
The i/p files have atleast 10000 records So i dont know if i can ZIP & ATTACH in this forum
_________________
deepa
Back to top
View user's profile Send private message Send e-mail
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Sat Sep 17, 2005 12:05 am    Post subject: Reply with quote

Deepa,

I hope you are comparing the outputs of the following
1.
Code:

  SORT FIELDS=(142,2,CH,A....)


AND

2.
Code:

  SORT FIELDS=(142,3,CH,A....)


There is a high possibility of differences listed out during this comparison. It all depends upon the contents of your 144th Column in the input file. If they are same for all 10,000 odd records then there should be no differences listed out in your comparison.

Though you say there should be no impact on the first 142 bytes, you will DEFINITELY find some differences if your 144th byte changes. This is because the records will be arranged in different order by SORT FIELDS command. I would like to know what kind of comparison you are using SUPERC / SORT / FILEAID / COMPAREX ???

Pls post your comparison JCL. If you use ISPF's COMPARE in edit/view mode then you will definitely find differences due to the order in which records are grouped.

Thanks,
Phantom
Back to top
View user's profile Send private message
deepa12
Beginner


Joined: 05 Apr 2005
Posts: 131
Topics: 64
Location: chennai

PostPosted: Sun Sep 18, 2005 5:17 am    Post subject: Reply with quote

Am using the below compare for the o/p
And am comparing only the 1st 142 bytes of the o/p
I have ignored the expanded field at 142 position

//COMPRE1 EXEC PGM=INSYNC,PARM=MVS
//STEPLIB DD DISP=SHR,DSN=OEML.INSYNC.LOADLIB
//#ELIBDD DD DISP=SHR,DSN=NULLFILE ... OVERRIDE REQD
//SYSTSPRT DD SYSOUT=*
//#LOG DD SYSOUT=*
//#PRINT DD SYSOUT=*
//#INDD1 DD DISP=SHR,DSN=XU33.MHT.MHRCFDTS.SORTEDB.REGR.CLONE
//#INDD2 DD DISP=SHR,DSN=XU33.MHT.MHRCFDTS.SORTEDB.BASE.CLONE
//#PARM DD *
FUNCTION=COMPARE
INDD1=#INDD1
INDD2=#INDD2
MASK=(143,3)
//*

Pls help me
Shall i put the extract of the i/p files in REDIFF & SHARE IT WITH SOME ONE
_________________
deepa
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sun Sep 18, 2005 9:10 am    Post subject: Reply with quote

Quote:

I expect the 1st 142 bytes OF THE SORTOUT of both the runs to compare equal since i the SORTIN dataset is compare equal in the 1st 141 bytes


Not True.

Let me explain with an example.
Code:

//STEP010 EXEC  PGM=SORT 
//SYSOUT  DD SYSOUT=*     
//SORTIN  DD *           
A11                     
A9                       
AB0                     
//SORTOUT DD SYSOUT=*     
 SORT FIELDS=(1,2,CH,A)   
/*

The output is

Code:

A11
A9
AB0


Code:

//STEP010 EXEC  PGM=SORT 
//SYSOUT  DD SYSOUT=*     
//SORTIN  DD *           
A11                     
A9                       
AB0                     
//SORTOUT DD SYSOUT=*     
 SORT FIELDS=(1,3,CH,A)   
/*


The output now is :
Code:

AB0
A11
A9


Did you see the difference now?

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
deepa12
Beginner


Joined: 05 Apr 2005
Posts: 131
Topics: 64
Location: chennai

PostPosted: Sun Sep 18, 2005 9:55 am    Post subject: Reply with quote

Sorry ...I forgot to tell you 1 whole big thing. At 142nd byte the expanded field in the 2nd run contains only 0 prefix i.e the BASE jcl sortin file is expanded at 142nd position with a 0 prefix to make 3 byte field for the changed jcls SORTIN
That is why i expect that the SORTED O/P should also come in the same order
_________________
deepa
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sun Sep 18, 2005 10:23 am    Post subject: Reply with quote

deepa12,

In your first post you said

Code:

The i/p file is LRECL=143 FB for the BASE RUN (AS IN PRODUCTION RUN)


And your control cards are

Code:

SORT FIELDS=(142,2,CH,A,
..


i.e you are sorting on the last 2 bytes of the file i.e 142 and 143.

Code:

The i/p file to the chaned sort jcl step is FB LRECL=144


And your control cards are

Code:

SORT FIELDS=(142,3,CH,A,
..


Now you are sorting on the last 3 bytes of the file 142,143 and 144 which is not present in the first run file.


Now if you compare those 2 files they wouldn't be the same.

See my example posted above. Imagine that the 3rd byte does not exist for the old file. Since we are sorting on the first 2 bytes it does not matter what the 3rd byte is.

Try this and see if it works
Code:

  SORT FIELDS=(142,2,CH,A,             
               1,3,CH,A,             
               4,5,CH,A,             
               10,1,CH,A,             
               11,2,CH,A,             
               14,5,CH,A,             
               116,5,PD,D,
               144,1,CH,A)  <=== new field
  OUTREC FIELDS=(C'2',1,144)


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
deepa12
Beginner


Joined: 05 Apr 2005
Posts: 131
Topics: 64
Location: chennai

PostPosted: Sun Sep 18, 2005 1:55 pm    Post subject: Reply with quote

i compared th1 1:141 bytes of the SORTIN files. I did not compare the 142,2 or 142,3 of both the files
_________________
deepa
Back to top
View user's profile Send private message Send e-mail
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Sun Sep 18, 2005 2:55 pm    Post subject: Reply with quote

I don't understand your 1st example. I ran it both ways (lengths 2 and 3) and got the same answer (2nd output as expected). What was this supposed to show and why did I get a different answer? Why would numerics ever sort before alpahabetics (w/o a specific collating sequence)?
Back to top
View user's profile Send private message Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sun Sep 18, 2005 4:46 pm    Post subject: Reply with quote

Quote:

i compared th1 1:141 bytes of the SORTIN files. I did not compare the 142,2 or 142,3 of both the files


deepa12,

It doesn't matter if you compared only 141 bytes, the order would definitely change.

semigeezer,

Was your question for me?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Sun Sep 18, 2005 8:23 pm    Post subject: Reply with quote

Yes. I'm just not that familiar w/ sort, but my runs of your 1st examples both gave the same result.
Back to top
View user's profile Send private message Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sun Sep 18, 2005 10:15 pm    Post subject: Reply with quote

Quote:

I'm just not that familiar w/ sort, but my runs of your 1st examples both gave the same result.


hmm that is strange. Can you run the following job and post the results?

Code:

//STEP0100 EXEC PGM=ICETOOL 
//TOOLMSG   DD SYSOUT=*       
//DFSMSG    DD SYSOUT=*       
//OUT       DD SYSOUT=*       
//TOOLIN    DD *               
  DEFAULTS LIST(OUT)           
/*         


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Sun Sep 18, 2005 11:53 pm    Post subject: Reply with quote

Code:
1Z/OS DFSORT V1R5 INSTALLATION (ICEMAC) DEFAULTS      - 1 -
    * IBM-SUPPLIED DEFAULT (ONLY SHOWN IF DIFFERENT FROM THE SPECIFIED DEFAULT)
 ITEM           JCL (ICEAM1)             INV (ICEAM2)             TSO (ICEAM3)             TSOINV (ICEAM4)
 ----------     --------------------     --------------------     --------------------     --------------------
 RELEASE        V1R5                     V1R5                     V1R5                     V1R5
 MODULE         ICEAM1                   ICEAM2                   ICEAM3                   ICEAM4
 APAR LEVEL     BASE                     BASE                     BASE                     BASE
 COMPILED       07/21/03                 07/21/03                 07/21/03                 07/21/03
 ENABLE         NONE                     NONE                     NONE                     NONE
 ABCODE         MSG                      MSG                      MSG                      MSG
 ALTSEQ         SEE BELOW                SEE BELOW                SEE BELOW                SEE BELOW
 ARESALL        0                        0                        0                        0
 ARESINV        NOT APPLICABLE           0                        NOT APPLICABLE           0
 CFW            YES                      YES                      YES                      YES
 CHALT          NO                       NO                       NO                       NO
 CHECK          YES                      YES                      YES                      YES
 CINV           YES                      YES                      YES                      YES
 COBEXIT        COB2                     COB2                     COB2                     COB2
 DIAGSIM        NO                       NO                       NO                       NO
 DSA            64                       64                       64                       64
 DSPSIZE        MAX                      MAX                      MAX                      MAX
 DYNALOC        (SYSDA,4)                (SYSDA,4)                (SYSDA,4)                (SYSDA,4)
 DYNAUTO        YES                      YES                      YES                      YES
 DYNSPC         256                      256                      256                      256
 EFS            NONE                     NONE                     NONE                     NONE
 EQUALS         VLBLKSET                 VLBLKSET                 VLBLKSET                 VLBLKSET
 ERET           RC16                     RC16                     RC16                     RC16
 ESTAE          YES                      YES                      YES                      YES
 EXITCK         STRONG                   STRONG                   STRONG                   STRONG
 EXPMAX         MAX                      MAX                      MAX                      MAX
 EXPOLD         MAX                      MAX                      MAX                      MAX
 EXPRES         0                        0                        0                        0
 FSZEST         NO                       NO                       NO                       NO
 GENER          NOT APPLICABLE           IEBGENR                  NOT APPLICABLE           IEBGENR
 GNPAD          NOT APPLICABLE           RC0                      NOT APPLICABLE           RC0
 GNTRUNC        NOT APPLICABLE           RC0                      NOT APPLICABLE           RC0
 HIPRMAX        OPTIMAL                  OPTIMAL                  OPTIMAL                  OPTIMAL
 IDRCPCT        NONE                     NONE                     NONE                     NONE
 IEXIT          NO                       NO                       NO                       NO
 IGNCKPT        YES                      YES                      YES                      YES
 IOMAXBF        33554432                 33554432                 33554432                 33554432
 LIST           YES                      YES                      YES                      YES
 LISTX          YES                      YES                      YES                      YES
 LOCALE         NONE                     NONE                     NONE                     NONE
 MAXLIM         1048576                  1048576                  1048576                  1048576
 MINLIM         450560                   450560                   450560                   450560
 MOSIZE         MAX                      MAX                      MAX                      MAX
 MSGCON         NONE                     NONE                     NONE                     NONE
 MSGDDN         SYSOUT                   SYSOUT                   SYSOUT                   SYSOUT
 MSGPRT         ALL                      ALL                      ALL                      ALL
 NOMSGDD        QUIT                     QUIT                     QUIT                     QUIT
 NULLOFL        RC0                      RC0                      RC0                      RC0
 NULLOUT        RC0                      RC0                      RC0                      RC0
 ODMAXBF        2097152                  2097152                  2097152                  2097152
 OUTREL         YES                      YES                      YES                      YES
 OUTSEC         YES                      YES                      YES                      YES
 OVERRGN        65536                    16384                    65536                    16384
 OVFLO          RC0                      RC0                      RC0                      RC0
 PAD            RC0                      RC0                      RC0                      RC0
 PARMDDN        DFSPARM                  DFSPARM                  DFSPARM                  DFSPARM
 RESALL         4096                     4096                     4096                     4096
 RESET          YES                      YES                      YES                      YES
 RESINV         NOT APPLICABLE           0                        NOT APPLICABLE           0
 SDB            INPUT                    INPUT                    INPUT                    INPUT
 SDBMSG         NO                       NO                       NO                       NO
 SIZE           MAX                      MAX                      MAX                      MAX
 SMF            NO                       NO                       NO                       NO
 SOLRF          YES                      YES                      YES                      YES
 SORTLIB        PRIVATE                  PRIVATE                  PRIVATE                  PRIVATE
 SPANINC        RC16                     RC16                     RC16                     RC16
 STIMER         YES                      YES                      YES                      YES
 SVC            109                      109                      109                      109
 SZERO          YES                      YES                      YES                      YES
 TEXIT          NO                       NO                       NO                       NO
 TMAXLIM        6291456                  6291456                  6291456                  6291456
 TRUNC          RC0                      RC0                      RC0                      RC0
 VERIFY         NO                       NO                       NO                       NO
 VIO            NO                       NO                       NO                       NO
 VLLONG         NO                       NO                       NO                       NO
 VLSCMP         NO                       NO                       NO                       NO
 VLSHRT         NO                       NO                       NO                       NO
 VSAMBSP        OPTIMAL                  OPTIMAL                  OPTIMAL                  OPTIMAL
 VSAMEMT        YES                      YES                      YES                      YES
 VSAMIO         NO                       NO                       NO                       NO
 WRKREL         YES                      YES                      YES                      YES
 WRKSEC         YES                      YES                      YES                      YES
 Y2PAST         80                       80                       80                       80
 ZDPRINT        YES                      YES                      YES                      YES
 ICEAM1 ALTSEQ TABLE:  SAME AS IBM-SUPPLIED ALTSEQ TABLE BELOW
 ICEAM2 ALTSEQ TABLE:  SAME AS IBM-SUPPLIED ALTSEQ TABLE BELOW
 ICEAM3 ALTSEQ TABLE:  SAME AS IBM-SUPPLIED ALTSEQ TABLE BELOW
 ICEAM4 ALTSEQ TABLE:  SAME AS IBM-SUPPLIED ALTSEQ TABLE BELOW
 IBM-SUPPLIED ALTSEQ TABLE (IN HEXADECIMAL):
   00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
   20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
   40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
   60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
   80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
   A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
   C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
   E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
and
Code:
//STEP1   EXEC  PGM=SORT
//SYSOUT  DD DUMMY
//SORTIN  DD *
A11
A9
AB0
//SORTOUT DD SYSOUT=H
 SORT FIELDS=(1,2,CH,A)
/*
//STEP2   EXEC  PGM=SORT
//SYSOUT  DD DUMMY
//SORTIN  DD *
A11
A9
AB0
//SORTOUT DD SYSOUT=H
 SORT FIELDS=(1,3,CH,A)
/*
produces (results of both steps shown separated by 1 line):
Code:
AB0
A11
A9

AB0
A11
A9

I just don't see why one would expect it to be anything else. My reading of CH was that it is just a straight bitwise sort in this case. Or did I just misread something?
Back to top
View user's profile Send private message Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Sep 19, 2005 12:16 am    Post subject: Reply with quote

Kolusu & Semigeezer,

My output was same as what Semigeezer's in both cases (1,2 and 1,3).

I think your SORTIN is not good enough to highlight the difference b/w sorting first 2 columns and sorting first 3 columns. Lets go through the sample data you used in SORTIN.

Code:

A11
A9
AB0


In this example,
1. First character 'A' is same across all three rows. So, this would not make any difference during sorting.

2. Look at the second character. They are all different ('1', '9' & 'B'). Irrespective of whether you issue 1,2,CH,A or 1,3,CH,A, the sort order is first determined by the second character and only after that does the third character come into picture.

Now that 'B' < '1' as per EBCIDIC sequence, AB0 comes first, followed by A11 and then comes A9.

If you really want to see the difference due to the third character, you need to have an example like this.
Code:

A11
A19
A10
A14
AB0
AB9
AB7
AB4
A9
A8


Now the output of 1,2,CH,A would be (Note: you have OPTION EQUALS enabled by default which would retain the order of duplicates as it is in input).
Code:

AB0
AB9
AB7
AB4
A11
A19
A10
A14
A8
A9


and 1,3,CH,A would result in this:
Code:

AB0
AB4
AB7
AB9
A10
A11
A14
A19
A8
A9


Please try and let me know if you get different output.

Thanks,
Phantom
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Sep 19, 2005 7:56 am    Post subject: Reply with quote

Semigeezer,

My bad. I actually had the data starting at pos 2 instead of position 1 and hence the wrong the results. Sorry about that. Once I corrected that both outputs are the same.

As phantom pointed out , my test wasn't enough to prove that sorting on an additonal byte would make a difference to the results.

Thanks

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Mon Sep 19, 2005 10:12 am    Post subject: Reply with quote

Oh. OK. I wondered about that, but wasn't sure. But I've see you do some pretty amazing things w/ SORT so I'm not one to second guess you Smile
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group