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


Please Help Members By Posting Answers For Below Questions

How to override a dsn that is contained in a proc called by another proc? I need to do the override in the calling jcl?

718


I need exexution process for JCL programs

1852


Explain how can a jobs execution priority be modified?

742


List the various advantages of using jcl language?

852


Can I share my data with other jobs? How?

670






What are the 2 types of parameters in dd statement?

652


Can an individual step be restricted from using all the jobs allowed cpu time?

1010


Explain the function of dd name parameter with a 2 part structure; audit.report?

899


Define concatenating?

667


Why include statement is used in a jcl?

691


What are the parameter we cannot use in procedure?

640


Is automatic restart possible in jcl?

742


Explain the function of dd disp parameter?

595


What is the significance of addrspc parameter in exec statement?

731


Explain about ISPF/TSO Commands

1313