AboutMatthew Bowden Expertise I am willing to share my know how gained from 15 years of supporting PeopleSoft payroll and related modules. I do not have access to an installed system at this time, so my knowledge will be from memory and analysis of provided facts
Experience PeopleSoft Payroll -- development and support
PeopleSoft Payroll Interface -- development and support
PeopleSoft Benefits Administration -- support
PeopleSoft COBOL -- Functional expert/programmer
Education/Credentials BA Mathematics, PeopleSoft employee 1993 to 2004
Question I have a filepath which reads like \\amttreldh001\pshr\temp\book3.csv
The last word is the filename (book3.csv) and I need to read this filename into a variable. How can I use the substr or anyother function to achieve this? Thanks in advance.
Regards,
psuser123
Answer You will want to use instring and length functions to identify segments by keying off the '' character. This will allow you to identify the part of the string to ignore. There are multiple ways to combine these two functions. One I can think of follows.
Using length, determine the upper limit for a looping process. Look at the last n-i to n string of characters with i increasing until you find '' in the string. At that point take only n-i-1 to n characters and that should be your file name.
You could also look at the use of 'delimited by' as a way to command SQR to perform this process for you.