Highlighted
Absent Member.
Absent Member.
951 views

[archive] C$REDIRECT doesn't work?

[Migrated content. Thread originally posted on 27 March 2003]

I am trying to use the c$redirect function to install a custom file handler. Everything works fine, except that any changes made to the record area during read/read lock operations are not written back to the record.

In other words, while the write operation works ok, it is impossible to install a file handler which reads records, because the changes are discarded by the runtime. Whether it is pre/post/replace does not make a difference.

Is this the designed behavior?

Merlin
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] C$REDIRECT doesn't work?

It is my belief that the intent of C$REDIRECT is to allow alternate methods of writing and reading data records. By alternate I mean other than the supplied file handler, the vision file system.

C$REDIRECT allows you to install a custom function with special linkage that allows you to take an action when the runtime would normally do something with the files. This can be before, after, or instead of the normal operation.

The linkage is supplied in a copy book and cannot be changed. It contains all the information needed to make an appropriate action.

There is one variable, HANDLER-RECORD-AREA, which holds the record data. This varialbe length structure is exactly as long as the record being acted upon. Before executing the C$REDIRECT installed handler, the runtime places the contents of the file record into this area. The problem is that the contents of this area are not copied back into file record structure. AFICT, this makes C$REDIRECT useful for writing but not for reading becuase there is no way to persist data you want to read from an alternate source.

I confirmed that the addresses of the file record and HANDLER-RECORD-AREA are different (using set...address..of). Unless there is some way to force the file handler to take the data from HANDLER-RECORD-AREA, my project is kaput 😞 I was counting on being able to bypass the vision file handler.

Even if I sneak the data through an external linkage item via the address, the file record gets set back to its original contents. Was this feature disabled by design?


gforseth..help! 🙂
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] C$REDIRECT doesn't work?

I am sorry MerlinM,
but this one I don't have an answer to without digging into code (yours and probably ours). In which case I would rather prefer that you brought the issue up with Tech Support as it might turn extensive to uncover the problem.

You would at least have to provide some sample code, hopefully as small as possible.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.