I want to purge existing file, create new file using tedit and copy the contents of unstructured file to new file using jlist with the help of TACL macro.
? TACL MACRO
#PURGE $A.B.C
#TEDIT $A.B.C !
#JLIST $D.E.F, PUT $A.B.C, NOPRINT
If I run above code through RUN command in tacl prompt it gives me error like 'name is not either variable or built in function'. Please help, I am new to TACL programming .
It looks like #TEDIT and #JLIST are causing your issue. They are not valid builtins in the TACL language. To make your macro work, I would substitute EDIT there as in below:
Alternatively, you could save yourself the startup time for the 3 runs (PURGE, EDIT and EDIT), by specifying a input file and doing it all within Edit as in below. Note that this will only work if you don't care if $A.B.C just gets its data purged, instead of actually getting rid of $A.B.C and recreating it each time.