Is there any formatting is to get the hierarchy to be updated in the .dta file to get printed in Pdf
One answer
Here are few starting point.
Please note that IBM provide mentoring on PUB via ExpertLab Consulting.
Creating and applying a style https://www.ibm.com/docs/en/engineering-lifecycle-management-suite/lifecycle-optimization-publishing/7.0.3?topic=SS6RHZ_7.0.3/com.ibm.rational.pe.publishing.doc/topics/t_style.htm
In most element, there is a properties
You can provide the style name as in your stylesheet (.docx) or the Style defined in PUB.
If you provide a integer, it will make it a Header of that level
1 -> Header1
2 -> Header2
Using the Depth of the contextBinding, you can reproduce the structure of the Module in the output