Hi @TimStettner,
My answer will focus on two main ways of doing this and I will also augment the answers to include the SAS Container Runtime (SCR) as one possibility that is available in addition to MAS in SAS Viya 4:
1. Making use of the Logging, this builds on top of what @SophiaRowland as already mentioned
2. Writing to a database
Logging
The logging of both MAS and SCR are a great way of enabling your use case because they require only a one time setup by the admin. Also logging is extremely fast and thus as a minimal performance impact for the scoring. Making use of the archival function for MAS mentioned by @SophiaRowland is a great way of doing it (https://go.documentation.sas.com/doc/en/mascdc/default/masag/n0yfb6f53gngamn1tn7k0a5c60i6.htm), or of course you can make use of the base MAS logs, but it would require capturing them and parsing them (https://go.documentation.sas.com/doc/en/mascdc/default/masag/n1bpmaoscsf0rnn0z1dz3i6n0k4a.htm). In SCR it can be set via the option SAS_SCR_LOG_LEVEL_SCR_IO (https://go.documentation.sas.com/doc/en/mascrtcdc/default/mascrtag/p1syrp759enejnn1s6jvuw1ia9c5.htm?fromDefault=#p19wd6anldyq55n1vvezs8j2uhlx) for the logs and then parsing needs to be applied. Database
Capturing the In/Outputs and writing them to a database is a bit more tricky. First this introduces a bigger performance penalty then logging, even with concepts like connection pooling etc., you might it time outs, have to do retries, etc.. Also note that MAS currently only supports a subset of the SAS Viya supported databases (https://go.documentation.sas.com/doc/en/mascdc/default/masag/n1f863xqncrgajn15lz2xl7ffk1h.htm), same applies for SCR (https://go.documentation.sas.com/doc/en/mascrtcdc/default/mascrtag/n15q5afwsfkjl5n1cfvcn7xz4x22.htm). The next thing is of course what you already touched on namely that if we are talking just a model it would require changing the Score Code of your model to include the database connect and write, which would be a manual step and similar to @SophiaRowland I would also advise against going that route. As @sbxkoenk mentions if using SAS Intelligent Decisioning is an option, this would open two additional ways of doing it by adding a node after the model in the decision - either making use of a Custom DS2 code or making use of the Record Contacts node (https://go.documentation.sas.com/doc/en/edmcdc/default/edmug/n10hwvizrf0fbgn1mdhwahnwfavz.htm?requestorId=14c88244-2c18-480f-9d40-9ad87ba329d6). In any way the Database approach would also require to be reimplemented for each new model/decision. So with all of that out of the way, I want to quickly mention that of course the calling application could also save the In/Outputs but that would be a decentralized effort and require contact with different users. The logging based approach to me as the most upside, while requiring little configuration and on going effort and also opening the avenue to potentially use other logging modules to track module performance, etc.. Best, David
... View more