Jump to content


Photo
- - - - -

ALIAS success or not


4 replies to this topic

#1 Vol Yip

Vol Yip

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 393 posts
  • Gender:Male
  • Location:Hong Kong

Posted 14 April 2016 - 02:28 AM

Hi all,

 

I am using GLOVIA PROIV, not the latest PROIV though.

 

Would like to like after doing a ALIAS command, is there way to verify if the ALIAS succeeded or not?

 

For example, I do

 

ALIAS(B_MAPT, 'c:\temp\ext_file.txt')

 

is there a way to check if the above is correctly executed? (for example, if the file c:\temp\ext_file.txt not exist)

 

Thanks,

 

Vol



#2 Wim Soutendijk

Wim Soutendijk

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 211 posts
  • Gender:Male
  • Location:Netherlands

Posted 14 April 2016 - 06:36 AM

Set @RFUNCT to a function that will handle the exception, and try to read data from your file B_MAPT.

If the file did not exist, it will execute you rollback function, in which you can look at @MSG, @MSGTEXT ,  @MSGARGS ,  @SYSERR and @SYSERRTEXT

Don't forget to reset @RFUNCT after a successful read of the file


#3 Vol Yip

Vol Yip

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 393 posts
  • Gender:Male
  • Location:Hong Kong

Posted 14 April 2016 - 06:44 AM

Thanks Wim,

 

I thought there is return value like #A = SYSTEM(...) command which tells me the status of the execution though.

 

Your suggestions work!

 

Regards,

 

Vol



#4 DARREN

DARREN

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 396 posts
  • Gender:Male
  • Location:Florida,USA

Posted 14 April 2016 - 02:38 PM

Version 6 of PROIV introduced new methods that allowed a developer to test for the existence of a file on the filing system. Prior to this the SYSF command was employed. SYSF commands should not be used on current versions of PROIV as there is are alternate methods, but this should work for a Glovia VM installation.
 
 
$FTPFILE  = %$FTPPATH + '/refundchecks' + CDATE(TODAY(),'YYYYMMDD') + '.txt'
//
//Check to see if the daily check file currently exists or not
//
SYSF(&#@CHKFILE,$CHECKFILE,#RESULT)
//
//Check to see if the daily file exists (#RESULT < 0 if it does not exist)
//
IF #RESULT < 0 THEN
   $FILEFOUND = 'N'
ELSE
   $FILEFOUND = 'Y'
ENDIF

Things should be made as simple as possible, but not simpler

#5 Vol Yip

Vol Yip

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 393 posts
  • Gender:Male
  • Location:Hong Kong

Posted 15 April 2016 - 04:23 AM

Thanks Darren, it works!





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users