Author |
Message
|
bvasanth |
Posted: Wed May 12, 2004 1:36 am Post subject: MQ-CICS Bridge - Pseudo-Conversion and ADS |
|
|
Apprentice
Joined: 03 May 2004 Posts: 27 Location: Chennai, India
|
I am connecting CICS 3270 transaction from a plain java program. I have successfully sent a CICS 3270 transaction code in MQCIH, and got the front screen Mapset and map name from 3270 transaction. Then I choose one option in the menu, and construct RECEIVE MAP vector and Applicationm Data Structure (ADS). This message is not gettign executed succesfully. I am getting abend in log MBRF in program DFHXMAB term ????. I am not able to debug. Instead of sending data in ADS, I sent another RECEIVE MAP vector with key press PF12 to exit application. This message is getting executed by CICS bridge. Hence it appears that there is some problem in ADS. For a note: My java client is in Win2k, and 3270 transaction is obviously on MVS. I am not sending or receiving any ADSD or ADSDL. Is that a problem?.
(When should I use ADSD/ADSDL? Are they absolutley necessary?)
Thanks,
Vasanth |
|
Back to top |
|
 |
bob_buxton |
Posted: Wed May 12, 2004 7:26 am Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
MBRF abend code is issued for unexpected return code from an MQGET.
Possibly it is an error in the message correlid or perhaps the message length was too long, it is not issued for errors in the ADS.
The bridge abend codes are listed in the MQ messages and codes book in chapter 49.
You don't need the ADSD/ADSDL if your application understands the structure of the map data it is sending/receiving. You can request the ADSD/ADSDL be returned if you want to be told the names of the fields, field lengths etc.
You need to use the long form of the ADS (ADSL) MCADSD_MSGFORMAT if you are building message in ASCII and expecting MQ to do ASCII-EBCDIC conversion. You can use the short form if you do your own conversion of data . _________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
bvasanth |
Posted: Wed May 12, 2004 6:51 pm Post subject: |
|
|
Apprentice
Joined: 03 May 2004 Posts: 27 Location: Chennai, India
|
Thanks for reply.
A manual says that If the MQSeries application is on a platform other than MVS, the message must be converted between EBCDIC and the code page of the local platform and BMS maps should be assembled using DSECT=ADSL if your client is on other than MVS. It also mentions that only C copybooks are supported for ADSL, and you have to manually create ADSL for COBOL based on C version. Does that mean I have to code ADSL copybook for COBOL and recompile my CICS programs so that I can send ADS from client to MQ in long format? |
|
Back to top |
|
 |
bob_buxton |
Posted: Thu May 13, 2004 12:39 am Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
No changes at all are required to your CICS applications.
The COBOL ADSL comments are only relevant if you were coding your workstation client application in COBOL (some people do). Conversion
between long and short forms of the ADS is done by the bridge. _________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
bvasanth |
Posted: Thu May 13, 2004 1:20 am Post subject: |
|
|
Apprentice
Joined: 03 May 2004 Posts: 27 Location: Chennai, India
|
I used ADSL format in my java client, and CICS transaction is getting executed. But encounter a problem. My map has two fields HEADER (LENGTH:20) and ACCOUNTNUMER (LENGTH:5). CICS reads only the HEADER field data, but does not read ACCOUNTNUMBER. This is my receive map vector with ADSL: CICS transaction is reading any value that I give in HEADER field, but doesn;t read anything from ACCOUNTNUMBER field.
Code: |
//Receive Map vector starts here
msg.writeInt(168); //Vector Length - includes ADSL data
msg.writeString("1802"); //Receive Map
msg.writeString("I "); //I Indicates Inbound
msg.writeString("0000"); //Vector Version
msg.writeString("Y "); // includes 3 blanks to right
msg.writeString("MLNMP01 "); //MAPSET name
msg.writeString("DETAILS "); //MAP name
msg.writeString(ENTER); //AID KEY - single quote for ENTER
msg.writeInt(593); //cur pos
msg.writeInt(120); //Data length including 12 reserved bytes
//ADSL starts here
msg.writeString(" "); //12 reserved bytes
msg.writeInt(60); //offset to next field
msg.writeInt(0); //attributes
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeString("1 "); //header of length 20-- data is 1
msg.writeInt(48); //offset to next field
msg.writeInt(0); //attributes
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeString("12345"); //account number of length 5
msg.writeString(" "); //3 empty bytes to align to full word
|
Can you help to fine error?
Thanks,
Vasanth |
|
Back to top |
|
 |
bob_buxton |
Posted: Thu May 13, 2004 2:24 am Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
It appears that you are not setting the input data length (the line labeled attributes) in your code. See the brmq_adsl_input_field mapping in dfhbrmqh.h header file. You could also set the modified data flag but I don't think this is critical. _________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
bvasanth |
Posted: Thu May 13, 2004 4:18 am Post subject: |
|
|
Apprentice
Joined: 03 May 2004 Posts: 27 Location: Chennai, India
|
I have changed data length attribute also (see line marked //data length below) for both fields. still CICS application is not able to read beyond first field i.e HEADER field in this case. I have also tried setting value 1 in modified flag (marked //flag below), still not working.
I had put display statements in my CICS application for map's record, and program displays (in CICS job's CEEMSG) entire data of HEADER field, but next to it some chars (like & <)are present which are not ACCOUNTNMBER DATA.
Here is the modified code with lenght data.
Code: |
//Receive Map vector starts here
msg.writeInt(168); //Vector Length - includes ADSL data
msg.writeString("1802"); //Receive Map
msg.writeString("I "); //I Indicates Inbound
msg.writeString("0000"); //Vector Version
msg.writeString("Y "); // includes 3 blanks to right
msg.writeString("MLNMP01 "); //MAPSET name
msg.writeString("DETAILS "); //MAP name
msg.writeString(ENTER); //AID KEY - single quote for ENTER
msg.writeInt(593); //cur pos
msg.writeInt(120); //Data length including 12 reserved bytes
//ADSL starts here
msg.writeString(" "); //12 reserved bytes
msg.writeInt(60); //offset to next field
msg.writeInt(20); //data length
msg.writeInt(0); //flag
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeString("1 "); //header of length 20-- data is 1
msg.writeInt(48); //offset to next field
msg.writeInt(5); //data length
msg.writeInt(0); //flag
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeString("12345"); //account number of length 5
msg.writeString(" "); //3 empty bytes to align to full word
|
Note: I have set ADSdescriptor in CIH as 256 to indicate long format and MQ format in CIH as CSQCBDCI. Message (in java program) Encoding is MQENC_NATIVE and characterset id is set to 819 (I also tried 1252).
Am I missing any other point?
Thanks
Vasanth |
|
Back to top |
|
 |
bvasanth |
Posted: Thu May 13, 2004 8:58 pm Post subject: |
|
|
Apprentice
Joined: 03 May 2004 Posts: 27 Location: Chennai, India
|
Bob Buxton:
After I gave length in length field (marked //data length below), cobol record of map equivalent assumes correct length (value 5 that i passed in client pgm) in ACCOUNTL variable. But other data field ACCOUNTI does not take what I set in my client program. It takes some junk values.
Code: |
//Java client code for 2nd field
msg.writeInt(48); //offset to next field
msg.writeInt(5); //data length
msg.writeInt(0); //flag
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeInt(0);
msg.writeString("ABCDE"); //Alpha account number of length 5 msg.writeString(" "); //3 empty bytes to align to full word
//Below is map equivalent COBOL copybook for 2nd field
02 ACCOUNTL COMP PIC S9(4).
02 ACCOUNTF PICTURE X.
02 FILLER REDEFINES ACCOUNTF.
03 ACCOUNTA PICTURE X.
02 FILLER PICTURE X(2).
02 ACCOUNTI PIC X(5).
|
ACCOUNTL gets the value 5 as I set in client program. But ACCOUNTI has some junk hex values x'4142434445' Remember that first field holds correct data.
What could be the problem? |
|
Back to top |
|
 |
bob_buxton |
Posted: Fri May 14, 2004 12:17 am Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
4142434445 is not a junk value it is ABCDE in ASCII!
So the problem is that ASCII-EBCDIC conversion hasn't been performed.
What CodedCharSetId values are you putting into the MQMD and MQCIH, headers it should be MQCCSI_INHERIT.
I will also point out at his time that you will need the CONVERT=YES attribute on the sender channel from zOS to your Windows system to ensure that reply messages are converted into ASCII. _________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
bvasanth |
Posted: Fri May 14, 2004 12:40 am Post subject: |
|
|
Apprentice
Joined: 03 May 2004 Posts: 27 Location: Chennai, India
|
1) I had my CCSID in messages as 819, and have changed now to MQCCSI_INHERIT. When I run my program, I got MQException: IOException: java.io.UnsupportedEncodingException: -Cp-2.
Encoding set in my message is MQENC_NATIVE.
Should I change to something else?
2) For CONVERT=YES: My java client directly puts the messages into application queue on OS/390. I do not have any MQ set up in my win2k system. So I am not using any sender channel, so I can't set CONVERT=YES. Should I go for double MQ server set up: one on win2k and another on OS/390 and establish channel between them?
3) How come the data in first field (in ADSL) alone is getting converted correctly and used by CICS application? |
|
Back to top |
|
 |
DonBrady |
Posted: Sun Jun 06, 2004 6:13 am Post subject: |
|
|
Newbie
Joined: 06 Jun 2004 Posts: 1
|
Thanks for the comments in this thread - they are very helpful.
Like Vasanth, I also am interested in calling a CICS 3270 transaction in Java.
Does anyone know of any sample Java code anywhere for accessing the ADSL vectors etc?
Feel free to post here, or email me if you prefer.
Thanks!
Don Brady
dbrady@pobox.com |
|
Back to top |
|
 |
bvasanth |
Posted: Tue Jun 08, 2004 4:47 am Post subject: |
|
|
Apprentice
Joined: 03 May 2004 Posts: 27 Location: Chennai, India
|
Regarding point #3 in my earlier posting, a data conversion exit has a issue that causes non-conversion of data from ASCII to EBCDIC from 2nd map field onwards. This had been identified and raised as PMR with IBM. Till such time, I convert the data from ASCII to EBCDIC in my java client program from 2nd map field onwards with first field remains ASCII.
Thanks. |
|
Back to top |
|
 |
|