Skip to content

Commit f88af95

Browse files
authored
Merge pull request #1 from cicsdev/branch1
Remove use of local CCSID
2 parents 77c05db + e6db4a6 commit f88af95

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

src/main/java/com/ibm/cicsdev/springboot/jcics/BrowseTSQController.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
@RestController
2626
public class BrowseTSQController {
2727

28-
// EBCDIC encoding of the CICS system used to create byte array for the holder object
29-
private static String LOCAL_CCSID = System.getProperty("com.ibm.cics.jvmserver.local.ccsid");
30-
3128
/**
3229
* The @GetMapping annotation ensures that HTTP GET requests to the /browseTSQs URL path are
3330
* mapped to the annotated method.
@@ -65,14 +62,14 @@ public String browseTSQs(@RequestParam(value = "tsqName", defaultValue = "ANNE")
6562
* @throws UnsupportedEncodingException
6663
*/
6764
private ArrayList<String> browseTSQ(String tsqName) throws CicsConditionException, UnsupportedEncodingException {
68-
// An ArrayList to hold all of the items read from TSQ to be returned to the Servlet.
65+
// An ArrayList to hold all of the items read from TSQ to be returned to the servlet.
6966
ArrayList<String> records = new ArrayList<String>();
7067

7168
// construct a JCICS representation of the TSQ object
7269
TSQ tsqQ = new TSQ();
7370
tsqQ.setName(tsqName);
7471

75-
// The holder object will hold the byte array that is read from the TSQ.
72+
// the holder object will hold the byte array that is read from the TSQ
7673
ItemHolder holder = new ItemHolder();
7774

7875
// initialize loop variables
@@ -83,18 +80,16 @@ private ArrayList<String> browseTSQ(String tsqName) throws CicsConditionExceptio
8380
// read an item and store the total number of items on the queue
8481
totalItems = tsqQ.readItem(itemPos, holder);
8582

86-
// Add the record to the ArrayList to be returned
87-
recordStr = new String(holder.getValue(), LOCAL_CCSID);
83+
// get string from the holder byte[] - defaults to using EBCDIC encoding of CICS region
84+
// then add the record to the ArrayList to be returned
85+
recordStr = holder.getStringValue();
8886
records.add(recordStr);
8987

90-
// iterate over the remaining items and add them to the ArrayList
88+
// iterate over the remaining items and add to the ArrayList
9189
while (itemPos < totalItems) {
9290
tsqQ.readNextItem(holder);
93-
94-
// Add the record
95-
recordStr = new String(holder.getValue(), LOCAL_CCSID);
91+
recordStr = holder.getStringValue();
9692
records.add(recordStr);
97-
9893
itemPos++;
9994
}
10095

src/main/java/com/ibm/cicsdev/springboot/jcics/TSQInfoController.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public String TSQInfos(@RequestParam(value = "tsqName", defaultValue = "ANNE") S
5151

5252
}
5353

54-
5554

5655
/**
5756
* A method to obtain the name of the TSQ.

0 commit comments

Comments
 (0)