Thanks to all who replied this thread. I will explain the steps I followed to solve the issue
initiator.cfg
UseDataDictionary=Y
ValidateUserDefinedFields=N
ValidateFieldsOutOfOrder=N
ValidateFieldsHaveValues=N
DataDictionary=/var/www/FIX44_edited.xml
/var/www/FIX44_edited.xml
<message name="MarketDataRequest" msgtype="V" msgcat="app">
<field name="MDReqID" required="Y"/>
<field name="SubscriptionRequestType" required="Y"/>
<field name="MarketDepth" required="Y"/>
<field name="MDUpdateType" required="N"/>
<field name="AggregatedBook" required="N"/>
<field name="OpenCloseSettlFlag" required="N"/>
<field name="Scope" required="N"/>
<field name="MDImplicitDelete" required="N"/>
<group name="NoMDEntryTypes" required="Y">
<field name="MDEntryType" required="Y"/>
</group>
<group name="NoRelatedSym" required="Y">
<component name="Instrument" required="Y"/>
<group name="NoUnderlyings" required="N">
<component name="UnderlyingInstrument" required="N"/>
</group>
<group name="NoLegs" required="N">
<component name="InstrumentLeg" required="N"/>
</group>
</group>
<group name="NoTradingSessions" required="N">
<field name="TradingSessionID" required="N"/>
<field name="TradingSessionSubID" required="N"/>
</group>
<field name="ApplQueueAction" required="N"/>
<field name="ApplQueueMax" required="N"/>
<field name="CurrencyNew" required="Y"/>
</message>
and
<field number="5232" name="CurrencyNew" type="STRING"/>
define the field 5232 with a unique name (i gave "CurrencyNew"), and use the field inside the message in which you need to use the custom variable 5232.
Initiator.java
Message message = new Message();
quickfix.fix44.MarketDataRequest.NoRelatedSym group = new quickfix.fix44.MarketDataRequest.NoRelatedSym();
StringField currency= new StringField(5232, "EUR");
group.setField(currency);
message.addGroup(group);
Hope this helps anyone who is stuck in generating data dictionary :)