Page 1 of 1

Adding values in column

PostPosted: Mon Mar 18, 2013 7:52 pm
by nikesh_rai
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)))

Re: Adding values in column

PostPosted: Mon Mar 18, 2013 8:18 pm
by enrico-sorichetti
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

Re: Adding values in column

PostPosted: Mon Mar 18, 2013 8:39 pm
by nikesh_rai
offff.. its working with UFF... Thanks Enrico.. :)

Re: Adding values in column

PostPosted: Mon Mar 18, 2013 9:07 pm
by BillyBoyo
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.

Re: Adding values in column

PostPosted: Mon Mar 18, 2013 10:59 pm
by NicC
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.

Re: Adding values in column

PostPosted: Mon Mar 18, 2013 11:11 pm
by nikesh_rai
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...

Re: Adding values in column

PostPosted: Mon Mar 18, 2013 11:16 pm
by skolusu
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

Re: Adding values in column

PostPosted: Mon Mar 18, 2013 11:26 pm
by enrico-sorichetti
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:

Re: Adding values in column

PostPosted: Mon Mar 18, 2013 11:46 pm
by skolusu
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. :)