#! /usr/bin/ksh
#
# Function makeAF:
# Use pdls to create an attributes file containing all the attributes of
# the specified object (2nd parameter).  The attribute file name is created
# using "AF." plus an attribute file number "#." (3rd parameter) plus the
# test case script name (4th parameter), for example "AF.0.pdlsscr1".
#
# The parameters used by this function follow:
#
# Input positional parameter:
#     $1. Special print file
#     $2. Target object (i.e. spooler or supervisor name)
#     $3. Attribute file number
#     $4. Test case script name
#
# This function returns 0 if success, else an error
#
# Author: Giovanni Perrone

# Run the pdls command and redirect the output to the file.

$PD_PATH/pdls -c $1 -r archive $2 > $WORKDIR/AF.$3.$4

# check the return of the pdls
if [ $? != 0 ]
  then
	reportError "Function makeAF: pdls failure"
	exit 1
  else
	exit 0
fi
