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
 
Need Logic for COBOL Move

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
mahesh bhavikatti

New User


Joined: 08 Dec 2007
Posts: 6
Location: bangalore

PostPosted: Sat Dec 08, 2007 3:40 pm    Post subject: Need Logic for COBOL Move
Reply with quote

Hi,

There are 8 address lines
addr-1
addr-2
addr-3
addr-4
addr-5
addr-6
addr-7
addr-8

Now i need to move addr-1 to addr-2 similarly for all other and
ws-special-name to addr-1.
While moving if any occurrences of address -line-x(x=1-8) are spaces then move up by 1 occurrence(addr-1 to addr-2 ,addr-2 to addr-3) e.g if addr-2 = spaces then addr-3 should be moved to addr-3.
Back to top
View user's profile Send private message

mahesh bhavikatti

New User


Joined: 08 Dec 2007
Posts: 6
Location: bangalore

PostPosted: Sat Dec 08, 2007 5:01 pm    Post subject:
Reply with quote

Please let me know incase incase the query is not clear.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Sat Dec 08, 2007 5:43 pm    Post subject:
Reply with quote

Mahesh,

Quote:
Please let me know incase incase the query is not clear.

You are correct. Need some examples also.
Back to top
View user's profile Send private message
mahesh bhavikatti

New User


Joined: 08 Dec 2007
Posts: 6
Location: bangalore

PostPosted: Sat Dec 08, 2007 6:35 pm    Post subject:
Reply with quote

ex values of the address are
addr1 = mahesh
addr2= kumar
addr3= bhavika
addr4= spaces
addr5= spaces
addr6= cross
addr7= house
addr8= pincode

ws-special-name = bank, This will be moved to addr1 so the values i need is

addr1 = bank
addr2= mahesh
addr3= kumar
addr4= bhavika
addr5= cross
addr6= house
addr7= pincode
addr8= spaces(For addr8 if value is there then we can move or else default it will be spaces)

Hope this helps ...
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Sun Dec 09, 2007 2:52 am    Post subject:
Reply with quote

Hello,

Are all of the addr fields the same length? If they are, you could define one array of the 8 input values and another array to build the output values.

Move spaces to the output array.

Your process would check the "special" name and if it is not blank, move that value to the first occurance of the output array (and set the current output index/subscript to the second entry).

The input array "current" occurance would be checked for spaces and if not, moved to the current output occurance. Both index/subscript values woule be incremented.

If the "input" value was spaces, the input array would be incremented with no move to the output array (and no output array increment).

Continue like this until done with the input array. When all of the input array has been processed, the final values are in the output array.
Back to top
View user's profile Send private message
mahesh bhavikatti

New User


Joined: 08 Dec 2007
Posts: 6
Location: bangalore

PostPosted: Sun Dec 09, 2007 10:58 am    Post subject:
Reply with quote

Thank you .... D.sch
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Mon Dec 10, 2007 12:11 am    Post subject: Reply to: Need Logic for COBOL Move
Reply with quote

You're welcome icon_smile.gif

We're here if there are questions.

d
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
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am

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