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

Getting SOC7 in Comp3 field


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
diwakarsen

New User


Joined: 04 Jul 2007
Posts: 3
Location: india

PostPosted: Fri Dec 12, 2008 10:43 am
Reply with quote

Hi, I have one Query which is related to SOC7

We have one date filed defined in the program as below



FIELD1-DATE PIC S9 (09) COMP-3.

FIELD1-DATEX REDEFINES FIELD1-DATE

PIC X (05).



The value in the file corresponding to this field in hexadecimal is



FIELD1-DATE FIELD1-DATEX

5/PS 5/AN

(972-976) (972-976)R

255-------------- 256---------------



00000 00000

000C0 000C0



The program is written like below.



IF FIELD1-DATEX NOT EQUAL SPACES OR LOW-VALUES

IF FIELD1-DATE EQUAL ZEROES - GETTING SOC7 ABEND IN THIS LINE

MOVE ZEROES TO FIELD1-DATE

ELSE

DISPLAY ‘ERROR’

END-IF

END-IF.



I need to check in the program that if FIELD1-DATE is neither SPACES nor LOW-VALUES then whether FIELD1-DATE contains zero or some other value. Can you help me? I need the solution of this ASAP.



Thanks.

Diw
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Dec 12, 2008 11:16 am
Reply with quote

Hello Diw and welcome to the forum,

After the test for spaces and low values, you need to check if the field is numeric. If the field is not numeric, don't check for zeros or any other number as that will cause the 0c7. If the field is numeric, continue validating any numeric values that need to be checked.
Back to top
View user's profile Send private message
diwakarsen

New User


Joined: 04 Jul 2007
Posts: 3
Location: india

PostPosted: Fri Dec 12, 2008 11:51 am
Reply with quote

Thanks a ton Dic :lol:
Back to top
View user's profile Send private message
diwakarsen

New User


Joined: 04 Jul 2007
Posts: 3
Location: india

PostPosted: Fri Dec 12, 2008 12:38 pm
Reply with quote

Thanks for the quick response.

But i want to know one thing that what was that value which i mentioned above if it is neither SPACES nor LOW-VALUES. i.e. in hex form
00000
000c0

Please let me know.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Dec 12, 2008 12:44 pm
Reply with quote

diwakarsen wrote:
icon_lol.gif
What joke happened here ?
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: Fri Dec 12, 2008 5:59 pm
Reply with quote

Quote:
But i want to know one thing that what was that value which i mentioned above if it is neither SPACES nor LOW-VALUES. i.e. in hex form
00000
000c0
This value is not a zero -- it's actually invalid COMP-3 data. A valid COMP-3 value of zero would be
Code:
00000
0000C
From the looks of it, I'd say either the layout is wrong (possibly an error in a copybook?) or the file flat out has invalid data in it.
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 Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts S0C7 - Field getting overlayed COBOL Programming 2
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
Search our Forums:

Back to Top