AS400 Mid Range/Convert text file to pyhsical file

Advertisement


Question
Hi! Currently i received some data that contain funny character(ASCII code) which cause problem when i retrieve at AS400. For example: Remark field consists of 50 character but the first 30 character is look okay and follow by a few ASCII character. How do i ignore those ASCII code. Pls advise are they any way for me to overcome it ? Thanks in adavnced.

Cheers,
Yoke Mei

Answer
It may be as simple as specifing *YES on the ignore-decimal-data-errors parameter when you compile the RPG program.  If your file consists of uppercase character data and you want to strip off the bad characters, here's a program to do it (specify your record length).  Be sure you have a safe backup copy of the file before trying the program.

FINPUT  UP   80      DISK
E           REC     80  1      Record image
IINPUT  NS
I                            1  80 REC
C           1       DO  80     R  20
C           REC,R   IFLT 'A'
C           REC,R   ORGT 'Z'
C           REC,R   IFLT '0'
C           REC,R   ORGT '9'
C                   MOVE ' '   REC,R
C                   END
C                   END
C                   END
C                   EXCPT
OINPUT   E
O                   REC   80

- Laird

AS400 Mid Range

All Answers


Answers by Expert:


Ask Experts

Volunteer


Concise Systems/Laird Scranton

Expertise

General AS/400, RPG/400, SDA and CL programming questions. AS/400 performance tuning.

Experience


Past/Present clients
CB Sportswear
Coca-Cola of New York
Encore Paper Company
Golub Corporation
HBO Home Video
Imperial Pools
Kaiser Permanente of NE New York
Mallinckrodt Medical
Marigold Foods
Manpower & Associates
National Datacomputers
New York State Easter Seals Society
New York State Food Merchants Association
Pepsi-Cola Allied Bottlers
Petricca Construction
Taconic Telephone Corporation
TOMRA Recycling
Unistress Corporation

©2012 About.com, a part of The New York Times Company. All rights reserved.