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 of two files in single SYSIN

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Fri Nov 10, 2006 1:06 pm    Post subject: Record Count of two files in single SYSIN
Reply with quote

Hi,

I need to add a Trailer record in a flat file in the following format:

Code:
ZZZZZZZZ<Rec. cnt of File1 (8digits)><Rec. cnt of File2 (6digits)>

where 'ZZZZZZZZ' is a hard coded value.

Is this possible using ICEMAN/DFSORT with just a single SYSIN?

I've been using the following code to get the record count of one file:

Code:
//STEP001  EXEC PGM=ICEMAN                                   
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD DISP=SHR,DSN=i/p file   
//SORTOUT  DD DSN=o/p file,                 
//            DISP=(NEW,CATLG,CATLG),                       
//            DCB=(RECFM=FB,LRECL=80),SPACE=(CYL,(1,1),RLSE)
//SYSIN    DD *                                             
  OPTION COPY                                               
  OUTFIL REMOVECC,NODETAIL,                                 
  TRAILER1=(1:'ZZZZZZZZ',9:COUNT=(M11,LENGTH=8))             
/*   


Thanks in advance,
Twissi.
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: Fri Nov 10, 2006 10:05 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//STEP000  EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DISP=SHR,DSN=i/p file2
//SYM DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
* Create a DFSORT symbol with the count for file2 as:
* CT2,'nnnnnnnn'
  OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,OUTREC=(80X),
    TRAILER1=('CT2,''',COUNT=(M11,LENGTH=8),'''')
/*
//STEP001  EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN   DD DISP=SHR,DSN=i/p file1
//SORTOUT  DD DSN=o/p file,
//            DISP=(NEW,CATLG,CATLG),
//            DCB=(RECFM=FB,LRECL=80),SPACE=(CYL,(1,1),RLSE)
//SYSIN    DD *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
* Use CT2 in the trailer record.
  TRAILER1=(1:'ZZZZZZZZ',9:COUNT=(M11,LENGTH=8),17:CT2)
/*
Back to top
View user's profile Send private message
twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Tue Nov 14, 2006 9:44 am    Post subject:
Reply with quote

Frank,

Thanks a ton, it really did work for me!

Regards, Twissi.
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm


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