CL source file searching for a specific library name
I am writing a program that reads through a CL source file searching for a specific library name (PANDPGM or PANDFIL)...
Continue Reading This Article
Enjoy this article as well as all of our content, including E-Guides, news, tips and more.
if found the hard coded library will be replaced by a variable (&pgmlib or &FILLIB) and some code will be inserted to retrieve these libraries from a message file. I am using RPGIV and attempting to use %scan %replace but am not having much success. Could you provide an example?
Here you go:
C EVAL ScnPos = %SCAN('PANDPGM': SRCDTA) C If (ScnPos > 0) C EVAL SRCDTA = %REPLACE('&PGMLIB': SRCDTA: C ScnPos: 7) C End C EVAL ScnPos = %SCAN('PANDFIL': SRCDTA) C If (ScnPos > 0) C EVAL SRCDTA = %REPLACE('&FILLIB': SRCDTA: C ScnPos: 7) C End
Dig Deeper on RPG iSeries programming
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.
Meet all of our AS/400 experts
View all AS/400 questions and answers
Start the conversation
0 comments