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 Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 4 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts ISMF Difference between volume count ... upendrasri IBM Tools 2 Tue Dec 05, 2017 12:40 pm
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm

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