I am not sure if I understand the first part of your question about how to set the OSPF area. I think that what you are asking for is that in the network statement you give the address, the mask and what area it should be assigned to. For example:
network 172.16.1.0 0.0.0.255 area 1
would assign any interface that matches the address and mask to area 1.
How to choose the area is much less obvious because there are many ways to choose the area. If you were working in a network that uses 10.0.0.0 and set up addressing so that the second octet was based on geographic region then you might choose the OSPF area by using the value of the second octet. Or if you were working in a campus network and each building had a building number then you might assign the OSPF area based on the building number. There is not anything particularly significant about the OSPF area ID so there are many ways to choose a number to use for the area ID.
That was exacly what I was looking for, always used the second octet before and just couldn't seem to remember it, as soon as I read your reply the light came back on and it was like I had never forgotten it.
We are pleased to announce availability of Beta software for 16.6.3. 16.6.3 will be the second rebuild on the 16.6 release train targeted towards Catalyst 9500/9400/9300/3850/3650 switching platforms. We are looking for early feedback from custome...