2121import com .ibm .cics .server .Container ;
2222import com .ibm .cics .server .ContainerErrorException ;
2323import com .ibm .cics .server .InvalidRequestException ;
24+ import com .ibm .cics .server .LengthErrorException ;
2425import com .ibm .cics .server .Program ;
2526import com .ibm .cics .server .Task ;
2627
@@ -113,15 +114,19 @@ public static void main(String[] args)
113114
114115 try {
115116 // Get output data from output container
116- String resultStr ;
117+ String resultStr = null ;
117118 int cicsrc ;
118119
119120 // Read CHAR container from channel container data as formatted string
120121 // CICS returns this in a UTF16 format and JCICS reads this into a String
121122 // Container object will be null if container not present
122123 Container charContainer = chan .getContainer (DATE_CONTAINER );
123124 if (charContainer != null ) {
124- resultStr = charContainer .getString ();
125+ try {
126+ resultStr = charContainer .getString ();
127+ } catch (LengthErrorException e ) {
128+ task .abend ("LENG" );
129+ }
125130 }
126131 else {
127132 // Missing response container
@@ -134,7 +139,12 @@ public static void main(String[] args)
134139 if (bitContainer != null ) {
135140
136141 // Obtain the RC as an int
137- byte [] ba = bitContainer .get ();
142+ byte [] ba = null ;
143+ try {
144+ ba = bitContainer .get ();
145+ } catch (LengthErrorException e ) {
146+ task .abend ("LENG" );
147+ }
138148 ByteBuffer bb = ByteBuffer .wrap (ba );
139149 cicsrc = bb .getInt ();
140150
0 commit comments