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

overflow condition in unstring


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anilsanda

New User


Joined: 07 Jun 2007
Posts: 15
Location: chennai

PostPosted: Thu Jun 19, 2008 12:38 pm
Reply with quote

Hi,

If the number of source variables are greater than the number of destination variables declared and "ON OVERFLOW" or "NOT ON OVERFLOW " is not specified .then whether the prgram gets abended or it will populate the last destination variable with the entire left out part of the string .

ex:

UNSTRING FullName DELIMITED BY ALL SPACES
INTO FirstName, SecondName, Surname
END-UNSTRING.

Full name = "John Joseph Ryan chennai"

first name = john
second name = joseph
surname= ryan

wht abt "chennai"???
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jun 19, 2008 12:43 pm
Reply with quote

do You have access to a compiler to test or You are just studying the manual?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 19, 2008 12:44 pm
Reply with quote

Hello,

I suggest you run a simple test and see.

IIRC, when the last receiving field is processed, the unstring stops. There is no error raised. The remaining data is not processed (as i said iirc).
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Jun 19, 2008 3:11 pm
Reply with quote

anil,

Quote:
Full name = "John Joseph Ryan chennai"

first name = john
second name = joseph
surname= ryan

wht abt "chennai"???


You will lose "chennai" when that unstring is done. it would not populate "Ryan Chennai" in the surname field.

what actually is u r requirement? If you want chennai to be populated in surname then you will have to do the following.



Code:
Perform UNTIL a flag
      replace the first "space" with "\"
     unstring the data into 2 parts delimited by "\"
     check the fucnctionality and set the flag when the 2 part is spaces


By this youi can check dynamically incresing the performance and not losing the data.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Assembler: Set Program Mask for decim... PL/I & Assembler 4
No new posts How to give complex condition in JCL . CLIST & REXX 30
No new posts selectively copy based on condition DFSORT/ICETOOL 3
No new posts Handling the numeric data in unstring... COBOL Programming 18
This topic is locked: you cannot edit posts or make replies. Control-m JOB executing even when the... Compuware & Other Tools 6
Search our Forums:

Back to Top