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
 

 

S9(4)V9(5) COMP-3

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

New User


Joined: 16 Sep 2006
Posts: 27
Location: Hyderabad

PostPosted: Mon Nov 02, 2009 6:01 pm    Post subject: S9(4)V9(5) COMP-3
Reply with quote

How to display S9(4)V9(5) COMP-3
I used S9(4)V9(5) in my p/p variable but am facing S0C7 abend.
I want to display the input variable S9(4)V9(5) COMP-3
so suggest me the pic clause to be given for my o/p variable.
Back to top
View user's profile Send private message

Binop B

Active User


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

PostPosted: Mon Nov 02, 2009 6:17 pm    Post subject:
Reply with quote

Hi Prashant,

You could redefine the field as characters and display/write to see the content.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8119
Location: East Dubuque, Illinois, USA

PostPosted: Mon Nov 02, 2009 6:30 pm    Post subject:
Reply with quote

The S0C7 implies invalid data in the field (as long as the S0C7 is occurring on your DISPLAY) -- either redefine as PIC X and display that, or do an IF NUMERIC test before your display and use an ELSE to display an invalid data message.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Nov 02, 2009 6:34 pm    Post subject:
Reply with quote

you could implement Binop's excellent suggestion:
Code:

IF comp-3_field NUMERIC
THEN
    DISPLAY comp-3_field_redefined_as_x-type   record_counter
END-IF

then you would only be displaying the non-numeric fields instead of every record.

There is also a way to do it with DFSORT (search the DFSORT forum),
then you would not need to modify your program.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Nov 02, 2009 7:15 pm    Post subject:
Reply with quote

whoops,
I have yet again made a post duplicating that of Robert.

sorry.
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 Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Need help to populate date in COMP-3 ... chetanambi DFSORT/ICETOOL 3 Tue Jun 21, 2016 12:25 pm
No new posts comparing comp-3 and unpacked numbers juares castro COBOL Programming 3 Mon May 30, 2016 6:46 pm
No new posts SIGNED DECIMAL TO COMP-3 using cobol ... ram_vizag COBOL Programming 1 Tue Mar 01, 2016 11:32 pm


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