You can divide data set into complementary subsets, performing the analysis on one subset (training set), and validating the analysis on the other subset (testing set). And you should repeat the process a few times to get good results. See: http://en.wikipedia.org/wiki/Cross-validation_%28statistics%29
The best benefit of ANN is that when you have developed a model it can be further used for new data. For new set of data It is not necessary there is a real out put. Your developed model has performance parameters for training and testing data set. If you are sure that your trained model is confident (i.e. it has the minimum MAPE or MAE) you can simulate this model using new data. It should be highlighted at the beginning step the ANN model should be developed correctly.
You can use Matlab to train neural networks. It has the ability to be used online. But before its application as an online program, you need experimental data to train your network. Also, when u r developing ANN in matlab you can define the performance parameters. i.e. you can define it as a condition for programme to be stopped if MAPE reaches 0.01.
You should first train your ANN (on training set) and next you can use it. You can also implement a kind of adaptative approach: in moment (t+1) when you know what was real value of explained variable in the (t) moment you can re-evaluate your mode parameters (ANN structure and wights, with cross-evaluation of course) and use the new ANNs for the next (t+2) moment.
Training of ANN using PSO is discussed with codes in MATLAB in the paper attached to the link below. Further, testing of the trained network has been also discussed in the paper.