Copy field1,field2 to newfile sdf>>>
Copy so.compcde,so.ornum,so.custcde to sample1 sdf>>>
>>COPY TO newFile sdf FIELDS field1,field2 >>lnRec = _TALLY >>STRTOFILE(PADL(TRANSFORM(lnRec),2,[0])+CHR(13)+CHR(10)+FILETOSTR([newfile.txt]),[newfile.txt]) >>>
>lcFile='newfile.txt' >Copy field1,field2 to (lcFile) sdf >StrToFile(Transform(_tally,'@L 99')+Chr(13)+Chr(10)+FileToStr(lcFile),lcFile)yes sir, thank you for the solution, that's why im using this to make it simple:
StrToFile(Transform(_tally,'@L 99')+Chr(13)+Chr(10)+FileToStr(lcFile),lcFile)