View previous topic :: View next topic
|
Author |
Message |
rajesh_1183
Active User
Joined: 24 Nov 2005 Posts: 121 Location: Tadepalligudem
|
|
|
|
Hi,
I am having a file with 5 fileds of input, each of 2 characters length......
1010101010
and I have to add each field and add the sum to the end of the record....
so my output should be like...
101010101050
I need to do this only in JCL but not thru COBOL..
is there any chances of making it thru sort only, but not thru icetool.
Thanks,
Rajesh. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Can you use REXX ?
O. |
|
Back to top |
|
|
rajesh_1183
Active User
Joined: 24 Nov 2005 Posts: 121 Location: Tadepalligudem
|
|
|
|
No Mr.O
Rajesh. |
|
Back to top |
|
|
fixdoubts
New User
Joined: 21 Oct 2005 Posts: 54
|
|
|
|
Hi,
i am not sure this is the optimal way to do it.
But this does what you want.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1010101010
1010101010
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,11,((1,2,ZD,ADD,3,2,ZD),
ADD,(5,2,ZD,ADD,7,2,ZD)),ADD,9,2,ZD)
/*
//
|
This gives the out put as
Code: |
1010101010 50
1010101010 50
|
Regards, |
|
Back to top |
|
|
rajesh_1183
Active User
Joined: 24 Nov 2005 Posts: 121 Location: Tadepalligudem
|
|
|
|
Hi fixdoubts,
Please fix the error...it is saying POSITIONAL PARAMETER 1 is not valid
POSITIONAL PARAMETER 2 is not valid
POSITIONAL PARAMETER zd is not valid
POSITIONAL PARAMETER ADD is not valid
ADD should have SEQNUM
................when we are doing JJ
and also how u got that 50 at the end...could u explain it...
Thanks,
Rajesh |
|
Back to top |
|
|
fixdoubts
New User
Joined: 21 Oct 2005 Posts: 54
|
|
|
|
Hi,
Could you pls post your job. your are saying its giving error for SYSIN i have not encountered any errors while doing a JJ for any SYSIN errors.
As far as the position of 50 is concerned it will copy the first 11 character from the input (1,11) the rest is the out come of the ADD statements.
Regards, |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Rajesh,
The following DFSORT job will do what you asked for. It adds the 5 fields as 2-byte ZD values and puts the result in positions 11-12 as a 2-byte ZD value.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1010101010
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(11:1,2,ZD,ADD,3,2,ZD,ADD,5,2,ZD,ADD,
7,2,ZD,ADD,9,2,ZD,TO=ZD,LENGTH=2)
/*
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Please fix the error...it is saying POSITIONAL PARAMETER 1 is not valid |
Those are certainly not DFSORT error messages. What program are you using? Please show the complete message log. |
|
Back to top |
|
|
|