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
 

 

Redefines And Move statement

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

New User


Joined: 29 Dec 2006
Posts: 34
Location: INDIA

PostPosted: Wed Apr 23, 2008 12:35 pm    Post subject: Redefines And Move statement
Reply with quote

Hi
05 A PIC X(80)
05 B REDEFINES A PIC X(80)
is it possible to Move 'X' to all of variable 'A' without using the following solutions:


1.05 A PIC X(80) value all 'X'
2. Inspect A converting spaces to 'X'
3.Perform Para-Move varying i from 1 by 1 till i=80
Para-Move.
Move 'X' to B(i)

The solution should have Move statement and should not be any of the solutions mentioned above

Thanks
Have a nice day
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Apr 23, 2008 12:59 pm    Post subject:
Reply with quote

How about the ALL literal as in MOVE ALL 'X' to A?
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Wed Apr 23, 2008 1:08 pm    Post subject:
Reply with quote

Hi,


CICS Guy wrote:
How about the ALL literal as in MOVE ALL 'X' to A?




CICS GUY

This statement moves 'X' to all bytes of the variable or moves to all the variable, please clear this query.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Apr 23, 2008 1:34 pm    Post subject:
Reply with quote

RTFM
Back to top
View user's profile Send private message
ABaluchamy

New User


Joined: 29 Dec 2006
Posts: 34
Location: INDIA

PostPosted: Wed Apr 23, 2008 2:44 pm    Post subject: Reply to: Redefines And Move statement
Reply with quote

Thanks Cics guy. thats good!
Back to top
View user's profile Send private message
ABaluchamy

New User


Joined: 29 Dec 2006
Posts: 34
Location: INDIA

PostPosted: Wed Apr 23, 2008 4:54 pm    Post subject: Reply to: Redefines And Move statement
Reply with quote

Hi
Is there some solution which has everything to do with IBM 370 Architecture.
i.e the question is qualified with IBM-370-cobol

Thanks
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Apr 23, 2008 5:29 pm    Post subject:
Reply with quote

RTF IBM-370-COBOL M
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Apr 23, 2008 8:32 pm    Post subject:
Reply with quote

IIRC:
Code:
A DC C(80)
  MVI A,C'X'
  MVC A+1(L'A-1),A
Back to top
View user's profile Send private message
ABaluchamy

New User


Joined: 29 Dec 2006
Posts: 34
Location: INDIA

PostPosted: Wed Apr 23, 2008 9:08 pm    Post subject: Reply to: Redefines And Move statement
Reply with quote

Can you please explain what does the code do?
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Wed Apr 23, 2008 9:15 pm    Post subject:
Reply with quote

Code:

05 A.
    10 B      PIC X(01).
    10 C      PIC X(79).
05 FILLER     REDEFINES A.
    10 D      PIC X(79).
    10 FILLER PIC X(01).

MOVE 'X' TO B.
MOVE D TO C.


This propagates the X to every byte in A.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Apr 23, 2008 9:32 pm    Post subject:
Reply with quote

A word of warning Douglas, IIRC, the overlapping move does not work in the same direction on a SYSTEM 3.....Got burned bad on that during a 360/30 conversion..... icon_lol.gif
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Wed Apr 23, 2008 10:54 pm    Post subject:
Reply with quote

Quote:
Is there some solution which has everything to do with IBM 370 Architecture.
i.e the question is qualified with IBM-370-cobol

You are correct, this does not work on all systems, nor on all implementations of COBOL, but he asked for a solution for specific to IBM-370-COBOL.
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 ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm


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