I've one sequential file, That file contains millians of
Junk & CHAR recoreds example

File 1
,,,,,...,,,.....,.,.INFOSYS.....,,,,,,,,,,,WIPRO...........,
,...,..,.

My questions is : I want omit the 44th posstion to 4 CHAR
(WIPRO) remaining things I want output file (including Junk
CHAR also)...
How can we slove this problem & give me a syntax.
Please provide the result as soon as possible.

Answers were Sorted based on User's Feedback



I've one sequential file, That file contains millians of Junk & CHAR recoreds example ..

Answer / srinivas yadav

//SYSIN DD *
SORT FIELDS = COPY
EXCLUDE=(44,4,CH,EQ,C'WIPR')
/*
//

Is This Answer Correct ?    13 Yes 1 No

I've one sequential file, That file contains millians of Junk & CHAR recoreds example ..

Answer / vs kumar

HI LU,

YOU HAVE MISSED THE SORT FIELDS = COPY
I HAVE CORRECTED IT. PLEASE LET ME KNOW IF I AM WRONG

//EXAMP JOB A400,PROGRAMMER
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=INP1,DISP=old
//SORTOUT DD DSN=OUTPUT,DISP=(,PASS),UNIT=3390,
// SPACE=(CYL,(5,1)),DCB=(LRECL=??)
//SYSIN DD *
SORT FIELDS = COPY
OMIT COND=(44,4,CH,EQ,C'WIPO')

Is This Answer Correct ?    5 Yes 1 No

I've one sequential file, That file contains millians of Junk & CHAR recoreds example ..

Answer / lu

//EXAMP JOB A400,PROGRAMMER
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=INP1,DISP=old
//SORTOUT DD DSN=OUTPUT,DISP=(,PASS),UNIT=3390,
// SPACE=(CYL,(5,1)),DCB=(LRECL=??)
//SYSIN DD *
OMIT COND=(44,4,CH,EQ,C'WIPO')

Is This Answer Correct ?    3 Yes 1 No

I've one sequential file, That file contains millians of Junk & CHAR recoreds example ..

Answer / pkb

This can be done using SORT utility
//STEP1 exec PGM=SORT
//STEPLIB ........
.....................
//SORTIN dd DSN=INPUT.FILE
...
//SORTOUT DD DSN=OUTPUT.FILE
...
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,73,74,10)
//SYSOUT DD SYSOUT=*

THE FILE LENGTH IS CONSIDERED AS 83

Is This Answer Correct ?    0 Yes 0 No

I've one sequential file, That file contains millians of Junk & CHAR recoreds example ..

Answer / naga

i think , WIPRO is 5 chars not 4 chars.

pls check the blow syntax.

SORT FIELDS = COPY
OMIT COND=(44,5,CH,EQ,C'WIPRO')

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JCL Interview Questions

A file has dta in S9(09) COMP format. How do I move the data into a character field X(10)?

2 Answers  


is step name is compulsory in jcl ?

2 Answers  


Passing a variable parm from JCL to a cobol/db2 program

1 Answers   IBM,


how can we merge two input files from two different jobs into one output file ? Please ans any one ASAP?

1 Answers  


Can we use two or more SYSPUNCH DD statements in a JCL for multiple unload (SYSREC00 & SYSREC01)..?

1 Answers  






How to submit multiple jobs. These jobs are members in PDS. The second job should run if the first job runs successfully and so on.

1 Answers  


after submiting the jcl.how do you know that the job has been completed.

4 Answers   ACS,


Is condition checking possible in jcl? If yes, how?

0 Answers  


We have 100 steps in a procedure and we need to run the jcl and execute only 25th step in the proc and not the remaining steps. How can we do it?

5 Answers   IBM, JPMorgan Chase,


What 3 guidelines do we have to follow when concatenating DD statements?

3 Answers  


Suppose i have 2 steps in my pgm. Step1- creates a file, Step2 - generates report from file in step1, What changes have to be made in Step2, so that if the file in Step1 is empty Step2 should not be executed? No changes to be made to Step1.

4 Answers   TCS,


What are the utility programs in jcl?

0 Answers  


Categories