2

I am trying to sort a file using DFSORT utility, the JCL is running successfully with code maxcc=00 but the output file I am getting is empty, please help me,

My input file

02AAP000000701050000190116200116012013173000  01R300118
03PC PIFIXSYS20111800FIX FOR 12LA UPDATE               
03PC PIFIXSYS20050700ORG DATE FIX                      
03PC PIFIXSYS1911270012AI LINE1 AND SORT FIX           

I want only first line of my input to get in output file but getting empty file. My JCL for sort

//STEP030  EXEC PGM=SORT                                      
//SORTIN    DD DISP=SHR,DSN=T.CAOS.PE8523.PIF.MSTEXT.EXPAND   
//*                                                           
//SORTOUT   DD DSN=T.CAOS.PE8523.PIFFIX.SORTED,               
//             DISP=(NEW,CATLG,DELETE),                       
//             STORCLAS=SCTSO,                                
//             MGMTCLAS=MCTSO,                                
//             RECFM=VB,LRECL=304,BLKSIZE=0,                  
//             SPACE=(CYL,(10,5),RLSE)                        
//SYSOUT    DD SYSOUT=*                                       
//SYSIN    DD    *                                            
  SORT FIELDS=COPY                                            
  INCLUDE COND=(1,2,CH,EQ,C'02')                              
/*                                                            

error log in spool

SYSIN :                                                                       
  SORT FIELDS=COPY                                                      008800
  INCLUDE COND=(1,2,CH,EQ,C'02')                                        008900
WER813I  INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED                
WER276B  SYSDIAG= 13300297, 21826883, 21826883, 21059935                      
WER164B  7,908K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,            
WER164B     0 BYTES RESERVE REQUESTED, 2,488K BYTES USED                      
WER146B  32K BYTES OF EMERGENCY SPACE ALLOCATED                               
WER108I  SORTIN   : RECFM=VB   ; LRECL=   304; BLKSIZE= 27998                 
WER073I  SORTIN   : DSNAME=T.CAOS.PE8523.PIF.MSTEXT.EXPAND                    
WER110I  SORTOUT  : RECFM=VB   ; LRECL=   304; BLKSIZE= 27998                 
WER074I  SORTOUT  : DSNAME=T.CAOS.PE8523.PIFFIX.SORTED                        
WER410B  5,856K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16-MEGABYTE LINE,
WER410B     0 BYTES RESERVE REQUESTED, 2,344K BYTES USED                      
WER055I  INSERT          0, DELETE         37                                 
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                 
WER416B  SORTIN   : EXCP'S=1,UNIT=3390,DEV=C679,CHP=(BCC1CDCED0D3,1),VOL=TALF0A
WER416B  SORTOUT  : EXCP'S=0,UNIT=3390,DEV=C49A,CHP=(BCC1CDCED0D3,1),VOL=TASF06
WER416B  TOTAL OF 1 EXCP'S ISSUED FOR COPYING                                 
WER054I  RCD IN         37, OUT          0                                    
WER169I  RELEASE 2.1 BATCH 0539 TPF LEVEL 3.0                                 
WER052I  END SYNCSORT - PE8523AP,STEP030,,DIAG=CE00,51C2,E2AC,006E,8652,68EB,26A8,2460,0100,0300
7
  • Please remove inappropriate tags! This is a sort question, mainframe, and jcl tags are fine, but the question has nothing to do with neither cobol, nor rexx.
    – phunsoft
    Jan 15, 2021 at 11:26
  • @phunsoft, sorry for adding rexx and cobol, I know it is not related to it but I thought cobol and rexx are used in mainframes, so people following cobol and rexx can help me, but no issues now, I have removed the rexx and cobol tags.
    – Siddhesh
    Jan 15, 2021 at 11:39
  • Actually the JCL tag is wrong as well as there is no error with the JCL but your sort control statements which are not JCL. There is also a SYNCSORT tag that you could use. And an alternative solution is to use STOPAFT=n where n is the number of records to process before stopping.
    – NicC
    Jan 15, 2021 at 12:47
  • @NicC I don't understand your suggstion to use STOPAFT.
    – phunsoft
    Jan 15, 2021 at 19:36
  • "I want only first line of my input to get in output file" therefor a simple copy operation with STOPAFT=1 will copy the first record only. Job done.
    – NicC
    Jan 15, 2021 at 21:49

1 Answer 1

6

You're sorting a RECMF=VB data set, so your first data byte in the records is in position 5. Adjust the INCLUDE statement accordingly:

INCLUDE COND=(5,2,CH,EQ,C'02')

1
  • Thanks for the solution, it is working fine now.
    – Siddhesh
    Jan 15, 2021 at 11:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.