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
 

 

why a data item of usage type comp donot accept values

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

New User


Joined: 21 Mar 2007
Posts: 26
Location: kerala

PostPosted: Fri Apr 20, 2007 9:33 am    Post subject: why a data item of usage type comp donot accept values
Reply with quote

hi,

please tell why a data item declared as

01 A pic 9(4) comp do not accept values through accept verb.
Back to top
View user's profile Send private message

achusarath

New User


Joined: 21 Mar 2007
Posts: 26
Location: kerala

PostPosted: Fri Apr 20, 2007 9:35 am    Post subject: Re: why a data item of usage type comp donot accept values
Reply with quote

Code:
DENTIFICATION DIVISION.     
  PROGRAM-ID. XYZ.             
  DATA DIVISION.               
  WORKING-STORAGE SECTION.     
  01 A PIC 9(4) COMP.         
  PROCEDURE DIVISION.         
  P1.                         
      ACCEPT A               
      DISPLAY A.             
      STOP RUN.           
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Apr 20, 2007 12:25 pm    Post subject:
Reply with quote

Hi achu

It should work correctly.As far as I know there is no restriction to ACCEPT as per the datatype.What is the value you are trying to enter??Are you getting any error message?
Thanks
Arun
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Fri Apr 20, 2007 1:26 pm    Post subject: Re: why a data item of usage type comp donot accept values
Reply with quote

Quote:
As far as I know there is no restriction to ACCEPT as per the datatype

No you can not.

ACCEPT is only capable of handling BYTE streams, not binary(COMP) data.
It is not allowed to code COMP field in ACCEPT 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: Fri Apr 20, 2007 1:43 pm    Post subject:
Reply with quote

arcvns wrote:
It should work correctly.As far as I know there is no restriction to ACCEPT as per the datatype.
You really should double check the Fine Manual prior to making such a broad statement.
"identifier-1
Can be a group item or an elementary alphabetic, alphanumeric, alphanumeric-edited, numeric-edited, external decimal, DBCS, national, or external floating-point data item."
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Apr 20, 2007 2:01 pm    Post subject:
Reply with quote

Hi all

Thanks for correcting me
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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am


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