MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

UNSTRING based on the Length of characters in a String

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
kseenu
Beginner


Joined: 08 Jun 2004
Posts: 11
Topics: 5

PostPosted: Wed Jun 09, 2004 1:04 am    Post subject: UNSTRING based on the Length of characters in a String Reply with quote

I have a String ws-a pic x(200) and ws-ab x(200). I have to check the total length of character in the string and if it less than 250 characters (inclusive of space in between) then i should store that in a variable ws-c pic x(250) and if it above 250 then it should store the rest in another variable ws-d.

when i check for the condition IF WS-A (Length of WS-A : 1) NOT = SPACE

but it throws an error stating that i should use occurs clause.

I dont know where actually i had erred.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jun 09, 2004 5:26 am    Post subject: Reply with quote

kseenu,

You need to Post detailed information on what you're trying to accomplish. Do not make people guess what you mean. This will give you a much better chance of getting a good answer to your question.

So far from your post, this is what I have grasped.
Code:

01 WS-STRING.
   05 WS-A          PIC X(200).
   05 WS-AB         PIC X(200).


Now you have to check the actual length of Ws-string. If it is less than 250 then you need to store that in WS-C and if it exceeds 250 you should still store the first 250 bytes in WS-C and the rest in WS-D. Is that right?

If that is the case then it is very simple. Define a variable WS-Final-string as follows

Code:

01 WS-Final-STRING.
   05 WS-C         PIC X(250).
   05 WS-D         PIC X(150).


and simply
Code:

Move WS-STRING TO WS-FINAL-STRING


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Wed Jun 09, 2004 7:00 pm    Post subject: Reply with quote

Well, now you have two solutions. Will you be going to another site for a third?

Regards, Jack.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group