Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 How to Count a particular record in a... Mounika Nemani DFSORT/ICETOOL 5 Tue May 29, 2018 1:07 pm
No new posts MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Creation of Datasets dynamically on t... Raghu M N DFSORT/ICETOOL 8 Fri Mar 16, 2018 12:56 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us