JCL SORT utility

Can we copy the data of two input files to two output files using SORT utility with the data as 'SORT FIELDS=COPY' in the same step?

Showing Answers 1 - 13 of 13 Answers

Meraj

  • Oct 16th, 2007
 

No we cannot copy two input files to two output files using sort utility in one step.
The job will not abend,but the second output dataset will be empty.
below is the jcl...
//xyz07t  JOB (SSY295),'MN',NOTIFY=SSY297,                  
//            CLASS=H,MSGCLASS=X                              
//*                                                         
//STEP0020 EXEC PGM=SORT                                    
//SYSPRINT DD  SYSOUT=*                                     
//SYSOUT   DD  SYSOUT=*                                     
//SORTIN   DD  DSN=Input.dataset,DISP=SHR                
//SORTOUT  DD  DSN=output1.dataset,DISP=(,CATLG,DELETE),  
//             UNIT=SYSDA,SPACE=(CYL,(50,10),RLSE),         
//             DCB=(RECFM=FB,LRECL=1300)                    
//SORTIN1  DD  DSN=Input.dataset,DISP=SHR                
//SORTOUT1 DD  DSN=output2.dataset,DISP=(,CATLG,DELETE),  
//             UNIT=SYSDA,SPACE=(CYL,(50,10),RLSE),         
//             DCB=(RECFM=FB,LRECL=1300)                    
//SYSIN DD *                                                
 SORT FIELDS=COPY                                           
/*                                                          

  Was this answer useful?  Yes

There is a utility in TSO/ISPF named "SRCHFOR". If you want to search for a particular string, then goto 3.4 option and display all the versions of the GDG. Type SRCHFOR command in the command prompt and hit enter. A dialogue box will open. Type the String(Max.6 Strings) and hit enter. It will display the list of GDG with " Strings Found".

  Was this answer useful?  Yes

Abhishek Datta

  • Jul 20th, 2011
 

No we can splice two files into two output files in one step using sort utility...

  Was this answer useful?  Yes

Aditya Mehta

  • Jun 27th, 2012
 

We can copy two input files to two output files in JCL using ICETOOL.

//JOBNAM1 JOB (123),XY,NOTIFY=&SYSUID,CLASS=X,MSGCLASS=X
//*
//STEP01 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
Text Data1
Text Data2
/*
//IN2 DD *
String01 text
String02 data
/*
OUT1 DD DSN=OUTPUT.FILE3,DISP=(OLD,CATLG)
OUT2 DD DSN=OUTPUT.FILE4,DISP=(OLD,CATLG)
//*
//TOOLIN DD *
COPY FROM(IN1) TO(OUT1)
COPY FROM(IN2) TO(OUT2)
/*

  Was this answer useful?  Yes

Sandeep Pal

  • Aug 2nd, 2012
 

We can sort the two input file into two output file.


Code
  1. //TDPSNPPJ JOB (9927),SANDEEP PAL,CLASS=D,NOTIFY=

  2. //         MSGLEVEL=(1,1),MSGCLASS=U,TIME=(0,1)    

  3. //STEP1     EXEC PGM=SORT                          

  4. //SORTIN    DD DSN=TDP.SANDEEP.PS1,DISP=SHR        

  5. //          DD DSN=TDP.SANDEEP.PS2,DISP=SHR        

  6. //SORTOF01  DD DSN=TDP.SANDEEP.PS2,DISP=SHR        

  7. //SORTOF02  DD DSN=TDP.SANDEEP.PS3,DISP=SHR        

  8. //SORTWK01 DD SPACE=(TRK,(1,1)),UNIT=SYSDA        

  9. //SYSOUT   DD SYSOUT=*                            

  10. //SYSPRINT DD SYSOUT=*                            

  11. //SYSIN DD *                                      

  12.       SORT FIELDS=COPY                            

  13.       OUTFIL FILES=01                              

  14.       OUTFIL FILES=02                              

  15. /*                                                

  16. //                                                


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions