Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Record count in a seperate file using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Record count in a seperate file using SORT
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 Moderator


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

PostPosted: Tue Dec 07, 2010 6:02 am    Post subject:
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:

http://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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 1 Sat Aug 19, 2017 2:33 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 10 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us