Skip to main content
added 99 characters in body
Source Link
Michael Vehrs
  • 2.2k
  • 10
  • 7

Your question is not very clear to me, but I think you may intend:

if( $12 == "A" ) {
    filename="outdir/Customer_Create_Records.dat" ;
    print >> filename;close(filename)
}

OtherwiseWithout the curly braces, the "then" clause of the conditional ends at the first semicolon. As a consequence, you might attempt to write lines to your output file before its name has been defined.

Your question is not very clear to me, but I think you may intend:

if( $12 == "A" ) {
    filename="outdir/Customer_Create_Records.dat" ;
    print >> filename;close(filename)
}

Otherwise, you might attempt to write lines to your output file before its name has been defined.

Your question is not very clear to me, but I think you may intend:

if( $12 == "A" ) {
    filename="outdir/Customer_Create_Records.dat" ;
    print >> filename;close(filename)
}

Without the curly braces, the "then" clause of the conditional ends at the first semicolon. As a consequence, you might attempt to write lines to your output file before its name has been defined.

Source Link
Michael Vehrs
  • 2.2k
  • 10
  • 7

Your question is not very clear to me, but I think you may intend:

if( $12 == "A" ) {
    filename="outdir/Customer_Create_Records.dat" ;
    print >> filename;close(filename)
}

Otherwise, you might attempt to write lines to your output file before its name has been defined.