Do you have a snapshot of what the data looks like, so one can use
__DATA__ to process through the data?  Unsure what a Remedy form is? I am
assuming all the subs are yours which you have created.

Wags



-----Original Message-----
From: Wendy Stewart [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 24, 2002 10:31
To: '[EMAIL PROTECTED]'
Subject: Need help converting/sorting date field from within a Perl
scrip t
Importance: High


Hi,

Help!!   I'm a new Perl user and have devloped my first Perl script to
extract fields from a Remedy form into a CSV file to be ftp'd elsewhere.  I
need to sort each record on Modified-date before writing to my output file.
The Modified-date format is in absolute time
(ie:  12/24/2002 7:17:13 PM).  Here's a partial extract of my script:

# The criteria is supposed to included everything modified in the past 1
hour
# which equates to the current time - (60 seconds * 60 minutes).

$SelectQualifier = (ars_LoadQualifier($ctrl, "$SCHEMA", "('Modified-date'
>=(\$TIMESTAMP\$ - 60*60) OR 'Create-date' >= (\$TIMESTAMP
\$ - 60*60))

%entries = ars_GetListEntry($ctrl, "$SCHEMA", $SelectQualifier, 0);
print LOGCHAN "\nError from GetListEntry: ", $ars_errstr;
$ModifiedDate        = ars_GetFieldByName($ctrl, "$SCHEMA",
"Modified-date");
$CreateDate          = ars_GetFieldByName($ctrl, "$SCHEMA", "Create-date");
$USSO_Num            = ars_GetFieldByName($ctrl, "$SCHEMA", "Formatted USSO
#");
$Coordinator_name    = ars_GetFieldByName($ctrl, "$SCHEMA", "CKL_ISC");

# print out the data for each record.
$reccounter=0;
#print ("\n about to enter loop\n");
foreach $entryKey (keys %entries) {
    %vals = ars_GetEntry($ctrl, $SCHEMA, $entryKey);
    printf(DATAOUT "%-15.15s", $vals{$CreateDate})        , ",";
    print DATAOUT $vals{$ModifiedDate}                    , ",";
    print DATAOUT $vals{$USSO_Num}                        , ",";
    print DATAOUT $vals{$Coordinator_name}                , ",";
close(DATAOUT);

#----------------------------------------------------------------------
# Log out of the server.
#----------------------------------------------------------------------
ars_Logoff($ctrl);

#----------------------------------------------------------------------
# Transfer the files to the OEP Host
#----------------------------------------------------------------------
sub FtpDataFile


Note:  I found reference to the following but don't know if it should be
incorporated into the script:   use Shell qw(sort);

Any help would be greatly appreciated.

Thank you,

Wendy Stewart



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


**********************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
****************************************************************


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to