Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Handling result sets in the calling N... Rusikesh DB2 7 Fri Apr 13, 2018 12:25 am
No new posts Having a problem FTP'ng to the MF pahiker All Other Mainframe Topics 2 Fri Nov 10, 2017 8:20 pm
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts Problem commiting to DB2 from IMS MPP Ole Soerensen IMS DB/DC 2 Wed Jul 26, 2017 5:19 pm
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us