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
 

 

Count records

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

New User


Joined: 28 Jan 2010
Posts: 16
Location: Portugal

PostPosted: Mon Mar 21, 2011 10:24 pm    Post subject: Count records
Reply with quote

Hi!

I know that DFSORT can COUNT records, and put a TEXT into a output file but I have a problem that with this:

I have this input file - named HEADERS:
Code:

0 XXXXXXXXXX
1 XXXXXXXXXX
1 XXXXXXXXXX
0 XXXXXXXXXX
1 XXXXXXXXXX
0 XXXXXXXXXX
1 XXXXXXXXXX


And this input file - named TEMPLATE:
Code:
  ALLOCATE DATASET('XXXX.SXS.FILE.G????V00') NEW REUSE CATALOG -
  LIKE('XXXX.SXS.OTHER.FILE')


I want to repeat the file TEMPLATE X times where X is the count of zeros in byte 1 of HEADERS. At the same time I need to replace string '????' by the sequence from 1 until the count of zeros in byte 1 of input file, like this.
Code:
  ALLOCATE DATASET('XXXX.SXS.FILE.G0001V00') NEW REUSE CATALOG -
  LIKE('XXXX.SXS.OTHER.FILE')                             
  ALLOCATE DATASET('XXXX.SXS.FILE.G0002V00') NEW REUSE CATALOG -
  LIKE('XXXX.SXS.OTHER.FILE')                             
  ALLOCATE DATASET('XXXX.SXS.FILE.G0003V00') NEW REUSE CATALOG -
  LIKE('XXXX.SXS.OTHER.FILE')                             


Can this be done with DFSORT?

Thank you,
Bruno Oliveira
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Mar 21, 2011 10:57 pm    Post subject: Reply to: Count records
Reply with quote

Bruno Oliveira,

Use the following DFSORT JCL which will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
0 XXXXXXXXXX                                               
1 XXXXXXXXXX                                               
1 XXXXXXXXXX                                               
0 XXXXXXXXXX                                               
1 XXXXXXXXXX                                               
0 XXXXXXXXXX                                               
1 XXXXXXXXXX                                               
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  INCLUDE COND=(1,1,CH,EQ,C'0')                           
  OUTFIL BUILD=(C'ALLOCATE DATASET(''',                   
                C'XXXX.SXS.FILE.G',SEQNUM,4,ZD,C'V00''',   
                C') NEW REUSE CATALOG - ',/,               
                C'LIKE(''',                               
                C'XXXX.SXS.OTHER.FILE''',C')',80:X)       
//*
Back to top
View user's profile Send private message
Bruno Oliveira

New User


Joined: 28 Jan 2010
Posts: 16
Location: Portugal

PostPosted: Mon Mar 21, 2011 11:04 pm    Post subject:
Reply with quote

I didn't knew about the / !

It works like a charm. Many thanks, Skolusu!
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 CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 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
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm


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