Adding values in column



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

Adding values in column

Postby nikesh_rai » Mon Mar 18, 2013 7:52 pm

Hi,

I am trying to add the values in columns for a record.. My input file is:

1  1     10   
1  7     10   
1  13    1   
1  14    8   
1  22    8   
1  30    10   


and expecting output as:

1 1 10 12
1 7 10 18
1 13 1 15
1 14 8 23
1 22 8 31
1 30 10 41

but output is coming as:

1  1     10      2100
1  7     10      8100
1  13    1       2400
1  14    8       9500
1  22    8        300
1  30    10      4100


My sysin card looks like:

OPTION COPY
OUTREC IFTHEN=(WHEN=INIT,                                 
        OVERLAY=(1,75,95:78,3,ZD,ADD,             
                 81,4,ZD,ADD,87,4,ZD,EDIT=(IIIT)))
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 192
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time

Re: Adding values in column

 

Re: Adding values in column

Postby enrico-sorichetti » Mon Mar 18, 2013 8:18 pm

no wonder.... You did not consider the alignment
try with ...
 ****** ***************************** Top of Data ******************************
 000001 //ENRICO1  JOB NOTIFY=&SYSUID,
 000002 //             MSGLEVEL=(1,1),CLASS=A,MSGCLASS=H
 000003 //*
 000004 //S1      EXEC PGM=SORT
 000005 //SYSPRINT  DD SYSOUT=*
 000006 //SYSOUT    DD SYSOUT=* IJK, ABC, PQR AND DEF
 =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 000007 //SORTIN    DD *
 000008 1    1    10
 000009 1    7    10
 ==CHG> 1    13   1
 ==CHG> 1    14   8
 000012 1    22   8
 000013 1    30   10
 000014 //SORTOUT   DD SYSOUT=*
 000015 //SYSIN     DD *
 000016   OPTION COPY
 000017   INREC  IFTHEN=(WHEN=INIT,
 000018                  OVERLAY=(16:01,5,UFF,ADD,
 000019                           06,5,UFF,ADD,
 000020                           11,5,UFF,EDIT=(IIIT)))
 000021 //*
 ****** **************************** Bottom of Data ****************************


to obtain
********************************* TOP OF DATA **********************************
 1    1    10     12
 1    7    10     18
 1    13   1      15
 1    14   8      23
 1    22   8      31
 1    30   10     41
******************************** BOTTOM OF DATA ********************************


modify according to Your field positions lengths
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: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Adding values in column

Postby nikesh_rai » Mon Mar 18, 2013 8:39 pm

offff.. its working with UFF... Thanks Enrico.. :)
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 192
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time

Re: Adding values in column

Postby BillyBoyo » Mon Mar 18, 2013 9:07 pm

I suggest you get rid of your e-mail address from your signature. If it is there, it can be "trawled" and you can end up being "spammed" for all types of things.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Adding values in column

Postby NicC » Mon Mar 18, 2013 10:59 pm

Actually, including your mil address is against the rules of the forum so this is a directive to you to A) remove it and B) review the forum rules s you have obviously forgotten some of them.
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: Adding values in column

Postby nikesh_rai » Mon Mar 18, 2013 11:11 pm

NicC wrote:Actually, including your mil address is against the rules of the forum so this is a directive to you to A) remove it and B) review the forum rules s you have obviously forgotten some of them.


Thanks Nicc

removed my e-mail id...
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 192
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time

Re: Adding values in column

Postby skolusu » Mon Mar 18, 2013 11:16 pm

Enrico,

I guess your bank isn't doing the same with your money, adding 3 fields of 5 bytes of length for a total field of just 4 bytes :o

Nikesh_rai,

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
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: Adding values in column

Postby enrico-sorichetti » Mon Mar 18, 2013 11:26 pm

Looks like You were the only one paying attention. ;)

I did it on purpose ...
I like to let small glitches go by in my suggestions to see if people using them
are capable / willing to use their brain, and also to confirm that a forum
is to provide help ... not ready to run solutions to be used without understanding them :geek:
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: 2643
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Adding values in column

Postby skolusu » Mon Mar 18, 2013 11:46 pm

enrico-sorichetti wrote:I did it on purpose ...
I like to let small glitches go by in my suggestions to see if people using them
are capable / willing to use their brain, and also to confirm that a forum
is to provide help ... not ready to run solutions to be used without understanding them :geek:



Ah gotcha. I very much like this idea. :)
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


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post