Page 1 of 1

How to remove to junk characters?

Posted: Tue Jul 31, 2018 1:01 pm
by Mukul Thriphati
Hi,

In a recent interview I was asked how to remove to junk characters from a file using COBOL or SORT? I just could not answer this question. Can somebody Help how to approach this question?

Re: How to remove to junk characters?

Posted: Tue Jul 31, 2018 4:45 pm
by Robert Sample
First, be aware that THERE IS NO SUCH THING AS A JUNK CHARACTER! Every character is one of the defined collating sequence, so by definition you cannot have junk characters.

Second, to change a data set (files exist only on tape or in Unix System Services on z/OS), you could write code to reformat the data as desired in COBOL, or you could write control statements for SORT to (for example) use BUILD to reformat the data as desired.