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

Redefines And Move statement


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 2146
Location: At my coffee table

PostPosted: Wed Apr 23, 2008 12:59 pm
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: 275
Location: Bang,iflex

PostPosted: Wed Apr 23, 2008 1:08 pm
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
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
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
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
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: 2146
Location: At my coffee table

PostPosted: Wed Apr 23, 2008 8:32 pm
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
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
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: 3156
Location: Tucson AZ

PostPosted: Wed Apr 23, 2008 9:32 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts How to move DB2 Installation HLQ DB2 4
No new posts Relate COBOL statements to EGL statement All Other Mainframe Topics 0
Search our Forums:

Back to Top