IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

S9(4)V9(5) COMP-3


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Nov 02, 2009 6:30 pm
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: 6966
Location: porcelain throne

PostPosted: Mon Nov 02, 2009 6:34 pm
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: 6966
Location: porcelain throne

PostPosted: Mon Nov 02, 2009 7:15 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Interviewers are surprised with my an... Mainframe Interview Questions 6
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
No new posts convert alphanumeric PIC X(02) to hex... COBOL Programming 3
Search our Forums:

Back to Top