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

Flat file record count with Syncsort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Superior Member


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

PostPosted: Fri Aug 01, 2008 12:40 pm
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: 1287
Location: Chennai, India

PostPosted: Fri Aug 01, 2008 2:34 pm
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

Superior Member


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

PostPosted: Fri Aug 01, 2008 2:55 pm
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: 2481
Location: @my desk

PostPosted: Mon Aug 04, 2008 7:15 pm
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: 2481
Location: @my desk

PostPosted: Mon Aug 04, 2008 7:33 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top