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
 
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: 6970
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: 6970
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 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
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm

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