Example 1
An application, which has not issued any requests to BTS, needs to know whether a particular container belongs to a child of the root activity of a particular process, the name and type of which are known.
Figure 1. Browsing example 1
EXEC CICS INQUIRE PROCESS(pname)
PROCESSTYPE(ptype)
ACTIVITYID(root_id)
if process found then browse the children of its root activity
EXEC CICS STARTBROWSE ACTIVITY
ACTIVITYID(root_id)
BROWSETOKEN(root_token)
EXEC CICS GETNEXT ACTIVITY(child_name)
BROWSETOKEN(root_token)
ACTIVITYID(child_id)
loop while the child is not found and there are more activities
EXEC CICS GETNEXT ACTIVITY(child_name)
BROWSETOKEN(root_token)
ACTIVITYID(child_id)
end child activity browse loop
if the child we are looking for is found then browse its containers
EXEC CICS STARTBROWSE CONTAINER
ACTIVITYID(child_id)
BROWSETOKEN(c_token)
EXEC CICS GETNEXT CONTAINER(c_name)
BROWSETOKEN(c_token)
loop while container not found and there are more containers
EXEC CICS GETNEXT CONTAINER(c_name)
BROWSETOKEN(c_token)
end container browse loop
EXEC CICS ENDBROWSE CONTAINER BROWSETOKEN(c_token)
EXEC CICS ENDBROWSE ACTIVITY BROWSETOKEN(root_token)