how to get the summation using dfsort?...



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

how to get the summation using dfsort?...

Postby mainframemunic » Sat Dec 10, 2011 3:49 pm

000100 //xxxxxxx JOB NOTIFY=&SYSUID,MSGCLASS=A,MSGLEVEL=(1,1)
000200 //STEP1 EXEC PGM=SORT
000500 //SORTIN DD DSN=xxxxxxx.PANDS.NO1,DISP=SHR
000501 //SYSOUT DD SYSOUT=*
000510 //SYSPRINT DD SYSOUT=*
000600 //SORTXSUM DD DSN=xxxxxxx.PANDS.NO2,DISP=SHR
000610 //SORTOUT DD DSN=xxxxxxxx.PANDS.NO3,DISP=SHR
000700 //*SORTWK01 DD UNIT=SYSDA,SPACE=(TRK,(10,10),RLSE)
000800 //*SORTWK02 DD UNIT=SYSDA,SPACE=(TRK,(10,10),RLSE)
000900 //SYSIN DD *
001000 SORT FIELDS=(1,3,CH,A)
001120 SUM FIELDS=(11,5,ZD)
001200 /*
001300 //
the above program in jcl for sorting and adding the datas.
below given is my input file format.
000100 GOPISDFNN 10000
000200 XFCVFDGA 20000
000300 MOOSANISAR 30000
000400 SIVAGOPI 50000
000500 GOPINATH 80000
000600 PERCYBLK 93000
in the above input file i need to sum the ZD values and the output should be sent to sortxsum ddname...but the problem is i'm not getting the output of added values but the files are sorted.please tel how to solve this.............
mainframemunic
 
Posts: 15
Joined: Thu Dec 01, 2011 1:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to get the summation using dfsort?...

 

Re: how to get the summation using dfsort?...

Postby BillyBoyo » Sat Dec 10, 2011 4:12 pm

Refer to your documentation to understand what the SORTXSUM ddname is.

I don't know what you are trying to sum, 11 as a start position looks not even close, but the result should be in SORTOUT where you should find one record that looks a bit odd. Post that record here.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: how to get the summation using dfsort?...

Postby NicC » Sat Dec 10, 2011 9:21 pm

If you are using DFSORT why are you posting in the JCL section of the forum? What do you think the DFSORT and SYNCSORT sections are for? Also, as mentioned in your other post re JCL in the COBOL forum - use code tags. The editor strips multiple spaces leaving things unaligned. Using the code tags allows the data etc to be displayed correctly.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: how to get the summation using dfsort?...

Postby Frank Yaeger » Sat Dec 10, 2011 10:35 pm

SORTOUT is used for the output of your job, not SORTXSUM.

SUM gives a separate sum for each key. Since you don't have any duplicate keys you will not get any summing. If you just want a total of all of the values, use a DFSORT job like the following:

//S1 EXEC PGM=SORT
//SORTIN DD DSN=...  input file
//SYSOUT DD DSN=...  output file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    TRAILER1=(TOT=(11,5,ZD,TO=ZD,LENGTH=6))
/*


If that doesn't give you what you want, then you need to do a better job of explaining and showing what you do want.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: how to get the summation using dfsort?...

Postby mainframemunic » Mon Dec 12, 2011 10:16 am

please explain the above the example.. briefly
mainframemunic
 
Posts: 15
Joined: Thu Dec 01, 2011 1:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to get the summation using dfsort?...

Postby dick scherrer » Mon Dec 12, 2011 10:34 am

Hello,

OPTION COPY - this will be a copy operation (rather than a sort or something else)

OUTFIL REMOVECC,NODETAIL, - Remove the carriage control (cc) from the output and write no detail data.

TRAILER1=(TOT=(11,5,ZD,TO=ZD,LENGTH=6)) - Generate a Trailer record with the total - re-read Frank's post.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: how to get the summation using dfsort?...

Postby Frank Yaeger » Tue Dec 13, 2011 12:43 am

please explain the above the example.. briefly


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post