Re: Can a 4GL program read an ASCII file?
Posted in 1994
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
In article <357f7q$i0l@search01.news.aol.com>, hoopscraz@aol.com (HoopsCraz) wrote: > I'm trying to create a process that will read in an ASCII file one record > at a time and update appropriate tables based on a key. The ASCII file > consists transaction headers that may have one or many detail lines > following them. > > My question is this: Is it possible for a 4GL program to read directly > from > an ASCII file? I have looked briefly at using a C program, would this be > the > solution to choose, using PUSH and POP? > > Any suggestions would be appreciated. Well, you could load the ASCII file into a temp table of some sort which has only one column of type CHAR(255) and then manipulate the rows of the table accordingly. You might need to do some preprocessing on this one to insure you keep the data in the file in appropriate order. Prepending an ascending integer and delimiter character to each line with perl, C, or /bin/sh, and having two columns (one integer and one char) should be enough. You might find it easier to do if you use perl to read the ASCII file and then call a 4ge with some command line parameters for execution. This will work best if you have relatively few items to pass along the command line. -- Jim Holthaus email: james-holthaus@uiowa.edu phone: 319/335-3138 Programmer-Analyst, Univ of Iowa, Iowa Memorial Union Info Systems It works better if you plug it in.