GITFN_DIFF_IDX_F Function

Returns the changes for a file in the index.

Category:Git
See:Using Git Functions in SAS
The GITFN_ functions were deprecated and replaced with the GIT_ functions. For a list of the new GIT_ functions and the deprecated functions that they replace, see Deprecated Git Functions.

Syntax

GITFN_DIFF_IDX_F( directory, file-name, diff-content)

Required Arguments

directory

specifies the pathname of a local repository on the SAS server.

file-name

specifies the file name of the file in the index to return changes for.

diff-content

specifies a character variable to return the content of the diff to.

Details

Overview

The GITFN_DIFF_IDX_F function returns changes made to a file in the index against the last committed repository version of that file. The functions assignment variable indicates whether the operation was successful or not. Changes to the file are stored in the variable specified for the diff-content argument. The variable specified for the diff_content argument must be initialized prior to calling the GITFN_DIFF_IDX_F function.

Return Codes

The GITFN_DIFF_IDX_F function has return codes to indicate whether the function was successful.

Return Codes

Return Code

Description

0

Indicates the function was successful.

–1

Indicates the function failed. See the log for additional details.

Example

data _null_;
LENGTH your-diff-content-variable $ 1024;        /*1*/
your-diff-content-variable="";                   /*2*/
 rc=GITFN_DIFF_IDX_F(
  "your-local-repo",                             /*3*/
  "your-file-name",                              /*4*/
  your-diff-content-variable);                   /*5*/
PUT rc=;                                         /*6*/
PUT your-diff-content-variable=;                 /*7*/
run;
  1. Set the length of your diff-content variable high enough to store all of the changes to the file.

  2. Initialize the diff_content variable.

  3. Specify the pathname of your local repository.

  4. Specify the local pathname of the file that you want to diff.

  5. Specify the variable that will store the content of the diff.

  6. Use the PUT statement to write the SAS return code to the log.

  7. Use the PUT statement to write the diff content to the log.

The content of your diff will be stored inside your diff-content-variable. Each diff is enclosed in braces {} seen in the example output below:

rc=0
 your-diff-content-variable={ your-diff-content }    
Last updated: April 14, 2026