Previous Topic
Table Of Contents
Parent Topic
Next Topic

High-Level Language SWSCONCT (SWCPCC) Function

Related Topics

Web Server API Function Index


gfChkMrk.gif (134 bytes) Can be used in Shadow/REXX.
Can be used from Other REXX interpreters.
HLL entry point name is SWCPCC.

SWSCONCT is the Web Server API function used to concatenate multiple DDNames under a single DDName.

The format of this command is similar in features and functions to the TSO/E CONCAT command. A text string is used as input in order to provide the parameters necessary to define the files to be concatenated. Files may be "de-concatenated" using the SWSDECON command.

SWCPCC Call Arguments

The SWSCONCT (SWCPCC) function arguments are described in the table which follows. Only two of the three arguments are required.

Arg.
No.
HLL Argument Type I/O Description of Argument
C COBOL PL/I
1 LONG PIC
S9(5)
COMP
FIXED
BIN(31)
Input The length of the concatenation command string. If the length is longer than the actual command, trailing nulls or blanks will be ignored. If the length is less than the actual command string, the concatenation command string will be truncated and possibly cause execution errors. The maximum string length is 32768 bytes.
2 CHAR * PIC
X(nnnnn)
CHAR(nnnnn) Input The concatenation command string. See Supported Concatenation keywords below.
3 SWSASB * Usage pointer PTR Output The Shadow OS/390 Web Server Allocation Status Block. This is an optional argument that provides information concerning the status of the concatenation request. If you do not specify this argument, you will not have access to the reason code nor the DAIR code.

Return Values

SWSCONCT always sets a signed numeric return code value. Possible values are:

SWS_SUCCESS
The operation succeeded. The specified operation was performed.
SWS_ERROR
A parameter validation or run-time error was encountered. Error information is available using the SWSERROR function.
Any other value
The operation failed. Generally this indicates that the file was not concatenated. There will be an error message in the Allocation Status Block describing the error.
 
Top

Supported Concatenation Keywords

The SWSCONCT (SWCPCC) interface supports the following dataset concatenation request parameters:

DDN(DD1 DD2 DD3 ...) Specifies a list of previously allocated ddnames to be concatenated together.

Note: Separate parameters by spaces. Do not use commas.

The datasets will be concatenated as a single DDName using the first DDName in the list.

PERM(VALUE) Specifies whether or not to permanently concatenate these DDNames. Files that are permanently concatenated may not be "de-concatenated".

Legitimate values are:

  • YES = Permanently concatenate these files.
  • NO = Do not permanently concatenate these files.

Note: The default is NO

  Top

PL/I Example


 
    %INCLUDE SPCPHD
       .
       .
       .
       .
    DCL  COMMAND         CHAR(80)              /* CONCATENATE CMD  */
         INIT('DDN(INFILE1 INFILE2)');
    DCL  CMDLEN          FIXED BIN(31);        /* COMMAND LENGTH   */
    DCL  RC              FIXED BIN(31);        /* RETURN CODE      */
 
    CMDLEN = LENGTH(COMMAND);                  /* SET COMMAND LEN  */
 
 
    /* CONCATENATE THE INPUT FILES                                 */
 
    CALL SWSCONCT(CMDLEN,               /* COMMAND LENGTH          */
                  COMMAND,              /* COMMAND                 */
                  SWSASB);              /* ALLOCATION STATUS BLOCK */
 
    RC = PLIRETV();                     /* GET RETURN CODE         */
    IF RC ^= SWS_SUCCESS THEN           /* EXIT PROGRAM IF BAD RC  */
       EXIT;
 
Top

C Example


 
    SWS_ALLOCATION_STATUS_BLOCK swsASB; /* response area           */
       .
       .
       .
       .
    long RC;                            /* return code             */
    char szCommand[] = "DDN(INFILE1 INFILE2)";
 
 
    /* Concatenate the input files                                 */
 
    rc = SWSCONCT(strlen(szCommand),    /* Command Length          */
                  szCommand,            /* Command                 */
                  swsASB);              /* Response area           */
 
    if (rc ^= SWS_SUCCESS)
       do
         printf(swsASB.Error_Message);
         return rc;
       end
 
  
Top

 

COBOL Example


 
  *     NEON API COPY BOOK
    COPY SBCPHD.
        .
        .
        .
        .
    77   COMMAND-LENGTH       PIC S9(5) COMP.
    77   COMMAND              PIC X(80)
         VALUE 'DDN(INFILE1 INFILE2)'.
 
  *     CONCATENATE THE INPUT FILES
 
    MOVE 80 TO COMMAND-LENGTH.
    CALL SWSCONCT
        USING COMMAND-LENGTH,
              COMMAND,
              SWS-ALLOCATION-STATUS-BLOCK.
 
    MOVE RETURN-CODE TO WS-SWSAPI-RETURN-CODE.
    IF NOT SWS-SUCCESS
        DISPLAY 'FILE CONCATENATION FAILED.' UPON CONSOLE
        DISPLAY SWSASB-ERROR-MESSAGE UPON CONSOLE
        GOBACK.

Top