Re: file list for ftp in a command procedure



Hi David, I double checked and it is correct, see below and the results
with putting the date in 2 different ways...

so I'm confused by this :-) I know nothing new

$ if P1 .eqs. "" then Inquire start_date "Please Enter Start Date
dd-mmm-yyyy"
$ if P2 .eqs. "" then Inquire end_date "Please Enter End Date
dd-mmm-yyyy"
$ start_date = f$cvtime(P1, "comparison", "date" )
$ end_date = f$cvtime(P2, "comparison", "date" )

$
$ any_files = "FALSE"
$ loop:
$ file = f$search ( "*.*" )
$ if file .eqs. "" then goto end_loop
$ file_date = f$file_attributes ( file, "RDT" )
$ file_date = f$cvtime ( file_date, "comparison", "date" )
$ if file_date .ges. start_date .and. -
file_date .le. end_date
$ then
$ name = f$parse ( file,,, "name", "syntax_only" )
$ ext = f$parse ( file,,, "type", "syntax_only" )
$ simple_name = name + ext
$ any_files = "TRUE"

results 1:
$ @phclaimtest 01-oct-2005 01-nov-2005
$!
$! P1 = start date in the dd-mmm-yyyy format
$! P2 = end date in the dd-mmm-yyyy format
$! P3 = month to be processed (name of subdirectory on target FTP
server)
$!
$ if P1 .eqs. "" then Inquire start_date "Please Enter Start Date
dd-mmm-yyyy"
$ if P2 .eqs. "" then Inquire end_date "Please Enter End Date
dd-mmm-yyyy"
$ start_date = f$cvtime(P1, "comparison", "date" )
$ end_date = f$cvtime(P2, "comparison", "date" )

$
$ any_files = "FALSE"
$ loop:
$ file = f$search ( "*.*" )
$ if file .eqs. "" then goto end_loop
$ file_date = f$file_attributes ( file, "RDT" )
$ file_date = f$cvtime ( file_date, "comparison", "date" )
$ if file_date .ges. start_date .and. -
file_date .le. end_date
$ then
$ name = f$parse ( file,,, "name", "syntax_only" )
$ ext = f$parse ( file,,, "type", "syntax_only" )
$ simple_name = name + ext
$ any_files = "TRUE"
$


results 2:
$ @phclaimtest 2005-10-01 2005-11-01
$!
$! P1 = start date in the dd-mmm-yyyy format
$! P2 = end date in the dd-mmm-yyyy format
$! P3 = month to be processed (name of subdirectory on target FTP
server)
$!
$ if P1 .eqs. "" then Inquire start_date "Please Enter Start Date
dd-mmm-yyyy"
$ if P2 .eqs. "" then Inquire end_date "Please Enter End Date
dd-mmm-yyyy"
$ start_date = f$cvtime(P1, "comparison", "date" )
%DCL-W-IVATIME, invalid absolute time - use DD-MMM-YYYY:HH:MM:SS.CC
format
\2005-10-01\
$ end_date = f$cvtime(P2, "comparison", "date" )
%DCL-W-IVATIME, invalid absolute time - use DD-MMM-YYYY:HH:MM:SS.CC
format
\2005-11-01\

$
$ any_files = "FALSE"
$ loop:
$ file = f$search ( "*.*" )
$ if file .eqs. "" then goto end_loop
$ file_date = f$file_attributes ( file, "RDT" )
$ file_date = f$cvtime ( file_date, "comparison", "date" )
$ if file_date .ges. start_date .and. -
%DCL-W-UNDSYM, undefined symbol - check validity and spelling
\START_DATE\
file_date .le. end_date
$ then
%DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting structure or data
inconsistency
$

.



Relevant Pages