FYI - the z/OSMF REST Files PUT supports updating text files with UNIX
"diff -e" format, which I suppose is handy for updating huge files.
Mix this with the "If-Match Etag" and you have a safe way of updating using
diffs without holding SPFEDIT ENQs.

X-IBM-Data-TypeThis header is optional; use it to indicate whether data
conversion is to be performed on the request body.textWhen set to text,
data conversion is performed. The data transfer process converts each
record from the charset specified on the "Content-Type" header of the
request. If no charset is specified, the default is ISO8859-1. Each line of
data, delimited by a Line Feed in the request charset, is converted to
EBCDIC and written as a record to the data set or member. (The line feed
character is removed from the data, and the data is padded with the space
character to the end of the record if it is a fixed record size data set.
For variable record size data sets, the record is written without padding.)
If the record size of the data set is smaller than any line of text, an
HTTP 400 is returned with a JSON error document indicating that not all
data was written.
Note: When set to 'text' and "Content-Type" is "application/x-ibm-diff-e",
the input consists of commands in the same format as produced by the z/OS
UNIX 'diff -e' command. These commands are used to add, replace and delete
lines in the target data set. The following commands are supported:

a

c

d

s/.//

opt : g|<n>, g means global

n means search and replace <n> times

Each command may be optionally preceded by a line or line range, as allowed
by the z/OS UNIX 'ed' command. If an error is detected while processing a
command,status code 500 is returned with an exception.
binaryWhen set to binary, no data conversion is performed. The data is
written to the data set without respect to record boundaries. All records
will be written at their maximum record length and for fixed length record
data sets, the last record will be padded with nulls if required.recordWhen
set to record, no data conversion is performed. Each logical record is
preceded by the 4-byte big endian record length of the record that follows.
This length does not include the prefix length. For example: a zero-length
record would be 4 bytes of zeros with nothing following.

If you omit this header, the default is text; the request body is converted.



On Thu, Aug 30, 2018 at 12:18 PM Jerry Callen <[email protected]> wrote:

> > Question for y’all.  I would like to do a diff on the modified file and
> present the user with the changes.
> > They could REPLACE the file with the editor contents, MERGE them which
> would be something they
> > would do after a review of the diff, ABANDON them or save them somewhere
> else.  Does this strategy
> > sound acceptable ?
>
> Sounds completely awesome.
>
> -- Jerry
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to