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
 

 

Comp-3 Linkage variables having garbage data ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Comp-3 Linkage variables having garbage data ?
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: 785
Location: Chennai, India

PostPosted: Wed Dec 12, 2007 4:38 pm    Post subject:
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    Post subject: Reply to: Comp-3 Linkage variables having garbage data ?
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: 785
Location: Chennai, India

PostPosted: Wed Dec 12, 2007 4:58 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Comp-3 Linkage variables having garbage data ?
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Comp-3 Linkage variables having garbage data ?
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Dec 13, 2007 1:58 am    Post subject:
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    Post subject: Reply to: Comp-3 Linkage variables having garbage data ?
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

Site Director


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

PostPosted: Fri Dec 14, 2007 8:30 pm    Post subject:
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    Post subject:
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    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 Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm


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