|
|
| Author |
Message |
shrivatsa
Active User
Joined: 17 Mar 2006 Posts: 157 Location: Pune
|
|
|
|
Hi All,
I have used a rexx program
ADDRESS TSO
"ALLOC FI(DD1) DA('Input dataset') SHR REUS"
"ALLOC FI(DD4) DA('Output dataset') SHR REUS"
"EXECIO * DISKR DD1 (FINIS STEM A."
SUM = 0
DO I = 1 TO A.0
J.I = SUBSTR(A.I,55,10)
SUM = SUM + J.I
END
"EXECIO * DISKW DD4 (FINIS STEM J."
SAY 'SUM' SUM
But my dataset is having the first and the last record as the header and trailer record.
Can I skip the first and stop before last in this Rexx program.
Thanks
Shri |
|
| Back to top |
|
 |
References
|
Posted: Sat Mar 25, 2006 3:28 pm Post subject: Re: Skip and stop before How to do in Rexx |
 |
|
|
 |
mainframesguru
New User
Joined: 24 Jun 2005 Posts: 32 Location: Hyderabad
|
|
|
|
Hi Shri,
Yes you can Skip Header and Trailer Records with simple change in your program.
ADDRESS TSO
"ALLOC FI(DD1) DA('Input dataset') SHR REUS"
"ALLOC FI(DD4) DA('Output dataset') SHR REUS"
"EXECIO * DISKR DD1 (FINIS STEM A."
SUM = 0
/*-------------------- Code Replaced from here */
Count = A.0 - 1
DO I = 2 TO Count
K = I - 1
J.K = SUBSTR(A.I,55,10)
SUM = SUM + J.K
END
/*-------------------- Code Replaced till here */
"EXECIO * DISKW DD4 (FINIS STEM J."
SAY 'SUM' SUM
I guess this would serve your purpose.
Regards
Vamshi krishna Indla
Kanbay |
|
| Back to top |
|
 |
|
|