IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Record count in a seperate file using SORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Mon Dec 06, 2010 5:37 pm
Reply with quote

Below is my job to concatenate the 2 files and then o write them onto another output file ensuring that there are no duplicates.

In the same step, I like to create another file whose contents are as follows:
filename: PROD.CONTROL.FILE
Contents:
PROD.DATA.OUTPUT1 000012345 DATE

Like this, the file conatins the name of the output file (which contains the merged data records) and the record count it and the current date.

Please let me know Whether I can achieve this using the single sort card ?

Code:
//STEP11   EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=A                                           
//SORTIN   DD DSN=PROD.DATA.SOURCE1,DISP=SHR
//         DD DSN=PROD.DATA.SOURCE2,DISP=SHR
//SORTOUT  DD  DSN=PROD.DATA.OUTPUT1,
//         DISP=(NEW,CATLG,DELETE),...
//SYSIN DD *
  SORT FIELDS=(1,20,CH,A)
  SUM FIELDS=NONE       
/*
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Dec 07, 2010 6:02 am
Reply with quote

With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct, 2010), you can now use DFSORT's new SET Symbols in control statements (JPn) function to do what you asked for like this:

Code:

// SET DSNOUT='PROD.DATA.OUTPUT1'
//STEP11   EXEC PGM=SORT,
// PARM='JP1"&DSNOUT"'
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=PROD.DATA.SOURCE1,DISP=SHR
//         DD DSN=PROD.DATA.SOURCE2,DISP=SHR
//SORTOUT  DD  DSN=&DSNOUT,
//         DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
//         SPACE=(TRK,(5,5))
//TRL  DD  DSN=PROD.CONTROL.FILE,...
//SYSIN DD *
  SORT FIELDS=(1,20,CH,A)
  SUM FIELDS=NONE
  OUTFIL FNAMES=SORTOUT
  OUTFIL FNAMES=TRL,
   REMOVECC,NODETAIL,
   TRAILER1=(JP1,X,COUNT=(M11,LENGTH=9),X,DATENS=(4MD))
/*


For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242

If you don't have the Oct, 2010 PTF installed, ask your System Programmer to install it (it's free).
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top