?
Solved

4GL Looping and export to CSV file

Posted on 2011-10-06
4
Medium Priority
?
1,846 Views
Last Modified: 2013-12-25
Hi EE,

i've never done programming, but i'm trying to get a loop to work in progress

all i'm after doing is getting the code below to export the same again and again on different lines a 100 times.

i know only one line is been update in the table so it only exports the one line on the csv

can anyone help me

Cheers

Ross
output to value ("c:\test.csv").
  
		 
		     for each ttud01 where ttud01.rowmod = 'U':
			     export delimiter ',' ttud01.Key1 ttud01.Key2 ttud01.Key3 ttud01.Key4  skip.
		     end.
			

     output close.

Open in new window

0
Comment
Question by:Ross Turner
  • 2
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
ahensch earned 2000 total points
ID: 36931792
/* Use the REPEAT statement */

DEFINE VARIABLE vCount AS INTEGER NO-UNDO.

OUTPUT TO VALUE ("c:\test.csv").

FOR EACH ttud01 where ttud01.rowmod = 'U':
  REPEAT FOR vCount = 1 TO 100:
     EXPORT DELIMITER ',' ttud01.Key1 ttud01.Key2 ttud01.Key3 ttud01.Key4  SKIP.
  END.  /* REPEAT**/
END. /* FOR EACH ttud01 */

OUTPUT CLOSE.
0
 
LVL 7

Author Comment

by:Ross Turner
ID: 36933118
When I used your code... Which by the way i was very excited about it came up with the error can't understand after vCount I double checked the code and it's spot on... Any ideas ??? But thank you so much for your help so far.

Ross
0
 
LVL 2

Expert Comment

by:ahensch
ID: 36933139
REPEAT vCount = 1 TO 100:
0
 
LVL 7

Author Closing Comment

by:Ross Turner
ID: 36941505
HI  ahensch, thank you so much for your help with this little bit of code. i've never been so happy to see a csv file in a folder as i was today.

i might need your help again in the not to distant future.

Thank you

Ross
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question