As a side, IMHO there should be next to no CON usages in a well architected model apart from, values like *BLANK, 0.00 and some tolerance towards values like 12 (months), 52 (weeks), 365 (days), 100 (percentage). I'd even accept 1,2,3, 9999999 etc.
I draw the line at meaningful literals that could have been scoped conditions (CND) or database values.
My main reason for this is that there isn't a way (via the 2E tool interface) to check for usages of CON values. Obviously, we can scan the generated source, but then what about all the genuine field names or comments.
Back with 2E! When generating the source, it somehow lets the generator knows about them and adds them into the code (inline) or as part of a data structure. Take a look at the bottom of a source listing if you don't believe me.
Here is a sample function using some constants. Note the 'Create Flatfile' call is passing in 'FLAT FILE CoNsTANT' as CON.
Followed by the structure of CON values at the bottom. Note: Sometimes the CON is generated 'inline' at the point of the MOVE.

It looks like we have some constants referred to in field ELMTTL ** (Element Title - highlighted RED). This could be a good start but there are some obvious limitations. Whilst it looks like it covers basic *MOVE and *CONCAT field assignments, when we have hardcoded values going into a function call (PURPLE), the CON value isn't reflected in the ELMTTL field.
However, it looks like 2E maintains a surrogate reference for each unique CON value used in the AD regardless of AD syntax used. (GREEN)
So, all that is left for us to do is to identify the CON values we want to analyse, work out what functions they are linked to via the AD code and some pretty cool impact analysis is before us.
Here is a sample SQL retrieving the many different usages of the term 'constant'. As CON is only ever associated with field @@SUB3, the query is quite straight forward.
Ensuring you have the correct library list.
This query returns unique records for each of the functions using CON context with the word 'constant', the UPPER() function ensures we don't miss any based-on case differences. The rest of the query does a basic join to return some additional fields from YMDLOBJRFP (This is the *ALLOBJ or *A model list). You can add to this query or tidy up names and formatting however you like.
Thanks for reading the














