Case generator is a flexible tool for setting up loads of cases to go at the press of a button (See Note # 61 Sensitivity to Operating Parameters) – and a 181 file of initial estimates can be very helpful in improving recursion behaviour (See Note #7 Initial Estimates).  So how, asks a client, can I use one with the other?
 
Of course, if there is a 181 file connected to the case file that is going to be used as the base for the case generator run, then it is part of the CSE information and will also be used for all the alternate cases too.
 
67 CaseGenInterface
 
But what if I didn't have one for the base run or want to use a different file?   Given that my sensitivity cases are all minor variations on the base case, for example, it might reduce recursion passes to start them from the final properties and distributions of that base case solution.  I could just re-run the base case, starting it from its own 181 file so that it is listed in the CSE file.  (Although if I don’t change the run name or copy it to some other folder it will be overwritten by the new solution, and then I would be using THAT one in the case generator – which is probably just as good in this situation, but would not be great if I wanted to replicate the base run.)
 
Or, for more flexibility, I could add OMNI commands to the Case Generator spreadsheet to tell it to read a specific 181 file for a particular case.   This way I could use different 181 files for different cases.  I could have ones for summer or winter product specifications, or for particular types of crudes or numbers of periods, etc.  Or just a set of 181 files from various related runs that might or might not be helpful for my current case and I just want to see which one works best – like using the Multi-Start tool but without the random bit.

67 CaseWithSwitchTo
 
“OMNI:SWITCH TO” tells the run script to read the file.  The command has to be at the very end of the case definition because when it is actioned the run will SWITCH from the case data file that it was reading to this extra one – and it won’t come back.  The command, therefore, has to be repeated in each case, even if they are all using the same file.  It can’t be inherited from a parent.  In fact, if you put it in a case that is a parent to another, the child-case data won’t be read for the run! So put it right at the end.  
 
There should be at least one blank line after the last table entry before any OMNI command.  The commands are case sensitive so “OMNI:SWITCH TO” must be in capitals, as shown, and without any extra spaces. (See Note #51 for more about OMNI commands.) The file name, in quotes, must have the full path because it won’t be copied when the spooling (see Note #11) is done.  You can use a formulae to help make sure you pick up the right folder and/or file name every time.

You might have noticed that I have also used a LIST,ON command.  This is to create a record in the LST file of the name and contents of the added file so I know what was used.  You can usually tell that the command is working because it will change the behaviour of the run – and the data and matrix will have changed (see Note #34).  But, because we are using the back-door hack, most of the normal systems for logging the files used for a run won’t work, so if we go back later to see how the run was constructed we won't see anything about this extra input.  Telling the system to activate the LIST function at this point will add a section to the LST file so you can see what you were doing.
 
67 SwitchLSTnav
 
You would also get a record in the LST file if you ask the system to echo ALL the input data into the LST file via the setting on the Output: General panel.  However I find it more convenient to save the RC2 file as a record of what was run, as that is easier to search and compare, and so don't normally activate that.    
 
When adding the 181 file to your case you need to consider if you want to use all the information, or just part.  See Note #7 for a discussion of the options.  Your Case Generator cases will inherit these choices from the base case run unless you override them.  To guarantee you have your preferred settings, you could add them to a non-running case that serves as a parent to all the others, like so:
67 SetGlobalParentCase
 
There you have it – choosing a 181 file via Case Generator.  Do be careful with your files.  The runs will error if they aren't where you said they are.  If you have a 181 file that you want to re-use, keep it safe. It doesn’t need a face mask or hand sanitizer, but it deserves to be given a meaningful name and a secure location to be backed up (or is that locked down?) in.
 
 
Thanks to Bart and Jereon, my distance-learning-during-lockdown students, for the question.  And Rowell who asked it before so I already knew the answer.
 
 

From Kathy's Desk: 169 days (PB) since I slept in a hotel room and counting
2nd June 2020.
 
 
 
Comments and suggestions gratefully received via the usual e-mail addresses or here.
You may also use this form to ask to be added to the distribution list so that you are notified via e-mail when new articles are posted.