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
 

 

Shell we MOVE SPACES to the COMP and COMP-3 values

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

New User


Joined: 12 Oct 2006
Posts: 32
Location: India

PostPosted: Thu Nov 30, 2006 6:32 pm    Post subject: Shell we MOVE SPACES to the COMP and COMP-3 values
Reply with quote

Hi,

Shell we MOVE SPACES to the COPM and COMP-3 values.

Just for writing in a file .
Back to top
View user's profile Send private message

cobolunni

Active User


Joined: 07 Aug 2006
Posts: 128
Location: kerala,india

PostPosted: Thu Nov 30, 2006 7:01 pm    Post subject: Re: Moving spaces doubt
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Nov 30, 2006 7:25 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Thu Nov 30, 2006 7:34 pm    Post subject: Re: Moving spaces doubt
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Nov 30, 2006 9:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Dec 01, 2006 1:02 am    Post subject: Re: Shell we MOVE SPACES to the COMP and COMP-3 values
Reply with quote

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
View user's profile Send private message
sandip_mainframe
Warnings : 2

New User


Joined: 20 Sep 2006
Posts: 61
Location: pune

PostPosted: Fri Dec 01, 2006 10:11 am    Post subject: Shell we MOVE SPACES to the COMP and COMP-3 values
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Dec 02, 2006 8:55 am    Post subject:
Reply with quote

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
View user's profile Send private message
vijay_bn79

New User


Joined: 20 Nov 2006
Posts: 48
Location: Hyderabad

PostPosted: Tue Dec 05, 2006 10:37 am    Post subject: Re: Shell we MOVE SPACES to the COMP and COMP-3 values
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Tue Dec 05, 2006 11:13 am    Post subject:
Reply with quote

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
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 Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm


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