IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Reg Count of the records in a file using sort


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sanath sekhar Reddy N

New User


Joined: 31 Oct 2012
Posts: 30
Location: INDIA

PostPosted: Sun Mar 24, 2013 12:18 am
Reply with quote

Hi
I am having a file with records more than 2 lakhs ,i need to know the count of the number of records in the output file along with the data.

I have used the COUNT operator in ICETOOL ,but this ais giving only count in output file but not the data.
I require data also copied from input file to output file along with the count of records.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sun Mar 24, 2013 12:37 am
Reply with quote

if You look at the output of a sort You will see that the record counts are displayed .

on the other side You did not post enough info to provide a better answer.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sun Mar 24, 2013 12:40 am
Reply with quote

Please show the ICETOOL application you've used. If you're using "NODETAIL ",try after removing that.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Mar 24, 2013 3:48 am
Reply with quote

Please show some sample input, with expected output. Tell us the RECFM and LRECL of both files.

Please run this, and post the sysout for the step here (all the sort messages, with the message codes visible), so we can see what level your Sort is.

Code:
//S1 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DUMMY
//SYSIN   DD   *
  OPTION COPY
/*
Back to top
View user's profile Send private message
Sanath sekhar Reddy N

New User


Joined: 31 Oct 2012
Posts: 30
Location: INDIA

PostPosted: Mon Mar 25, 2013 6:54 pm
Reply with quote

Hi

Thanks you very much for the response.
iamhaving the below file .

100003521parkstreet mh5213
100003522skelmesdale jl5124
100003523macchester kl5215


i want to get the record count in separate file and inputdata sorted in separate file using sort or icetool ?
Please help.


Cheers
Sanath
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Mar 25, 2013 6:56 pm
Reply with quote

Bill Woodger wrote:
Please run this, and post the sysout for the step here (all the sort messages, with the message codes visible), so we can see what level your Sort is.

Code:
//S1 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DUMMY
//SYSIN   DD   *
  OPTION COPY
/*
Back to top
View user's profile Send private message
Sanath sekhar Reddy N

New User


Joined: 31 Oct 2012
Posts: 30
Location: INDIA

PostPosted: Mon Mar 25, 2013 7:26 pm
Reply with quote

Hi

Pls see the post here below


********************************* TOP OF DATA
OPTION COPY 000
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER054I RCD IN 1, OUT 1
WER169I RELEASE 1.3 BATCH 0513 TPF LEVEL 2.2
WER052I END SYNCSORT -
******************************** BOTTOM OF DATA *****************************




********************************* TOP OF DATA **********************************


00080000
80; BLKSIZE= 80
80; BLKSIZE= 80
CTIVE
1
L 2.2
G=C662
******************************** BOTTOM OF DATA ********************************

regards
Sanath
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Mar 25, 2013 7:45 pm
Reply with quote

You have SyncSort, so topic moved the JCL part of the forum, where SyncSort topics should be.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Mar 25, 2013 7:50 pm
Reply with quote

You will need a SORT statement, with whatever your key is.

Then you need an OUTFIL, with REMOVECC and using the COUNT in TRAILER1.

If you search here for OUTFIL REMOVECC COUNT and TRAILER1 (all of them, not any of them) then you should find some useful samples that you can amend.
Back to top
View user's profile Send private message
Sanath sekhar Reddy N

New User


Joined: 31 Oct 2012
Posts: 30
Location: INDIA

PostPosted: Mon Mar 25, 2013 8:02 pm
Reply with quote

Hi

Thank you for the response

I do not need count in the trailer,
I require the count in the separate file .


Regards
Sanath
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Mar 25, 2013 8:05 pm
Reply with quote

OK, so two OUTFILs. One just to have for the sorted data, the second, with what I've previously mentioned and NODETAIL.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Mon Mar 25, 2013 8:10 pm
Reply with quote

Bill,

I am the forum prognosticator today.

I predict:
Quote:
Please provide me the code for same
Back to top
View user's profile Send private message
sandip_mainframe
Warnings : 2

New User


Joined: 20 Sep 2006
Posts: 63
Location: pune

PostPosted: Mon Mar 25, 2013 8:14 pm
Reply with quote

Hi Sanath,

You can use below JCL -

Code:
//STEP1    EXEC  PGM=SORT                     
//SYSPRINT  DD   SYSOUT=*                     
//SYSOUT    DD   SYSOUT=*                     
//SORTIN    DD   *                           
100003521PARKSTREET MH5213                   
100003522SKELMESDALE JL5124                   
100003523MACCHESTER KL5215                   
//SORTOF01  DD   SYSOUT=*                     
//SORTOF02  DD   SYSOUT=*                     
//SYSIN     DD   *                           
   SORT  FIELDS=COPY                         
   OUTFIL FILES=01,                           
         OUTREC=(1:80X),                     
       TRAILER1=(1:COUNT15),                 
       NODETAIL,                             
        INCLUDE=ALL                           
   OUTFIL FILES=02,INCLUDE=(01,01,CH,EQ,C'1')
/*
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Mar 25, 2013 8:24 pm
Reply with quote

Code:
//STEP1    EXEC  PGM=SORT                     
//SYSPRINT  DD   SYSOUT=*                     
//SYSOUT    DD   SYSOUT=*                     
//SORTIN    DD   *                           
100003521PARKSTREET MH5213                   
100003522SKELMESDALE JL5124                   
100003523MACCHESTER KL5215                   
//SORTOF01  DD   SYSOUT=*                     
//SORTOF02  DD   SYSOUT=*                     
//SYSIN     DD   *                           
   SORT  FIELDS=(whatyouwanttosorton)               

   OUTFIL FILES=01,                           
       TRAILER1=(1:COUNT15),                 
       NODETAIL,                             
        REMOVECC
 
 OUTFIL FILES=02

/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top