Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SUBSTR question in PL/I

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: SUBSTR question in PL/I
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

Active Member


Joined: 07 Feb 2009
Posts: 989
Location: Oostende, Belgium

PostPosted: Tue Nov 30, 2010 2:31 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fault Analyzer - listings question. egrove IBM Tools 4 Thu Aug 11, 2016 5:31 pm
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm
No new posts SQL Order By related question Joseph K Thomas DB2 8 Fri Mar 18, 2016 12:53 pm
No new posts DFSort Question krrp DFSORT/ICETOOL 9 Mon Mar 07, 2016 7:11 pm
No new posts Whats the assambler code for SUBSTR()... jackzhang75 PL/I & Assembler 3 Sat Aug 29, 2015 1:59 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us