View previous topic :: View next topic
|
Author |
Message |
apes0523
New User
Joined: 23 May 2007 Posts: 2 Location: Fort Worth
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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.. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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..
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.. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
apes0523
New User
Joined: 23 May 2007 Posts: 2 Location: Fort Worth
|
|
|
|
Thank you so much arcvns, the syncsort was exactly what I needed!!! Thank you all so much for your help.
-April |
|
Back to top |
|
|
|