by Ed Goodman » Tue Jul 29, 2014 5:59 pm
To use with an IMS program, a GSAM needs to be in that program's PSB. That's the thing that tells a program which databases/segments it can use. A GSAM file needs to have DBD (database definition) so that it can be included in a PSB. The DBD will say something like "sequential file, lrecl=100, DDname for inut, DDname for output" The PSN definition will allow for read-only (Get Sequential) ((GS)) or for writing (Load Sequential)((LS)) by using the correct ProcOpt.
I've never used a GSAM file in the online region, I'm not even sure it's possible. I always use them in batch jobs. You SHOULD do an OPEN call and a CLOSE call when working with them. You use ISRT and GN to write/read them.
If you are doing a restart (XRST) call, make sure you DON'T do an OPEN call on the GSAM, because it will reset the pointer to the beginning of the file.