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

Comp-3 Linkage variables having garbage data ?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Wed Dec 12, 2007 4:04 pm
Reply with quote

Hi,

I have comp-3 variables in the linkage of a called program (subroutine).

The called program has to retain the linkage variables' values for
successive calls to the subroutine.

On the first call to the subroutine the comp-3 variables are holding garbage data(invalid numeric data), eventhouh the corresponding variables in the calling program are properly initialised and have valid numeric data.

Please suggest how to proceed.

Thank you,
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed Dec 12, 2007 4:38 pm
Reply with quote

Did you get S0C7 abend?

Please explain in detail.
Back to top
View user's profile Send private message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Wed Dec 12, 2007 4:44 pm
Reply with quote

Yes , got S0c7 abend..
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed Dec 12, 2007 4:58 pm
Reply with quote

Simply, S0C7 abend is because of Invalid data in Numeric field.

Possible causes for this abend include:
Subscript error, referenced beyond table

COBOL: working storage not initialized.

bad data, should check data for errors.

garbage in a field being tested or displayed.

'move zeroes' to group level is display,

had sublevels that were not
period missing after imperative statements within AT
END clause.

binary field in an arithmetic operation is not large
enough to accept result.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Dec 12, 2007 5:00 pm
Reply with quote

Static or Dynamic Link?
What does the CALL statement look like?
What does the PROCEDURE DIVISION USING statement look like?
What do your Linkage Section definitions look like?
Back to top
View user's profile Send private message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Wed Dec 12, 2007 5:50 pm
Reply with quote

Im using Charm as version control tool.

The program is Static linked. The load module of calling program(main
program) has load modules of all the subroutines.

As indicated earlier, the data passed in the calling program to subroutine
just before the call has valid numeric data. The corrupt data is present in
the begining of execution of subroutine.

The garbage data is not found for fields declared s9(09)v9(02),
garbage data is found for the fields declared s9(09)v9(02) comp-3
only.

the programs are compiled with COBOL370 - 24 bit.

Proc division using {variable names (01 level)}.

call 'pgm-name' using {variable names (01 level)}.

Linkage section consits the corresponding 01 levels.

Please let me know if exact code is required.
Back to top
View user's profile Send private message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Wed Dec 12, 2007 6:58 pm
Reply with quote

One more observation is that the copy book variables in the linkage section are passed correctly.
Back to top
View user's profile Send private message
tangentray

New User


Joined: 30 Dec 2006
Posts: 20
Location: Kolkata, India

PostPosted: Wed Dec 12, 2007 8:00 pm
Reply with quote

could you please post the "call" statement and the "procedure division using" statement?

maybe you have the order of variables passed wrong by some chance?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Dec 12, 2007 8:16 pm
Reply with quote

maybe your archaic static link methodology has an older version of the CALLed module. Browse the load module to insure the correct version of the CALLed module has been bound. You can see the date; Browse the load module and do a FIND on the CALLed module name.

Quote:

One more observation is that the copy book variables in the linkage section are passed correctly


then you should not have any problem.
Back to top
View user's profile Send private message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Wed Dec 12, 2007 8:24 pm
Reply with quote

hi, the issue is resolved, solution looks strange ,,,

instead of declaring the numeric data to be passed to subroutines directly in working storage section,,, declared the numeric data in a copy book.
and then passed the copy book 01 level to the subroutine,,,

This was not the case in my previous shop...

Any gueses for this behaviour... ?
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Wed Dec 12, 2007 8:53 pm
Reply with quote

I am glad you got it working. In order to know what was happening we would need to see the call statement and the definitions of the fields being passed (from the calling program) and the the linkage section and procedure statement (from the called program).
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Dec 12, 2007 9:47 pm
Reply with quote

Sasi Kiran Patha wrote:
The garbage data is not found for fields declared s9(09)v9(02),
garbage data is found for the fields declared s9(09)v9(02) comp-3
only.


Please note that when you look at comp-3 data, it may appear as "garbage" if you don't know how comp-3 data is stored! Do you know how comp-3 data is stored?
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: Thu Dec 13, 2007 1:58 am
Reply with quote

Hello,

If the calling program has a field defined zoned-decmal and the called module has the "same" field defined as packed-decimal, it will "always" abend. . .

If you changed both sets of code to use the same copybook, you eliminated the mis-match.
Back to top
View user's profile Send private message
Sasi Kiran Patha
Warnings : 2

New User


Joined: 19 Nov 2006
Posts: 73
Location: Hyederabad

PostPosted: Fri Dec 14, 2007 10:44 am
Reply with quote

hi all,

Mr. dick scherrer,

I checked for variable name mismatch and data type mismatch.
There was no mismatch.

Mr. Craq Giegerich,

I have viewed the comp-3 variables' values in xpeditor.

Mr. Douglas Wilder,

Linkage is a bit long... but i will post it in next reply.
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 14, 2007 8:30 pm
Reply with quote

Hello,

When you moved the data elements to the 01, they would become aligned differently. I don't recall an alignment requirement for comp-3 fields, but memory fades. . . icon_confused.gif

It has been quite a while since i've seen code that didn't use one or more level-01s when issuing the call.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Dec 15, 2007 11:47 pm
Reply with quote

Hi Sasi,

What are the Hex values of the "garbage" data you're receiving
(e.g. X'3C000467')? Sometimes it's shown as:
Code:
JUNK
3006
C047

Revised by Jack
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 How to save SYSLOG as text data via P... All Other Mainframe Topics 2
No new posts Store the data for fixed length COBOL Programming 1
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top