How to remove to junk characters?

All sort of Mainframes Interview Questions.
Post Reply
Mukul Thriphati
New Member
Posts: 6
Joined: Sun Feb 16, 2014 9:04 pm

How to remove to junk characters?

Post 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?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: How to remove to junk characters?

Post 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.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Interview Questions.”