Problem solve Get help with specific problems with your technologies, process and projects.

Converting alpha fields

We have a file that contains an alpha customer number (required because of EDI standards). The customer number in our application software is 9,0. Is there a way to create a logical view over either the EDI file, or our application files, that will convert the alpha field to a numeric field in the logical?
You can create a logical file that just maps the field to a number field data type. If COL1 was the alpha customer number field in the physical file, the Logical file DDS would just define a new data type for COL1.

COL1 9S 0

SQL Views can also be used. SQL Views are equivalent to non-keyed logical file and actually can be opened as a non-keyed logical file by HLL applications. SQL Views offer superior functions and expression capabilities that logical files. The following SQL View could be created directly over the EDI file. This example assumes that the EDI file is stored as one large character column in an iSeries file & that the customer number is the first nine bytes of the EDI data record. create view v1 (custnum) as (select decimal(substr(c1,1,9),9,0) from edifile)


Search400.com's targeted search engine: Get relevant information on DB2/400.

The Best Web Links: tips, tutorials and more.

Check out this online event, Getting the Most out of SQL & DB2 UDB for the iSeries.

Dig Deeper on Oracle on iSeries

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.