{\
	if ( NR == 1 ) {\
		last="no";\
		last_if="no";\
		continua="no";\
		numT="zero";\
		numE="zero";\
		numIF=0;
		weare="out";\
		printf "LASTCC=$?; export LASTCC;";\
		printf "  MAXCC=$LASTCC; export MAXCC\n";\
	}\
	if ( $1 == "IF" ) {\
		numIF+=1;\
		weare="Then";\
		numT="0";\
		numE="0";\
		last_if="\tnull=0\n";\
		if ( last != "no" ) {\
			printf "%s",last;\
			last="no";\
		}\
		uno="if";\
		if ( $2 == "MAXCC" ) {\
			due=$2;\
		} else if ( $2 == "LASTCC" ) {\
			due=$2;\
		}\
		tre="`getoper \""$3"\"`";\
		quattro=$4;\
		printf "%s [ $%s %s %s ] \nthen\n",uno,due,tre,quattro;\
		if ( $6 == "DO" ) {\
			numT="many";\
		}\
	} else if ( $1 == "THEN" ) {\
		if ( $2 == "DO" ) {\
			numT="many";\
		}\
	} else if ( $1 == "ELSE" ) {\
		weare="Else";\
		numT="0";\
		if ( last_if != "no" ) {\
			printf "%s",last_if;\
		} else {\
			last_if="\tnull=0\n";\
		}\
		printf "else\n";\
		last="no";\
		if ( $2 == "DO" ) {\
			numE="many";\
		}\
	} else if ( $1 == "DO" ) {\
		if ( weare == "Else" ) {\
			numE="many";\
		} else if ( weare == "Then" ) {\
			numT="many";\
		}\
	} else if ( $1 == "END" ) {\
		if ( last != "no" ) {\
			printf "%s",last;\
			last="no";\
		}\
		if ( weare == "Else" ) {\
			numIF-=1;\
			weare="out";\
		}\
		last="fi\n";\
	} else if ( $1 == "SET" ) {\
		if ( last != "no" ) {\
			printf "%s",last;\
			last="no";\
		}\
		if ( numIF == 0 ) {\
			indent="";\
		} else {\
			if ( weare == "Else" ) {\
				if ( numE != "many" ) {\
					weare="out";
					last="fi\n";\
				}\
			}\
			indent="\t";\
		}\
		if ( last_if != "no" ) {\
			last_if="no";\
		}\
		if ( NF == 3 ) {\
			printf "%s%s%s",indent,$2,$3;\
			if ( $2 == "LASTCC" ) {\
				printf "; export LASTCC;  MAXCC=`maxcc`; export MAXCC\n";\
			} else {\
				printf "; export MAXCC\n";\
			}\
		} else if ( NF == 4 ) {\
			printf "%s%s=%s",indent,$2,$4;\
			if ( $2 == "LASTCC" ) {\
				printf "; export LASTCC;  MAXCC=`maxcc`; export MAXCC\n";\
			} else {\
				printf "; export MAXCC\n";\
			}\
		}\
	} else if ( $1 == "END_SYSIN" ) {\
		if ( last_if != "no" ) {\
			last_if="no";\
		}\
		if ( last != "no" ) {\
			printf "%s",last;\
			last="no";\
		}\
		printf "echo IDCAMS PROCESSING COMPLETE.\n";\
		printf "echo MAXIMUM CONDITION CODE WAS $MAXCC\n";\
		printf "echo $MAXCC > status.${JON}";\
	} else if ( $1 == "STARTSH" ) {\
		if ( last != "no" ) {\
			printf "%s",last;\
			last="no";\
		}\
		printf "\n######### start sh\n";\
		insh="true";\
	} else if ( $1 == "ENDSH" ) {\
		printf "######### end sh\n\n";\
		insh="false";\
	} else if ( $1 != "" ) {\
		if ( insh == "true" ) {\
			print $0;\
		} else {\
			if ( last_if != "no" ) {\
				last_if="no";\
			}\
			if ( last != "no" ) {\
				printf "%s",last;\
				last="no";\
			}\
			if ( continua == "no" ) {\
				if ( numIF == 0 ) {\
					indent="";\
				} else {\
					if ( weare == "Else" ) {\
						if ( numE != "many" ) {\
							weare="out";
							last="fi\n";\
						}\
					}\
					indent="\t";\
				}\
				printf "%s%s \"",indent,$1;\
			} else {\
				if ( continua == "plus" ) {\
					printf "%s",$1;\
				} else {\
					printf " %s",$1;\
				}\
				continua="no";\
			}\
			for ( i = 2 ; i <= NF ; ++i ) {\
				if ( $i == "-" ) {\
					continua="minus";
				} else if ( $i == "+" ) {\
					continua="plus";
				} else {\
					printf " %s",$i;\
				}\
			}\
			if ( continua == "no" ) {\
				printf "\"\n";\
				printf "%sLASTCC=$?; export LASTCC;",indent;\
				printf "  MAXCC=`maxcc`; export MAXCC\n";\
				printf "echo FUNCTION COMPLETED.\n";\
				printf "echo HIGHEST CONDITION CODE WAS $MAXCC\n";\
			}\
		}\
	}\
}
