Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Skip and stop before How to do in Rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
shrivatsa

Active User


Joined: 17 Mar 2006
Posts: 157
Location: Pune

PostPosted: Sat Mar 25, 2006 3:28 pm    Post subject: Skip and stop before How to do in Rexx
Reply with quote

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
View user's profile Send private message
References
PostPosted: Sat Mar 25, 2006 3:28 pm    Post subject: Re: Skip and stop before How to do in Rexx Reply with quote

mainframesguru

New User


Joined: 24 Jun 2005
Posts: 32
Location: Hyderabad

PostPosted: Mon Mar 27, 2006 1:58 pm    Post subject: Yes you can Skip Header and Trailer Records!!
Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1