You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

opening file problem

1 reply [Last post]
nagavenkatesh's picture
User offline. Last seen 9 years 3 days ago. Offline
Joined: 07/14/2011
Posts: 1

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

Lepa's picture
User offline. Last seen 1 year 39 weeks ago. Offline
Joined: 06/23/2008
Posts: 591
Re: opening file problem

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