Avatar of royaltech
royaltech
 asked on

Convert text field to numeric OS/400

I need to copy standard file using cpyf or equivalent by specific date range, but I need to convert a column with a character text string into a numeric field on the copied file. Is there a way to do that during or after the copy?  It’s conflicting with a cross reference report I run in crystal reports which cannot cross links that are not of the same type.

Thanks, Corey
IBM System i

Avatar of undefined
Last Comment
Member_2_276102

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Member_2_276102

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
daveslater

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Member_2_276102

Dave:

If myfile is a "standard file" of type *STMF or it's a flat program-described file, SQL will be a bit more complex. No?

Tom
daveslater

Hi Tom
you are right, i assumed that since they were using  crystal reports that the files would be externally described.

Dave
Member_2_276102

Hmmm... good point (I think). I'm not up on CR, so not sure of all of its features.

Creating a SQL view seemed likely, and your general method is as good as any to create it. But I'm not yet clear why there is an issue in CR. I thought perhaps one file has a field defined character while a related file has the same data in a numeric field. But shouldn't CR allow an SQL statement to link such files anyway?

Tom
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
royaltech

ASKER
I guess I'm over my head, I had our AS400 consultant, PDK build us a logical file, thank you to you all.
Member_2_276102

Corey:

Don't hesitate to ask followup questions if you need clarification in the future. Questions might be "How do I find out my operating system version?" or "How can I display the field description?" You put enough points on this to get premium help, IMO. I'm pretty sure you could have gotten a lot more info out of this.

For what it's worth for future questions.

Tom