Hello,
why do want to use the database directly? Do you know that you can use "ARSXML" for that type of information?? you can simply extract all application group, and take the the following attributes:
The XML to use with "arsxml" is the following:
<?xml version="1.0" encoding="UTF-8"?>
<onDemand xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ondemand.xsd">
<applicationGroup name="_ALL" />
</onDemand>
with the following command:
arsxml export -u user -p pwd -v -i inputXML.xml -o outputXML.xml
And you'll get something like that:
<applicationGroup name="ApplicationGroupName" updateDate="06/12/13 10:48:04" updateUserid="ADMIN" enableLoadDate="false" enableQueryDate="false" enableRetrieveDate="false" agid="5287" ag_identifier="VDA" storageSet="cmodduc" expirationType="Load" maxDBRows="10000000" loadsPerTable="Multiple" dbTablespaceType="Automatic Storage" dbCompress="false" annot="false" objectSize="10000" migrateIndexKeep="0" cacheData="true" docDataLen="1000" resDataLen="Always" restoreResources="true" expirationDate="2555" migrateCache="666" migrateIndex="Never" parameterMarkers="true" updateExistingTables="false" enhancedRetManagement="false" impliedHold="false" CFSOD="false" FTI="false" CMFed="false" logRetrieval="true" logBulkRetrieval="true" logDBQueriesBefore="false" logServerPrinting="true" logIndexAdd="true" logIndexUpdate="true" logIndexDelete="true" logObjectStore="true" logObjectRetrieve="true" logAnnotAdd="true" logAnnotUpdate="true" logAnnotDelete="true" logDBQueriesAfter="false" logDBQueries="false" >
<field name="a" type="Filter" dataType="String" expireDate="false" log="false" userExit="false" partition="false" cluster="false" appIDField="false" reference="false" pageCount="false" documentSize="false" lockdown="false" CFSOD="false" FTI="false" CMFed="false" updateable="false" stringCase="Upper" stringType="Fixed" stringLength="1" />
</applicationGroup>
With that you'll be able to find everything you need, and even more.
And with the advantage to not bother to find all the hex code for everything in CMOD. And it will also be more future proof, since you don't need to check for each release/FP of CMOD if your script is still working as expected, in case the IBM developer needs to change something in the internal structure of the internal tables.
With ARSXML working so well today, there is less and less need to do a query in the database anymore. That way you'll be really future proof.
Cheers,
Alessandro