Begin-Procedure Open-File !naga
#debug show 'Entering Open-File'
!file name and where it is located.
Let $filepath1= '{INPUT_DIR}' || '/CPA_1184_ORGANIZATIONS_ALL_' || &GFS_Company || '.csv'
SHOW 'File---> '$filepath1
!check if the filel exists before trying to open it
Let #estatus = exists($filepath1)
If #estatus = 0
Show 'Log File ' $filepath1' exists. Will be opened for reading.'
!opening file for reading
Open $filepath1 As 1 For-
Reading Record=3000
Status=#FileStat
!couldn't open file if #FileStat is not zero
If #FileStat != 0
let $file_open=" "
let $prcs_message_parm1=" "
Move 'N' To $file_open
Show 'Error Opening Input File' $filepath1
Show 'Program Terminating.'
Let $errmsg = 'Error Opening Input File' || $filepath1
Move $errmsg to $prcs_message_parm1
Let #Prcs_Run_Status = #prcs_run_status_unsuccessful
Stop
Else
Move 'Y' To $file_open
Show 'File ' $filepath1 ' opened successfully.'
#debug show 'Leaving Open-File'
End-Procedure Open-File !naga
Bookmark/Search this post with
welcome to the site nagavenkatesh!
Are you trying to share your code with us or do you have a question? Post your articles and code you would like to share with us on your blog instead of the forum. Let me know if you need help doing that.
Thanks!
Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog