Hi Terri,

you do not have to define a data structure,
you simply can move the varying field into a field with fixed format length
with a single EVAL-Statement.

H OPTION(*NODEBUGIO: *SRCSTMT) CVTOPT(*DATETIME:*VARCHAR)
D InEmp           S             25A   Varying
D WkEmp           S             25
D*
C                   EVAL      WkEmp = InEmp

Birgitta
-----Ursprungliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]Im Auftrag von
THarteau@xxxxxxxxxxxxxxxxxx
Gesendet: Montag, 3. Oktober 2005 18:14
An: RPG programming on the AS400 / iSeries
Betreff: Converting VARCHAR fields



Hi,
      I have an SQLRPGLE program that has a VARCHAR field as an input parm.
I am having trouble converting it to an alpha field.  This is the relevant
code I have.

H OPTION(*NODEBUGIO: *SRCSTMT) CVTOPT(*DATETIME:*VARCHAR)
D InEmp              S             25A   Varying
D WkEmp           S             25
D                 DS
D String                  1    255A   VARYING
D  Length               1      4B 0
D  Data                   3    255
D*
C                   EVAL      String = InEmp
C                   EVAL      WkEmp = Data

When I put in debug, after the last EVAL, WkEmp still has the length at the
beginning of the field. I shows up as a green block 2 spaces wide, then my
value.  What am I doing wrong?

<===================================================>

Terri Harteau
Felker Brothers Corporation
****************
"The happiest people don't necessarily have the best of everything.
They just make the best of everything!"
****************




--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.