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
 

 

problem on chracter handling

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: problem on chracter handling
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    Post subject: Re: problem on chracter handling
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm


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