Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1307
  • Last Modified:

Is there a function in as400/RPGLE to add spaces to a string?

Hi,
Is there a function in as400/RPGLE to add spaces to a string?
something like this:
eval STRING = "HELLO" + SPACES(10) + "WOW"

thanks
0
bobdylan75
Asked:
bobdylan75
2 Solutions
 
Dave FordSoftware Developer / Database AdministratorCommented:
I usually do that through SQL:

EXEC SQL set :someStuff = 'Hello' || space(10) || 'Wow';

Open in new window


HTH,
DaveSlash
0
 
ThomasMcA2Commented:
This might work:

eval STRING = "HELLO" + %SUBSTR(*BLANKS:1:10) + "WOW"
0
 
bobdylan75Author Commented:
thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now