Sponsored Content
Top Forums Shell Programming and Scripting Need to capture dates between start date and end date Using perl. Post 302539895 by Nagaraja Akkiva on Tuesday 19th of July 2011 05:45:50 AM
Old 07-19-2011
Thanks murphy for your response..!!

I copied and pasted this code and named the scipt as archive_perl.pl and executed the script. Got some error. Can you please tell me what is wrong here?

Code:
[user@dbname bin 04:31:05 AM]$archive_perl.pl 01-MAR-2011 10-MAR-2011
Can't locate DateTime.pm in @INC (@INC contains: /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/5.8.5 
/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.4/x86_64-linux-thread-multi 
/usr/lib64/perl5/site_perl/5.8.3/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.2/x86_64-linux-thread-multi 
/usr/lib64/perl5/site_perl/5.8.1/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.0/x86_64-linux-thread-multi 
/usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 
/usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl 
/usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.4/x86_64-linux-thread-multi 
/usr/lib64/perl5/vendor_perl/5.8.3/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.2/x86_64-linux-thread-multi 
/usr/lib64/perl5/vendor_perl/5.8.1/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.0/x86_64-linux-thread-multi 
/usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 
/usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 
/usr/lib/perl5/vendor_perl .) at /var/factiva/ODS/bin/archive_perl.pl line 5.
BEGIN failed--compilation aborted at /var/factiva/ODS/bin/archive_perl.pl line 5.

---------- Post updated at 05:35 AM ---------- Previous update was at 04:31 AM ----------

---------- Post updated at 05:45 AM ---------- Previous update was at 05:35 AM ----------

Since perl modules DateTime and DateTime::Format::Strptime are not present in my system hence this error. Will install the same and check this script.

Thanks
Nagaraja.

Last edited by Nagaraja Akkiva; 07-21-2011 at 12:52 PM..
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Generate quarter dates with begin date and end date

Hi All, I am trying to generate quarter dates with user giving input as begin date and end date. Example: Input by user: begin_date = "2009-01-01" end_date = 2010-04-30" required output: 2009-01-01 2009-03-31 09Q01 2009-04-01 2009-06-30 09Q02 . . till 2010-01-01 2010-03-31 10Q01 ... (9 Replies)
Discussion started by: sol_nov
9 Replies

2. Shell Programming and Scripting

Compare Start date and End date...

Hi All, I have problem in my file. It has two date variable. There are 2 variables which has the values as below 1. START_MONTH = “Date(YYYYMM) format” Ex: 201008 2. END_MONTH = “Date(YYYYMM) format” Ex: 201105 The end date should be greater than start date. Now we... (3 Replies)
Discussion started by: suresh01_apk
3 Replies

3. Shell Programming and Scripting

Need to capture all dates between start date and End date.

Hi All, I enter Start date and end date as parameters. I need to capture dates between start date and end date. Please let me know if you have any idea the same. Thanks in advance. Nagaraja Akkivalli. (5 Replies)
Discussion started by: Nagaraja Akkiva
5 Replies

4. Shell Programming and Scripting

Extract week start,end date from given date in PERL

Hi All, what i want to do in perl is i should give the date at run time .Suppose date given is 23/12/2011(mm/dd/yyyy) the perl script shold find week start date, week end date, previous week start date,end date,next week start date, end date. In this case week start date will be-:12/19/2011... (2 Replies)
Discussion started by: parthmittal2007
2 Replies

5. Shell Programming and Scripting

Get the lines from logfile within start and end date

Hi guys, I am having the below logfile,date in yyyy-mm-dd 2013-08-02 *some content* 2013-08-02 *some content* 2013-08-02 *some content* 2013-08-03 *some content* 2013-08-05 *some content* from the above logfile i need to get the lines between the two timestamps,if i give... (5 Replies)
Discussion started by: mohanalakshmi
5 Replies

6. UNIX for Dummies Questions & Answers

Print start date to end date, given $1 & $2 in ksh

Dear all, I have an user passing 2 parameter 31/03/2015 and 02/04/2015 to a ksh script. How to print the start date to end date. Expected output is : 31/03/2015 01/04/2015 02/04/2015 Note : 1. Im using aix and ksh 2. I have tried to convert the given input into a date, didnt... (0 Replies)
Discussion started by: mr.rajaravi
0 Replies

7. UNIX for Beginners Questions & Answers

Splitting week start date and end date based on custom period start dates

Below are my custom period start and end dates based on a calender, these dates are placed in a file, for each period i need to split into three weeks for each period row, example is given below. Could you please help out to achieve solution through shell script.. File content: ... (2 Replies)
Discussion started by: nani2019
2 Replies
PERLVOS(1)						 Perl Programmers Reference Guide						PERLVOS(1)

NAME
README.vos - Perl for Stratus VOS SYNOPSIS
This file contains notes for building perl on the Stratus VOS operating system. Perl is a scripting or macro language that is popular on many systems. See perlbook for a number of good books on Perl. These are instructions for building Perl from source. Most people can simply download a pre-compiled distribution from the VOS anonymous FTP site. This version of Perl is not supported on VOS Release 14.2.0 or earlier releases. If you are running VOS Release 14.3.0 or later, download Perl from ftp://ftp.stratus.com/pub/vos/posix/ga/ga.html. Instructions for unbundling the Perl distribution file are at ftp://ftp.stratus.com/pub/vos/utility/utility.html. If you are running VOS Release 14.4.1 or later, you can obtain a pre-compiled, supported copy of perl by purchasing Release 2.0.1 (or later) of the VOS GNU C/C++ and GNU Tools product from Stratus Technologies. BUILDING PERL FOR VOS
To build perl from its source code on the Stratus Continuum platform, you must be have VOS Release 14.5.0 or later, the STCP product, and the GNU C/C++ and GNU Tools, Release 2.0.1 or later. On the V Series platform you must have VOS Release 15.0.0 or later, and any version of the GNU C/C++ and GNU Tools product. To build full perl using the supplied Configure script and makefiles, change to the "vos" subdirectory and type the command "compile_full_perl" or "start_process compile_full_perl". This will configure, build, and test perl. INSTALLING PERL IN VOS
1. If you have built perl using the Configure script, ensure that you have modify and default write permission to ">system>ported" and all subdirectories. Then type gmake install 2. While there are currently no architecture-specific extensions or modules distributed with perl, the following directories can be used to hold such files: >system>ported>lib>perl5>5.9.0>7100 >system>ported>lib>perl5>5.9.0>8000 >system>ported>lib>perl5>5.9.0>i786 3. Site-specific perl extensions and modules can be installed in one of two places. Put architecture-independent files into: >system>ported>lib>perl5>site_perl>5.9.0 Put site-specific architecture-dependent files into one of the following directories: >system>ported>lib>perl5>site_perl>5.9.0>7100 >system>ported>lib>perl5>site_perl>5.9.0>8000 >system>ported>lib>perl5>site_perl>5.9.0>i786 4. You can examine the @INC variable from within a perl program to see the order in which Perl searches these directories. USING PERL IN VOS
Restrictions of Perl on VOS This port of Perl version 5 to VOS prefers Unix-style, slash-separated pathnames over VOS-style greater-than-separated pathnames. VOS- style pathnames should work in most contexts, but if you have trouble, replace all greater-than characters by slash characters. Because the slash character is used as a pathname delimiter, Perl cannot process VOS pathnames containing a slash character in a directory or file name; these must be renamed. This port of Perl also uses Unix-epoch date values internally. As long as you are dealing with ASCII character string representations of dates, this should not be an issue. The supported epoch is January 1, 1980 to January 17, 2038. See the file pod/perlport.pod for more information about the VOS port of Perl. Handling of underflow and overflow Prior to VOS Release 14.7.0, VOS does not support automatically mapping overflowed floating-point values to +infinity, nor automatically mapping underflowed floating-point values to zero, unlike many other platforms. The Perl pack function has been modified to perform such mapping in software on VOS. Performing other floating-point computations that underflow or overflow will probably result in SIGFPE. Don't push your luck. As of VOS Release 14.7.0, the VOS POSIX runtime sets up the PA-RISC and IA-32 hardware floating-point status register so that the overflow and underflow exceptions do not trap, but instead automatically convert the result to infinity or zero, as appropriate. As of this writing, there are still floating-point operations that can trap, for example, subtracting two infinite values. This is recorded as suggestion posix-1022, which has been fixed in VOS Release 15.2 and higher. TEST STATUS
When Perl 5.9.0 is built using the native build process on VOS Release 14.7.0 and GNU C++/GNU Tools 2.0.2a, all but nine attempted tests either pass or result in TODO (ignored) failures. The tests that fail are: t/io/dup, test 2 t/io/tell, test 28 t/op/pack, test 0 ext/B/t/bytecode, test 1 ext/Devel/Peek/t/Peek, test 1 ext/Encode/t/enc_module, test 1 ext/IO/t/io_dup, test 2 lib/ExtUtils/t/MM_Unix, test 94 lib/Net/ing/t/450_service, test 8 SUPPORT STATUS
I'm offering this port "as is". You can ask me questions, but I can't guarantee I'll be able to answer them. There are some excellent books available on the Perl language; consult a book seller. If you want a supported version of perl for VOS, purchase the VOS GNU C/C++ and GNU Tools Release 2.0.1 (or later) product from Stratus Technologies, along with a support contract (or from anyone else who will sell you support). AUTHOR
Paul Green (Paul.Green@stratus.com) LAST UPDATE
February 7, 2008 perl v5.12.1 2010-04-26 PERLVOS(1)
All times are GMT -4. The time now is 04:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy