how to ‘*’ in character field in RPGILE printer file

310 pts.
Tags:
AS/400 Printer File
AS/400 printing
RPGILE
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

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 *.

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • CharlieBrowne
    You can also use WorkField = *all'*'
    41,370 pointsBadges:
    report
  • DanTheDane
    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,555 pointsBadges:
    report
  • BigKat
    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,935 pointsBadges:
    report
  • BigKat
    and btw, I am the one who made all the confusing comments on Oldtonew's answer
    7,935 pointsBadges:
    report
  • DanTheDane
    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,555 pointsBadges:
    report
  • BigKat
    Bravo DanTheDane! Truly the best solution of all!
    7,935 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following