troubleshooting Question

Get variable name in RPG

Avatar of erwingosepa
erwingosepa asked on
IBM System i
4 Comments1 Solution741 ViewsLast Modified:
I have the the following variables in RPG
D @52            S             80  
D @53            S             80  
D @54            S             80

Those variables can be filled with anything with max of 80 character
Now, I want is the following. In the RPG Program I need the value @52, @53, @54 which are the variable names.
How can I get the variable name @52 in another variable. It should be extracted from the variable itself.
This example is not what I want.
C                   MOVEL     '@53 '       @53
This is the kind of solution I was looking for
C                   MOVEL     %Name(@53)   @Target

So the @Target should have '@53' when ready.
Please advise me, an example is highly appreciated.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros