Write a JCL by using the below requirement:
File1 =1, File2 =11 and output needs to come as File3 =111?
Answer Posted / sathish kumar chandra sekaran
//D362967J JOB (UBS-UBS-D362967-XXX-999),CLASS=C,
// MSGCLASS=X,MSGLEVEL=(1,1),NOTIFY=D362967
//STEP1 EXEC PGM=SORT
//SORTIN DD *
1
/*
//SORTOUT DD DSN=D362967.TEST.PS3,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSDUMP DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,8,60:SEQNUM,3,ZD,START=1,INCR=2)
/*
//STEP2 EXEC PGM=SORT
//SORTIN DD *
11
/*
//SORTOUT DD DSN=D362967.TEST.PS4,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSDUMP DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:C'1',2:1,8,60:SEQNUM,3,ZD,START=2,INCR=2)
/*
//STEP3 EXEC PGM=SORT
//SORTIN DD DSN=D362967.TEST.PS3,DISP=SHR
// DD DSN=D362967.TEST.PS4,DISP=SHR
//SORTOUT DD DSN=D362967.TEST.PS5,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSDUMP DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(60,3,CH,A)
/*
//STEP4 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=D362967.TEST.PS5,DISP=SHR
//OUT1 DD SYSOUT=*
//TOOLIN DD *
SPLICE FROM(IN1) TO(OUT1)-
ON(1,1,CH) KEEPNODUPS WITH(2,2)
/*
This will meet your requirement.
Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What is the job entry system used in your project? based on what criteria the sequence of jobs are picked if priority is not mentioned in the job card?
what happens in execution stage in job processing?
How does jcl act on code(if you take a cobol program)?
Differentiate between the joblib and the steplib statements?
Must tape dataset definitions include vol=ser specifications?
We can use PASS with permanent datasets also. THEN Which is the condition in which we may use PASS (instead of KEEP) with permanent data sets, while there is no need to specify UNIT and VOL for them like temporary data sets (in cas we use KEEP for permanent data sets) ?
what is JCL?
Can I share my data with other jobs? How?
I have many files which i am receiving from client everyday. I have one step for every file to check for empty or not. Here client gives 30 files i need to check for every file for empty or not and i need to perform 30 steps. Can I do it in single step. Dynamically i need to change the File name in my step.
write a jcl to execute a job by 7:00 am on jan 20,1986?
What is jcl in mainframe, and how many types of jcl statements are there for a job?
What is the function of //jcllib statement?
I have a COBOL program that ACCEPTs some input data. How do you code the JCL statement for this?
Explain how can an in-stream dataset be terminated?
Explain about LMFREE�free data set from its association with data ID