Some help with sum fields please



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Some help with sum fields please

Postby wout » Mon Aug 27, 2012 11:41 pm

Hello , I will do a sort with sumfields, but the value is with a real ",". Expl: 0000000258,77 when I use the code that you can see here under, the SUM is +/- OK but I have lost a position.
Can someone help me to find the glitch?
JCL:
//LVSORT01 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//* SORT PARAM -------------------------------------------
//TOOLIN   DD DISP=SHR,
//         DSN=B4T1.LV.DB.V000.JCLDATA(X18S00)
//CTL1CNTL DD DISP=SHR,
//         DSN=B4T1.LV.DB.V000.JCLDATA(X18S01)
//*  INPUT FILE ------------------------------------------
//IN1      DD DISP=SHR,
//            DSN=Q9T1.LV.DD.V000.TAXEANTI
//* OUTPUT FILE ------------------------------------------
//OUT      DD DISP=(NEW,CATLG,DELETE),
//            DSN=Q2T1.LV.DD.V000.LFX18S00,
//            DATACLAS=BATL,
//            LRECL=350,RECFM=FB



TOOLIN
SORT FROM(IN1) TO(OUT) USING(CTL1)


CTL1CNTL
INREC FIELDS=(1,31,32,13,UFF,ZD,LENGTH=13,45,305)
SORT FIELDS=(23,9,CH,A,47,04,CH,A,51,03,CH,A)
SUM FIELDS=(32,13,ZD)
OUTREC FIELDS=(1,31,32,13,UFF,EDIT=(TTTTTTTTTT,TT),45,305)


IN1
03111100419520000039730949045860000000382,4510C3065232JOOS.....just to 350
03111010119530000040140086106560000000507,840104917012DE XXXXXX.....just to 350
03121010119530000040140086106560000000258,770104917012DE XXXXXX.....just to 350


EXPECTED RESULT
03111100419520000039730949045860000000382,4510C3065232JOOS.....just to 350
03111010119530000040140086106560000000766,610104917012DE XXXXXX.....just to 350
wout
 
Posts: 13
Joined: Thu Dec 18, 2008 3:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: Some help with sum fields please

 

Re: Some help with sum fields please

Postby skolusu » Tue Aug 28, 2012 12:57 am

wout wrote:Hello , I will do a sort with sumfields, but the value is with a real ",". Expl: 0000000258,77 when I use the code that you can see here under, the SUM is +/- OK but I have lost a position.
Can someone help me to find the glitch?


Wout,

Did you mean the order of the output records? You are sorting on the following keys
094904586 C306 523
008610656 0491 701
008610656 0491 701


Obviously 008610656 will be sorted first. Do you want to retain the order of the records as is?
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Some help with sum fields please

Postby wout » Tue Aug 28, 2012 1:06 am

Skolosu thank you for the answer.
No the problem is not is the sort part, it is the sum part.

first record value to sum: 0000000382,45
second record value to sum: 0000000507,84
third record value to sum: 0000000258,77

there the keys of the sort are equal for the second and the third they must be put together. Now when I run the code it gives the following result for these values:

first record : 0000000038,24 ==> must be 0000000382,45
second + third : 0000000076,66 ==> must be 0000000766,61
wout
 
Posts: 13
Joined: Thu Dec 18, 2008 3:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: Some help with sum fields please

Postby skolusu » Tue Aug 28, 2012 1:36 am

wout wrote:Skolosu thank you for the answer.
No the problem is not is the sort part, it is the sum part.

first record value to sum: 0000000382,45
second record value to sum: 0000000507,84
third record value to sum: 0000000258,77

there the keys of the sort are equal for the second and the third they must be put together. Now when I run the code it gives the following result for these values:

first record : 0000000038,24 ==> must be 0000000382,45
second + third : 0000000076,66 ==> must be 0000000766,61


Wout,

Hmm when I run your control cards , I do get the right results. (382,45 and 766,61)

03111010119530000040140086106560000000766,610104917012DE XXXXXX
03111100419520000039730949045860000000382,4510C3065232JOOS     


Can you show us the sysout of the job you ran? Is your input VB?
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Some help with sum fields please

Postby wout » Tue Aug 28, 2012 11:43 am

This is de job sysout

                       J E S 2  J O B  L O G  --  S Y S T E M  S Y C 7  --  N O

10.21.01 JOB00306 ---- MONDAY,    27 AUG 2012 ----
10.21.01 JOB00306  IRR010I  USERID X33386   IS ASSIGNED TO THIS JOB.
10.21.01 JOB00306  ICH70001I X33386   LAST ACCESS AT 10:12:58 ON MONDAY, AUGUST
10.21.01 JOB00306  $HASP373 LV1X18S0 STARTED - WLM INIT  - SRVCLASS BATCHIWM - S
10.21.01 JOB00306  IEF403I LV1X18S0 - STARTED
10.21.01 JOB00306  -                                      -----TIMINGS (MINS.)--
10.21.01 JOB00306  -STEPNAME PROCSTEP    RC   EXCP   CONN       TCB       SRB  C
10.21.01 JOB00306  -LVSORT01             00     45     35       .00       .00
10.21.01 JOB00306  IEF404I LV1X18S0 - ENDED
10.21.01 JOB00306  -LV1X18S0 ENDED.  NAME-EXPLOITATION         TOTAL TCB CPU TIM
10.21.01 JOB00306  $HASP395 LV1X18S0 ENDED
------ JES2 JOB STATISTICS ------
  27 AUG 2012 JOB EXECUTION DATE
           24 CARDS READ
          139 SYSOUT PRINT RECORDS
            0 SYSOUT PUNCH RECORDS
            8 SYSOUT SPOOL KBYTES
         0.00 MINUTES EXECUTION TIME
        1 //LV1X18S0 JOB (LVD00212,AB1),'EXPLOITATION',
          //             NOTIFY=&SYSUID,
          //             COND=(0,LT),
          //             SCHENV='IM1T'
          IEFC653I SUBSTITUTION JCL - (LVD00212,AB1),'EXPLOITATION',NOTIFY=X3338
        2 // SET ENV=1T      ADDED BY EXIT 54 ON BASIS OF SCHENV IM1T
          //*OMS NET=T       ADDED BY EXIT 54 ON BASIS OF SCHENV
         //******************************************************************
         //* SORT : FILE
         //******************************************************************
       3 //LVSORT01 EXEC PGM=ICETOOL
       4 //TOOLMSG  DD SYSOUT=*
       5 //DFSMSG   DD SYSOUT=*
       6 //SYSOUT   DD  SYSOUT=*
         //* SORT PARAM -------------------------------------------
       7 //TOOLIN   DD DISP=SHR,
         //         DSN=B4T1.LV.DB.V000.JCLDATA(X18S00)
       8 //CTL1CNTL DD DISP=SHR,
         //         DSN=B4T1.LV.DB.V000.JCLDATA(X18S01)
         //*  INPUT FILE ------------------------------------------
       9 //IN1      DD DISP=SHR,
         //            DSN=Q9T1.LV.DD.V000.TAXEANTI
         //* OUTPUT FILE ------------------------------------------
      10 //OUT      DD DISP=(NEW,CATLG,DELETE),
         //            DSN=Q2T1.LV.DD.V000.LFX18S00,
         //            DATACLAS=BATL,
         //            LRECL=350,RECFM=FB
STMT NO. MESSAGE

      10 IGD01008I SC: DATASET SMS-MANAGED / STORCLAS SET TO SCSTD
      10 IGD01009I MC: MGMTCLAS SET BY DEFAULT TO MCTST
      10 IGD01010I SG: STORGRP = SGTSL90,SGOVF90
CH70001I X33386   LAST ACCESS AT 10:12:58 ON MONDAY, AUGUST 27, 2012
EF236I ALLOC. FOR LV1X18S0 LVSORT01
IEF236I ALLOC. FOR LV1X18S0 LVSORT01
IEF237I JES2 ALLOCATED TO TOOLMSG
IEF237I JES2 ALLOCATED TO DFSMSG
IEF237I JES2 ALLOCATED TO SYSOUT
IGD103I SMS ALLOCATED TO DDNAME TOOLIN
IGD103I SMS ALLOCATED TO DDNAME CTL1CNTL
IGD103I SMS ALLOCATED TO DDNAME IN1
IGD101I SMS ALLOCATED TO DDNAME (OUT     )
        DSN (Q2T1.LV.DD.V000.LFX18S00                    )
        STORCLAS (SCSTD) MGMTCLAS (MCTST) DATACLAS (BATL)
        VOL SER NOS= TLC659
IEF142I LV1X18S0 LVSORT01 - STEP WAS EXECUTED - COND CODE 0000
IEF285I   X33386.LV1X18S0.JOB00306.D0000101.?          SYSOUT
IEF285I   X33386.LV1X18S0.JOB00306.D0000102.?          SYSOUT
IEF285I   X33386.LV1X18S0.JOB00306.D0000103.?          SYSOUT
IGD104I B4T1.LV.DB.V000.JCLDATA                      RETAINED,  DDNAME=TOOLIN
IGD104I B4T1.LV.DB.V000.JCLDATA                      RETAINED,  DDNAME=CTL1CNTL
IGD104I Q9T1.LV.DD.V000.TAXEANTI                     RETAINED,  DDNAME=IN1
IGD104I Q2T1.LV.DD.V000.LFX18S00                     RETAINED,  DDNAME=OUT
IEF373I STEP/LVSORT01/START 2012240.1021
IEF032I STEP/LVSORT01/STOP  2012240.1021
        CPU:     0 HR  00 MIN  00.02 SEC    SRB:     0 HR  00 MIN  00.00 SEC
        VIRT:  1192K  SYS:   332K  EXT:     6204K  SYS:     9208K
IEF375I  JOB/LV1X18S0/START 2012240.1021
IEF033I  JOB/LV1X18S0/STOP  2012240.1021
        CPU:     0 HR  00 MIN  00.02 SEC    SRB:     0 HR  00 MIN  00.00 SEC
ICE600I 0 DFSORT ICETOOL UTILITY RUN STARTED

ICE650I 0 VISIT http://www.ibm.com/storage/dfsort FOR ICETOOL PAPERS, EXAMPLES A

ICE632I 0 SOURCE FOR ICETOOL STATEMENTS:  TOOLIN


ICE630I 0 MODE IN EFFECT:  STOP

            SORT FROM(IN1) TO(OUT) USING(CTL1)
ICE606I 0 DFSORT CALL 0001 FOR SORT  FROM IN1      TO OUT      USING CTL1CNTL CO
ICE602I 0 OPERATION RETURN CODE:  00


ICE601I 0 DFSORT ICETOOL UTILITY RUN ENDED - RETURN CODE:  00
ICE200I 0 IDENTIFIER FROM CALLING PROGRAM IS 0001
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K76982 C6-K90026 C7-K58148 C8-K67572 E9-K60824 C9-BASE   E5-K76585
ICE143I 0 BLOCKSET     SORT  TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 10:21 ON MON AU
            INREC FIELDS=(1,31,32,13,UFF,ZD,LENGTH=13,45,305)
            SORT FIELDS=(23,9,CH,A,47,04,CH,A,51,03,CH,A)
            SUM FIELDS=(32,13,ZD)
            OUTREC FIELDS=(1,31,32,13,UFF,EDIT=(TTTTTTTTTT,TT),45,305)
ICE146I 0 END OF STATEMENTS FROM CTL1CNTL - PARAMETER LIST STATEMENTS FOLLOW
          DEBUG NOABEND,ESTAE
          OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL1,SORTIN=IN1,S
                         RTOUT=OUT,DYNALLOC
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K76982 C6-K90026 C7-K58148 C8-K67572 E9-K60824 C9-BASE   E5-K76585
ICE193I 0 ICEAM2 INVOCATION ENVIRONMENT IN EFFECT - ICEAM2 ENVIRONMENT SELECTED
ICE088I 1 LV1X18S0.LVSORT01.        , INPUT LRECL = 350, BLKSIZE = 27650, TYPE =
ICE093I 0 MAIN STORAGE = (MAX,6291456,6291456)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6234096,6234096)
ICE127I 0 OPTIONS: OVFLO=RC4 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=Y,LIST=Y,ERE
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=FULL ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=N,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE    ,EXITC
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMI
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE236I 0 OPTIONS: DYNAPCT=10 ,MOWRK=Y
ICE084I 0 EXCP ACCESS METHOD USED FOR OUT
ICE084I 0 EXCP ACCESS METHOD USED FOR IN1
ICE750I 0 DC 525350 TC 0 CS DSVNN KSZ 20 VSZ 20
ICE752I 0 FSZ=1501 RC  IGN=0 E  AVG=356 0  WSP=694 C  DYN=0 0
ICE751I 1 DE-K61787 D5-K58148 D9-K61787 E8-K70685
ICE090I 0 OUTPUT LRECL = 350, BLKSIZE = 27650, TYPE = FB
ICE080I 0 IN MAIN STORAGE SORT
ICE055I 0 INSERT 0, DELETE 48
ICE054I 0 RECORDS - IN: 1488, OUT: 1440
ICE134I 0 NUMBER OF BYTES SORTED: 520800
ICE253I 0 RECORDS SORTED - PROCESSED: 1488, EXPECTED: 1501
ICE199I 0 MEMORY OBJECT USED AS MAIN STORAGE = 0M BYTES
ICE299I 0 MEMORY OBJECT USED AS WORK STORAGE = 0M BYTES
ICE180I 0 HIPERSPACE STORAGE USED = 0K BYTES
ICE188I 0 DATA SPACE STORAGE USED = 0K BYTES
ICE052I 0 END OF DFSORT



wout
 
Posts: 13
Joined: Thu Dec 18, 2008 3:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: Some help with sum fields please

Postby skolusu » Tue Aug 28, 2012 9:55 pm

Wout,

I don't see any thing out of the ordinary from the sysout. I Do get the correct results. Lets us try to narrow the output to just the fields we are interested. Can you run the following job and see if it produces the right results?

//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD DSN=Your Input FB 350 byte file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                               
  INREC FIELDS=(23,9,X,47,4,X,51,03,X,32,13,UFF,ZD,LENGTH=13)
  SORT FIELDS=(1,19,CH,A)                                     
  SUM FIELDS=(20,13,ZD)                                       
  OUTREC OVERLAY=(20:20,13,UFF,EDIT=(TTTTTTTTTT,TT))
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Some help with sum fields please

Postby wout » Thu Aug 30, 2012 11:40 am

Hello,

I run the code, and the result is not OK:

008610656 0491 701 0000000076,66
wout
 
Posts: 13
Joined: Thu Dec 18, 2008 3:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: Some help with sum fields please

Postby BillyBoyo » Thu Aug 30, 2012 12:03 pm

Can you please check the actual start position of the data in your file. If you change the field by adding one byte, do you get the correct result?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Some help with sum fields please

Postby wout » Thu Aug 30, 2012 12:49 pm

No, if I add 1 byte in de field I get the following result:

008610656 1049 170 0000000007,66


And the value starts in position 32, all the other fields are OK.

This is the discription of the input file:

 Q9T1.LV.DD.V001.TAXEANTI
 --RECFM-LRECL-BLKSIZE-DSORG
   FB    350   27650   PS
wout
 
Posts: 13
Joined: Thu Dec 18, 2008 3:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: Some help with sum fields please

Postby BillyBoyo » Thu Aug 30, 2012 1:51 pm

    //STEP0100 EXEC PGM=SORT                                     
    //SYSOUT   DD SYSOUT=*                                       
    //SORTIN   DD DSN=Your Input FB 350 byte file,DISP=SHR
    //SORTOUT  DD SYSOUT=*                                       
    //SYSIN    DD *                                               
      INREC FIELDS=(23,9,X,47,4,X,51,03,X,32,13,UFF,ZD,LENGTH=13)
      OUTREC OVERLAY=(35:20,13,UFF,EDIT=(TTTTTTTTTTT,TT))
    //*


Can you run this and post the SORTOUT please?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post