View previous topic :: View next topic
|
Author |
Message |
santosh100678
New User
Joined: 21 Sep 2009 Posts: 55 Location: Kolkatta
|
|
|
|
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 |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
Hi Santhosh,
have you tried the usage of VALUE ALL while declaring the variable. |
|
Back to top |
|
|
smijoss
Active User
Joined: 30 Aug 2007 Posts: 114 Location: pune
|
|
|
|
01 B pic x(100) value all '*'.
this will fill B with *. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
santosh100678
New User
Joined: 21 Sep 2009 Posts: 55 Location: Kolkatta
|
|
|
|
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 |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
Quote: |
restriction is that without using intilization variable or move statement |
can u tell us why you are "restricted". ... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
what kind of stupidity is this? |
It's crazy talk, Dick, that's what it is! |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|