Page 1 of 2

Clarification Needed in Sorting

PostPosted: Thu Oct 04, 2012 6:31 pm
by gowthamgyaa
Hi everyone,
I tried a SORT utility sorting has been done successfully but when i use sum fields i need some clarification. I'l provide you the statement below

//JOB STATEMENT
//STEPS EXEC PROG=SORT
//SYSPRINT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSUT1 DD DSN=******.FINANCE.EMP,DISP=OLD
//SYSIN DD *
    SORT FIELDS=(4,2,CH,D)
    SUM FIELDS=(9,4,ZD)
/*
//



Record's in Finance.Emp
001 cse 1005
002 ece 1111
008 mec 1007
014 cse 1222
0777 aaa 1453
088 sss 1000
015 mmm 1005


Sortout
...
015 MMM 2012
..
..
..


For everyother things i got the sum fields correct, only to mmm i got 2012 , so what may be the prob. in this?

Kindly provide me a details

kind regard's
gyaa

Re: Clarification Needed in Sorting

PostPosted: Thu Oct 04, 2012 6:40 pm
by BillyBoyo
You have sorted on 4,2. Which is a blank, followed by three characters. Which means MMM and MEC get summed togther.

Re: Clarification Needed in Sorting

PostPosted: Thu Oct 04, 2012 7:07 pm
by gowthamgyaa
@Billy,
I am terribly sorry billy , the sort field's are (5,2,ch,D)
I also tried with sort fields (5,3,ch,D) but got the same results for both.
In my point of view ,as for with my novice knowledge i think the 2nd character in both mec and mmm are varying so it cant sum those two field's.
If any Mistakes in my thought kindly pardon me and guide me to a detailed explanation


Kind regard's
gyaa

Re: Clarification Needed in Sorting

PostPosted: Thu Oct 04, 2012 7:19 pm
by NicC
This is a sort question. Why are you posting in the JCL section? There are 2 sort sections - one for DFSORT and one for SYNCSORT. Which one are you using? SORT is NOT a valid answer. Check your SYSOUT messages - those beginning ICE are DFSORT and those beginning WER are SYNCSORT.

Re: Clarification Needed in Sorting

PostPosted: Thu Oct 04, 2012 7:27 pm
by gowthamgyaa
@ Nic,
pardon me Nic, as am a beginner i do no about what you said, i'l correct myself.


Kind regard's
gyaa

Re: Clarification Needed in Sorting

PostPosted: Thu Oct 04, 2012 7:32 pm
by NicC
What did you not understand? SYSOUT? Do you not recognise it as a DDNMAE from your job? It has messages written to it by the sort program. Read those messages. You do not actually need to check the message identifiers as one of the first lines will say which product it is.

Re: Clarification Needed in Sorting

PostPosted: Thu Oct 04, 2012 8:05 pm
by gowthamgyaa
@Nicc,
I understand about sysout, but i dint understand whats the relation with my SUMFIELD error & Types of sorting?

Kind regard's,
gyaa

Re: Clarification Needed in Sorting

PostPosted: Thu Oct 04, 2012 8:12 pm
by NicC
Because you are posting in the JCL part of the forum when you should be posting in one of the Sort sections. Tell me which sort product you are using and I will move the topic to the right place.

Re: Clarification Needed in Sorting

PostPosted: Thu Oct 04, 2012 8:23 pm
by gowthamgyaa
@Nicc,
Am using DFsort .


Kind regards
gyaa

Re: Clarification Needed in Sorting

PostPosted: Thu Oct 04, 2012 8:31 pm
by NicC
Thank you - topic moved. Just remember: JCL is a language and has all those pesky // at the start of each line - sometimes /* and sometimes //*. To refer to anything else as JCL is a no-no no matter what your instructor or future colleagues say.