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
 

 

Flat file record count with Syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
apes0523

New User


Joined: 23 May 2007
Posts: 2
Location: Fort Worth

PostPosted: Fri Aug 01, 2008 12:36 am    Post subject: Flat file record count with Syncsort
Reply with quote

I am trying to count the number of records in a flat file and if possible assign condition code = 2 if record count >= 150K records. Is this possible using syncsort.

The reason for this is we are trying to code within our job to load a table using TPUMP if there are less than 150K recs but if there are more than that we have to drop our join indexes, MLOAD the data to the table then recreate the join indexes.

Hope that is enough info help me with.

-April
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


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

PostPosted: Fri Aug 01, 2008 12:40 pm    Post subject:
Reply with quote

Hi,

You can start with-
Code:
//STEP001  EXEC  PGM=ICETOOL             
//TOOLMSG  DD SYSOUT=*                   
//DFSMSG   DD SYSOUT=*                   
//IN      DD *                           
AAA 1232                                 
AAA 1232                                 
AAA 1232                                 
AAA 1232                                 
AAA 1232                                 
AAA 1232                                 
//RPT DD DSN=DSN.for.further.processing,DISP=(,,CATLG)
//TOOLIN   DD    *                       
OCCUR FROM(IN) LIST(RPT) NOHEADER BLANK -
  ON(1,3,CH) ON(VALCNT,U04)               
/*                                       

RPT would give you the count of the records,hopefully, now, you can think for further..Good Luck.. icon_smile.gif
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Fri Aug 01, 2008 2:34 pm    Post subject: Reply to: Flat file record count with Syncsort
Reply with quote

Ape,

Quote:
Is this possible using syncsort.


Anuj's code would work only if DFSORT is installed in your site. OCCUR is an opeartor of ICETOOL and comes with DFSORT.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Fri Aug 01, 2008 2:55 pm    Post subject: Re: Reply to: Flat file record count with Syncsort
Reply with quote

Aaru wrote:
Anuj's code would work only if DFSORT is installed in your site. OCCUR is an opeartor of ICETOOL and comes with DFSORT.
Nah..you are on lil wrong track, here is the TOOLMSG statistics.. icon_biggrin.gif
Code:
SYT000I  SYNCTOOL RELEASE 1.5.3 - COPYRIGHT 2004  SYNCSORT INC.
SYT001I  INITIAL PROCESSING MODE IS "STOP"                     
SYT002I  "TOOLIN" INTERFACE BEING USED                         
                                                               
         OCCUR FROM(IN) LIST(RPT) NOHEADER BLANK -             
           ON(1,3,CH) ON(VALCNT,U04)                           
SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0001"               
SYT045I  DATA DISPLAYED ON DDNAME: RPT                         
SYT031I  NUMBER OF RECORDS PROCESSED: 000000000000006         
SYT026I  NUMBER OF SELECTED RECORDS: 000000000000001           
SYT030I  OPERATION COMPLETED WITH RETURN CODE 0               
                                                               
SYT004I  SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 0     

Perhaps you are on little earlier version of SyncSort, if your site is making use of SyncSort; and if so..I'm rich than You.. icon_razz.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2275
Location: @my desk

PostPosted: Mon Aug 04, 2008 7:15 pm    Post subject:
Reply with quote

Hello apes0523,

You may want to try out these.

1) SYNCSORT - This will give you an RC=4, if the input file has < 150k records.
Code:
//SORTIN   DD DSN=your.input.file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                           
 OPTION COPY,NULLOUT=RC4,                                 
 SKIPREC=150000,STOPAFT=1                             
/*       


2) IDCAMS - Here you can set the return-code as per your requirement.
Code:
//STEP001  EXEC  PGM=IDCAMS                                     
//SYSPRINT DD SYSOUT=*                                           
//SYSOUT   DD SYSOUT=*                                           
//INFILE   DD DSN=your.input.file,DISP=SHR           
//OUTFILE  DD SYSOUT=*                                           
//SYSIN    DD *                                                 
 PRINT INFILE(INFILE) OUTFILE(OUTFILE) CHAR COUNT(1) SKIP(150000)
 IF LASTCC=4 THEN SET MAXCC=2                                   
/*                                                               


Thanks,
Arun
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2275
Location: @my desk

PostPosted: Mon Aug 04, 2008 7:33 pm    Post subject:
Reply with quote

My bad day..........IDCAMS may result in RC=12 if the input file has lesser number of records specified in COUNT(n).
Code:
IF LASTCC NE 0 THEN SET MAXCC=2


Thanks,
Arun
Back to top
View user's profile Send private message
apes0523

New User


Joined: 23 May 2007
Posts: 2
Location: Fort Worth

PostPosted: Tue Aug 05, 2008 1:14 am    Post subject: Thanks!
Reply with quote

Thank you so much arcvns, the syncsort was exactly what I needed!!! Thank you all so much for your help.

-April icon_lol.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
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 Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 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


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