310 pts.
 how to ‘*’ in character field in RPGILE printer file
i have a charecter fied in printer file( in rpg ile) and i want to fill it with  65 '*' 1 way is to move '***** .....*' is there any way to move 65  '*' in a single command , can we do it by edtword (as we know it can we done for numeric vclues) please tell me ...

Software/Hardware used:
as400, rpgle
ASKED: January 18, 2010  11:49 AM
UPDATED: January 20, 2010  4:13 PM

Answer Wiki:
You can use a simple EVAL statement like this one. EVAL CHARFIELD = *ALL'*' --------------------------------------------------------------------------------------------------------- ASSUMING the character field is 65 characters long, then the above will work. that will fill the entire field. If the field he wants the 65 '*' in is longer, he will need to create a work field that is 65 long, fill it with '*' and set the field equal to the work field. <pre> d wrk_stars ds d 1a inz('*') dim(65) </pre> In the C specs. C ' ':'*' XLATE LINE Line This will fill line with all *.
Last Wiki Answer Submitted:  January 20, 2010  4:13 pm  by  BigKat   7,185 pts.
All Answer Wiki Contributors:  BigKat   7,185 pts. , Oldtonew   120 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

You can also use
WorkField = *all’*’

 32,945 pts.

 

Why all this confusing comments on BigKat’s answer. His answer

EVAL CHARFIELD = *ALL'*'

works for all field-lenths (at least with v6r1 ILE-RPG).

 2,540 pts.

 

I meant that suppose charfield was 80 char and he ONLY wanted 65 ‘*’

Then he needs to define a 65 char field to use to set charfield to
:)
BigKat

 7,185 pts.

 

and btw, I am the one who made all the confusing comments on Oldtonew’s answer

 7,185 pts.

 

Srry – I understand now tht I have added to the confusion and misunderstanding of the original question. I hope to be excused, by telling you the one line RPG code answer to the challenge:

d w80             s             80 
%subst(W80:1:65) = *all'*';

The above code puts 65 asterisks leftmost into the 80 character field (w80).
Voila :-)

 2,540 pts.

 

Bravo DanTheDane!

Truly the best solution of all!

 7,185 pts.