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

problem on chracter handling


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

New User


Joined: 16 Jan 2006
Posts: 53
Location: pune

PostPosted: Wed Feb 08, 2006 11:08 am
Reply with quote

Hi folks,

I have one problem with me, Could u please help me in solving this.

str1 pic x(40) value 'jdfksjlhfljsdhfjhsdjfhlksdhfkljsdfjk'

01 ws-str
03 ws-str1 pic x(9)
03 ws-str2 pic x(3)
03 ws-str3 pic x(4)
03 no-str4 pic x(4)
03 no-str5 pic x(4)

Problem :- I want to move str1 to ws-str1,ws-str2,ws-str3 only according to their sizes.
Back to top
View user's profile Send private message
nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Wed Feb 08, 2006 11:43 am
Reply with quote

Hi,
I think redefines will work here. try as

str1 pic x(40) value 'jdfksjlhfljsdhfjhsdjfhlksdhfkljsdfjk'

01 ws-str redefines str1.
03 ws-str1 pic x(9)
03 ws-str2 pic x(3)
03 ws-str3 pic x(4)
03 no-str4 pic x(4)
03 no-str5 pic x(4)

Hope this will work. let me know....
Back to top
View user's profile Send private message
sbalajibe

New User


Joined: 15 Aug 2005
Posts: 62

PostPosted: Wed Feb 08, 2006 11:53 am
Reply with quote

hi dipanshu,
U can also use reference modification....

like
move str1(1:9) to ws-str1
move str1(10:3) to ws-str2

so on....

thanks
Balaji
Back to top
View user's profile Send private message
dipanshu

New User


Joined: 16 Jan 2006
Posts: 53
Location: pune

PostPosted: Wed Feb 08, 2006 11:54 am
Reply with quote

Thanks,

But i only want str1 to move to first three WS variables, In case of redefine str1 moves to all variables.

Pls assist if there are any more solution other than using refrence modification.

Solution by ref. mod.

Move str1(1:9) to ws-str1
Move str1(10:3) to ws-str1
Move str1(13:4) to ws-str1

Thanks,
DIpanshu
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 Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts How can I add in certain colum a chra... TSO/ISPF 4
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
Search our Forums:

Back to Top