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

SUBSTR question in PL/I


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

New User


Joined: 23 Nov 2006
Posts: 22
Location: India

PostPosted: Tue Nov 30, 2010 4:25 am
Reply with quote

I have the following string with comma at the end
NAME = "ABCDEFGH IJKLMN OPQRSTU,"

output = SUBSTR(NAME,26,-1) || ' ' || SUBSTR(NAME,1,23)

I am getting the following output,
With PL/I compiler V2.7 ---->ABCDEFGH IJKLMN OPQRSTU
With PL/I compiler V3.4 ----> ABCDEFGH IJKLMN OPQRSTU
an additional space is prefixed in string output in the Enterprise compiler (V3.4)

How would the above SUSBTR work in PL/I compiler V2.7 & V3.4? What is the difference?

I am not getting any exceptions like STRINGRANGE but an additional space is coming ahead of the string output of the enterprise compiler. Please assist

Advanced thanks for your help!
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Tue Nov 30, 2010 2:31 pm
Reply with quote

The third argument of SUBSTR cannot be negative (no clue what you are trying to achieve), so behavior is undefined.
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 Question for file manager IBM Tools 7
No new posts question for Pedro TSO/ISPF 2
No new posts question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
No new posts panel creation question TSO/ISPF 12
No new posts Sort w/OUTREC Question DFSORT/ICETOOL 2
Search our Forums:

Back to Top