4GL Looping and export to CSV file

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

LVL 7
Ross TurnerManagement Information Support AnalystAsked:
Who is Participating?
 
ahenschCommented:
/* 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
 
Ross TurnerManagement Information Support AnalystAuthor Commented:
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
 
ahenschCommented:
REPEAT vCount = 1 TO 100:
0
 
Ross TurnerManagement Information Support AnalystAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.