View previous topic :: View next topic
|
Author |
Message |
narasridhar
New User
Joined: 12 Oct 2006 Posts: 32 Location: India
|
|
|
|
Hi,
Shell we MOVE SPACES to the COPM and COMP-3 values.
Just for writing in a file . |
|
Back to top |
|
|
cobolunni
Active User
Joined: 07 Aug 2006 Posts: 127 Location: kerala,india
|
|
|
|
It is not possible to move spaces to comp and comp3 identifiers because comp is used in the case of numeric identifiers so as to increase the speed of arithmetic operations .So since it is not possible to insert a alphabetic value to numeric we cannot move spaces to comp field |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Yes, but only to a group name that the COMP and COMP3 fields contained in. The COMP value will be valid but the COMP3 filed willo not and could cause an abend. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi
You cant move spaces directly to a COMP or COMP-3 data item.But you can move spaces to a group-item having numeric sub-items
Thanks
Arun |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Nara,
As previous posters have indicated you can move SPACES to those fields. The more important ques is: should you?
Spaces in num fields can cause abends or incorrect results. If you have a good reason to do so, eval the pluses & minuses thoroughly and ask a supervisor if it's OK. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you are trying to save some lines of code by moving spaces to a group item that includes "comp" fields, you might look into the INITIALIZE statement.
I very much agree with the previous reply - - EVERYthing that uses the file (and references those "comp" fields will abend or need code to check for valid numerics to prevent the abend.
Hope this helps. . . .
d.sch. |
|
Back to top |
|
|
sandip_mainframe Warnings : 2 New User
Joined: 20 Sep 2006 Posts: 63 Location: pune
|
|
|
|
Hi,
it's not possible bscoz comp it is used for numerical fields and
we move spaces to alphabetic fields so that it is not possible. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Sandip,
One way spaces wind up in numeric fields is tha tsomeone gets the idea to clear a group field by moving spaces to it, as in the example below:
Code: |
05 var-05.
10 an-var-10 pic x(015).
10 pd-var-10 pic s9(005) comp-3.
move spaces to var-05 |
As a result pd-var-10 will contain 3 spaces and, of course an-var-10 will contain 15 spaces.
A group move is considered an A/n move regardless of how the elementary fields are defined. |
|
Back to top |
|
|
vijay_bn79
New User
Joined: 20 Nov 2006 Posts: 48 Location: Hyderabad
|
|
|
|
Hi..,
We can move spaces to COMP but not to COMP-3
COMP is a binary representation of data item, we can enter any thing, it will convert that into binary format and stores init.
But COMP-3 is in Packed decimal format it is not possible to move spaces to this |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi Vijay
We cant move SPACE to either COMP or COMP-3.You will get severe compile error in either case.You can check it yourself.
Code: |
62 IGYPA3005-S "SPACE" and "NUM4 (BINARY INTEGER)" did not follow the "MOVE" statement compatibility rules. The statement was discarded. |
Thanks
Arun |
|
Back to top |
|
|
|