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

Regarding COMP5


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
madhand

New User


Joined: 04 May 2005
Posts: 10

PostPosted: Sat Jul 30, 2011 7:46 pm
Reply with quote

Hi,

I am facing a problem in populating a COMP-5 variable.We have a webservice and we have a copybook in the mainframe side which is connected to a webservice thru a pipeline.The data is being moved from mainframe to webside using a webservice.The data is populated correctly in Mainframe but when it is moved to the web side(Chordiant),we get some junk characters.
Declaration currently used in Mainframe : S9(4)
S9(8) COMP-5 SYNC.

We tried giving S9(8) COMP-5 SYNC in the mainframe copybook also.We are able to get the results as expected when the data is outside the array.But within the array we once again get junck values.Can anyone help? We tried giving various lengths in the mainframe application copybook.Please suggest.

Thanks
Madhan.
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: Sat Jul 30, 2011 8:01 pm
Reply with quote

Hello,

Quote:
The data is populated correctly in Mainframe but when it is moved to the web side(Chordiant),we get some junk characters.
Post a bit of data (in hex) from the mainframe and the same data on the web side (also in hex).

Then we may be able to talk specifics.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Jul 30, 2011 8:19 pm
Reply with quote

no such thing as junk characters.

are you attempting to send a binary field from the mainframe to another platform? in this case a 'webservice'.

you will save yourself a lot of grief if you would convert the binary to numeric display on the mainframe - then send that.

code page interpretation, ebcdic to ascii - all that translation will eat you alive unless you stick to basic numeric and alpha.

sync only has a meaning for mainframe memory assignment.

all you are doing when you send a datasteam which is composed of 'syncd' fields is creating a headache for the reciever. sync will generate gaps (potentially) between fields, and the reciever can not expect contiguous fields in the datastream.
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: Sat Jul 30, 2011 8:23 pm
Reply with quote

Quote:
we have a copybook in the mainframe side which is connected to a webservice thru a pipeline.
This makes absolutely no sense. A copybook is a piece of source code that is inserted into a program when it is compiled. There is absolutely no way a copybook has ANYTHING to do with an executing program. Terminology is critical in IT, where similar terms may mean very different things. And, obviously, "COPYBOOK" does not mean whatever YOU think it does.

How are you converting the COMP-5 data from EBCDIC on the mainframe to ASCII on the web side? Binary data cannot just be converted willy-nilly from EBCDIC to ASCII since that usually means the hexadecimal values of each byte change, and the value of the binary data is in those hexadecimal values.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Jul 30, 2011 9:21 pm
Reply with quote

madhand,

Try it this way.

Imagine your comp-5 has a value of 193.

Run it from the mainframe to the web.

The value on the web will be 65.

Why? 193 = C1 = "A", in EBCDIC.

"A" in ASCII is 65. So as it gets converted from EBCDIC, the displayable value remains "A" but the numeric value of the byte changes from 193 to 65.

"Displayble" values will be successfully converted from EBCDIC to ASCII (and vice-versa) but the numeric value of the byte for all those characters is different in the two systems.

If you want to get your values through, follow the advice already given. If you don't believe it, try this sort of example.

What did you think the SYNC would do for you? Look up SYNCHRONIZED in the Cobol manuals (link at the top of the page to Manuals). If you don't understand, explain what you do get, and what you don't, and someone here will clarify.

As has been said, there is no such thing as "junk values". I don't know how this idea (junk values) got to be so widespread. There might be "values you don't understand", but nothing is junk. Everything, every byte, is just a value from 0 to 255, which means different things in different contexts. If you don't understand how a value came about, don't just dismiss it as "junk", but admit that you don't understand it.

Once you understand how the value got that way, you'll realise it is not "junk". The value itself won't have changed, but your perception, your understanding. If you want to understand the "junk" you have to admit that it is you who doesn't understand it, not just promote to us the passive situation of some bytes having "junk" in just to upset your system.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sun Jul 31, 2011 6:04 pm
Reply with quote

Bill Woodger wrote:
there is no such thing as "junk values". I don't know how this idea (junk values) got to be so widespread. There might be "values you don't understand", but nothing is junk. Everything, every byte, is just a value from 0 to 255, which means different things in different contexts. If you don't understand how a value came about, don't just dismiss it as "junk", but admit that you don't understand it.

Once you understand how the value got that way, you'll realise it is not "junk". The value itself won't have changed, but your perception, your understanding. If you want to understand the "junk" you have to admit that it is you who doesn't understand it, not just promote to us the passive situation of some bytes having "junk" ...[ that ] ... upset your system


i nominate this as the First Response to the
Quote:
I got junk values ...
posts.
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts COMP5 and COMP6 COBOL Programming 1
Search our Forums:

Back to Top