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
 

 

Regarding move of X(2) varaible to X(200)

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

New User


Joined: 21 Sep 2009
Posts: 55
Location: Kolkatta

PostPosted: Tue Apr 27, 2010 3:14 pm    Post subject: Regarding move of X(2) varaible to X(200)
Reply with quote

Hi,

Below is my requrement

01 A PIC X(2) Value '**'.
01 B PIC X(100).

Now my requirement is without intializing our without movement
varable A whose pic clause contain X(2) value ** will also move all
value and B value display like this *************************************************

I think it possible with redifine can any one help to guide me how i solve throu redefine.
Back to top
View user's profile Send private message

Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Tue Apr 27, 2010 4:17 pm    Post subject:
Reply with quote

Hi Santhosh,

have you tried the usage of VALUE ALL while declaring the variable.
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Tue Apr 27, 2010 4:20 pm    Post subject: Reply to: Regarding move of X(2) varaible to X(200)
Reply with quote

01 B pic x(100) value all '*'.

this will fill B with *.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7908
Location: Bellevue, IA

PostPosted: Tue Apr 27, 2010 4:30 pm    Post subject:
Reply with quote

Quote:
I think it possible with redifine can any one help to guide me how i solve throu redefine.
You think wrong. You can use VALUE ALL '*' for the definition of B, but there is no way to use a REDEFINES clause to achieve what you are wanting.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Apr 27, 2010 4:48 pm    Post subject: Reply to: Regarding move of X(2) varaible to X(200)
Reply with quote

The only way I can see this working is -

Code:

01  B PIC  X(100) VALUE ALL '*'.
01  FILLER REDEFINES B.
    03  A PIC X(02).
    03  FILLER PIC X(98).

Variable A will equal '**'.

Bill
Back to top
View user's profile Send private message
santosh100678

New User


Joined: 21 Sep 2009
Posts: 55
Location: Kolkatta

PostPosted: Tue Apr 27, 2010 4:51 pm    Post subject:
Reply with quote

Hi,

Requirement is 01A PIC X(2) value '**'
Now second variable is 01 B PIC X(100)
restriction is that without using intilization variable or move statement
the value of a store into B with all 100 picture clause
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Tue Apr 27, 2010 4:56 pm    Post subject:
Reply with quote

Quote:
restriction is that without using intilization variable or move statement
icon_question.gif icon_question.gif can u tell us why you are "restricted". ... icon_rolleyes.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7908
Location: Bellevue, IA

PostPosted: Tue Apr 27, 2010 4:56 pm    Post subject:
Reply with quote

Quote:
Requirement is 01A PIC X(2) value '**'
Now second variable is 01 B PIC X(100)
restriction is that without using intilization variable or move statement
the value of a store into B with all 100 picture clause
Your requirement cannot be satisfied. Initialization or MOVE is required to do this. How many times will we have to tell you before you understand this?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Apr 27, 2010 5:15 pm    Post subject:
Reply with quote

Quote:
...without movement
varable A whose pic clause contain X(2) value ** will also move...



without movement ... will also move

what kind of stupidity is this?

[START PERSONAL OPINION]

what a useless question.

[END PERSONAL OPINION]
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7908
Location: Bellevue, IA

PostPosted: Tue Apr 27, 2010 5:32 pm    Post subject:
Reply with quote

Quote:
what kind of stupidity is this?
It's crazy talk, Dick, that's what it is! icon_smile.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Apr 27, 2010 5:48 pm    Post subject:
Reply with quote

Why is there a restriction on what you can or cannot use to achieve the goal.
Who was stupid enough to post this restriction.

Is this an interview / homework question.
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: Tue Apr 27, 2010 9:27 pm    Post subject:
Reply with quote

Hello,

Quote:
Is this an interview / homework question.
Most likely - and a fairly meaningless one at that - as posted. . .

Possibly the interviewer asked something similar and this is what made it to the forum. . .

Once upon a time one could propogate the *'s by using something like the following. . .

Code:
01  B. 
    03  FILLER PIC X(02) VALUE '**'.
    03  A      PIC X(98).

    MOVE B TO A.


This worked due to the way the mvc was processed internally. . .

Actually, only 1 * was needed. . .
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 to move a long alphanumeric data ... lind sh COBOL Programming 6 Mon Dec 05, 2016 7:51 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm
No new posts Need information on COBOL MOVE CORRES... subratarec COBOL Programming 10 Tue Jun 28, 2016 10:38 pm
No new posts how to move view the remote file in o... mailtoashok CICS 2 Fri Feb 12, 2016 1:07 pm


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