AllExperts > Peoplesoft 
Search      
Peoplesoft
Volunteer
Answers to thousands of questions
 Home · More Peoplesoft Questions · Answer Library  · Encyclopedia ·
More Peoplesoft Answers
Question Library

Ask a question about Peoplesoft
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Matthew 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

 
   

You are here:  Experts > Industry > IT Consulting > Peoplesoft > Using substring function

Peoplesoft - Using substring function


Expert: Matthew Bowden - 9/28/2009

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.

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.