View previous topic :: View next topic
|
Author |
Message |
ABaluchamy
New User
Joined: 29 Dec 2006 Posts: 34 Location: INDIA
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
RTFM |
|
Back to top |
|
|
ABaluchamy
New User
Joined: 29 Dec 2006 Posts: 34 Location: INDIA
|
|
|
|
Thanks Cics guy. thats good! |
|
Back to top |
|
|
ABaluchamy
New User
Joined: 29 Dec 2006 Posts: 34 Location: INDIA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
RTF IBM-370-COBOL M |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
IIRC:
Code: |
A DC C(80)
MVI A,C'X'
MVC A+1(L'A-1),A |
|
|
Back to top |
|
|
ABaluchamy
New User
Joined: 29 Dec 2006 Posts: 34 Location: INDIA
|
|
|
|
Can you please explain what does the code do? |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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..... |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
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 |
|
|
|