IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

can you explain the proc REVERSEIT briefly


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
senthilnathanj

New User


Joined: 31 Jul 2007
Posts: 47
Location: chennai

PostPosted: Tue Aug 03, 2010 12:28 pm
Reply with quote

Hi Guys,
what is the output of the below code. Please explan briefly.
Code:
CALL REVERSEIT('PL/I');
(SUBSCRIPTRANGE,SIZE,STRINGSIZE);
 REVRESEIT:[b] PROC(31);[/b]
DCL (I,J) BIN FIXED(31);
DCL (S,T) CHAR(100) VARYING;
 T=S;
 J=0;
 DO I = LENGTH(S) TO 1;
       J = J + 1;
      SUBSTR(T,J,1) = SUBSTR(S,I,1);
 END;
PUT(T);
END;
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Tue Aug 03, 2010 1:09 pm
Reply with quote

Why don't you try it and see? Did you mean to have spelt REVRESEIT in line 3?

Garry.
Back to top
View user's profile Send private message
donateeye
Warnings : 2

New User


Joined: 01 Jun 2007
Posts: 62
Location: chennai

PostPosted: Mon Aug 09, 2010 1:11 pm
Reply with quote

Line 3: REVERSEIT OR REVRESEIT ??

In the DO loop, seems like you need step -1

rest its fine, i think you would get the reversed string...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts DB2 Statistics - Using EXPLAIN and qu... DB2 1
No new posts Proc print in Mainframe All Other Mainframe Topics 4
No new posts trying to set return code in PROC JCL & VSAM 15
No new posts Execute DSNTEP2 in REXX which is call... CLIST & REXX 4
No new posts proc step return code to override in ... JCL & VSAM 3
Search our Forums:

Back to Top