× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Thomas,

I don't use PCML, (last time I've had a look to it, it allowed only int as return parm),

maybe the problem might be, that RQD0100 Format is using a dynamic structure (some sort of chained list) for the message data (each message has its own length).
My aproach is to use PORDS2POJO (plain old RPG datastructure [AKA binary huddle] to plain old java object) Beans.
For RQD100 it looked like:
<hint: as I only needed the header data, you would have to write another PORDS2POJO for the message entrie with its getters>
<additional hint: these PORDS2POJO are only one way. bidirectional beans would have getHuddle() and setters for all needed components>
<last hint: DataStructure is a convinience object used as a Facade for the strange (you could throw in all you want and it will burst, if you want to get it back) and ugly jt400 stuff>

best regards Dieter

public class RDQD0100Format extends DataStructure {
private byte[] huddle;
private int bytesReturned;
private int bytesAvailable;
private int messageLength;
private int keyLength;
private String sequence;
private String includeSenderId;
private String forceIndicator;
private String typeOfDataQ;
private String automaticReclaim;
private String description;
private int numberOfMessages;
private int numberOfEntriesAllocated;
private String dataQName;
private String dataQLibName;
private int maximumNumberOfEntriesAllowed;
private int initialNumberOfEntries;
private int maximumNumberOfEntriesSpecified;

public RDQD0100Format(byte[] huddle) {
super(500);
setHuddle(huddle);
}

public String getAutomaticReclaim() {
return automaticReclaim;
}

public int getBytesAvailable() {
return bytesAvailable;
}

public int getBytesReturned() {
return bytesReturned;
}

public String getDataQLibName() {
return dataQLibName;
}

public String getDataQName() {
return dataQName;
}

public String getDescription() {
return description;
}

public String getForceIndicator() {
return forceIndicator;
}

public String getIncludeSenderId() {
return includeSenderId;
}

public int getInitialNumberOfEntries() {
return initialNumberOfEntries;
}

public int getKeyLength() {
return keyLength;
}

public int getMaximumNumberOfEntriesAllowed() {
return maximumNumberOfEntriesAllowed;
}

public int getMaximumNumberOfEntriesSpecified() {
return maximumNumberOfEntriesSpecified;
}

public int getMessageLength() {
return messageLength;
}

public int getNumberOfEntriesAllocated() {
return numberOfEntriesAllocated;
}

public int getNumberOfMessages() {
return numberOfMessages;
}

public String getSequence() {
return sequence;
}

public String getTypeOfDataQ() {
return typeOfDataQ;
}

public void setHuddle(byte[] huddle) {
byte[] work;
this.huddle = huddle;
bytesReturned = aS400Bin4ToInt(huddle, 0);
bytesAvailable = aS400Bin4ToInt(huddle, 4);
messageLength = aS400Bin4ToInt(huddle, 8);
keyLength = aS400Bin4ToInt(huddle, 12);
work = new byte[1];
work[0] = huddle[16];
sequence = aS400TextToString(work);
work[0] = huddle[17];
includeSenderId = aS400TextToString(work);
work[0] = huddle[18];
forceIndicator = aS400TextToString(work);
work[0] = huddle[69];
typeOfDataQ = aS400TextToString(work);
work[0] = huddle[70];
automaticReclaim = aS400TextToString(work);
work = new byte[50];
System.arraycopy(huddle, 19, work, 0, 50);
description = aS400TextToString(work);
numberOfMessages = aS400Bin4ToInt(huddle, 72);
numberOfEntriesAllocated = aS400Bin4ToInt(huddle, 76);
work = new byte[10];
System.arraycopy(huddle, 80, work, 0, 10);
dataQName = aS400TextToString(work);
System.arraycopy(huddle, 90, work, 0, 10);
dataQLibName = aS400TextToString(work);
maximumNumberOfEntriesAllowed = aS400Bin4ToInt(huddle, 100);
initialNumberOfEntries = aS400Bin4ToInt(huddle, 104);
maximumNumberOfEntriesSpecified = aS400Bin4ToInt(huddle, 108);
}
}




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.