Question: Sortof-statement and file allocations



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Question: Sortof-statement and file allocations

Postby Johan Vermeulen » Thu Oct 04, 2012 6:40 pm

Hallo,

I have a question regarding the use of SORTOF-statement.

A SORTIN input file is splitted in several files thru a SORTOF-statement. A total of 140 files
are created that maybe will contain data. Afterwards I added an extra step to control the newly
created SORTOF files, and delete them if empty.
Not with the SPEMPTY statement, but with IDCAMS combined with PRINT statement.
I found no other method that I could use in one step...
(USE SYNCSORT 1.3.2.R)

My question:
When executing the job, we noticed an important increase in ELAPSED Time and CPU Time because of the
extra delete statement.

-> Is there a way to make use of the SORTOF-statement without allocating all the mentioned files?
In other words: Can I use the SORTOF-statement in a way that files, that are not written to, automatically
will be deleted?


Example of as-is:

//S0030 EXEC SPSORT
//* ==== INPUT FILES
//SORTIN DD DSN=sortinfile_1,
// DISP=SHR
//$ORTPARM DD *
VLTEST=0
//SORTOF01 DD DISP=(,CATLG,DELETE),LRECL=12280,RECFM=VB,EXPDT=&EXP05WD,
// DSN=sortoffile_1
//SORTOF02 DD DISP=(,CATLG,DELETE),LRECL=12280,RECFM=VB,EXPDT=&EXP05WD,
// DSN=sortoffile_2
//SORTOF03 DD DISP=(,CATLG,DELETE),LRECL=12280,RECFM=VB,EXPDT=&EXP05WD,
// DSN=sortoffile_3
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,
INCLUDE=(211,12,CH,EQ,X'004400320050005A005A0031'),
OUTREC=(1,90,491)
OUTFIL FILES=02,
INCLUDE=(211,12,CH,EQ,X'004400320050005A005A0032'),
OUTREC=(1,90,491)
OUTFIL FILES=03,
INCLUDE=(211,12,CH,EQ,X'004400320050005A005A0033'),
OUTREC=(1,90,491)
//*
//S0035 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PRINT INDATASET ('sortoffile_1') COUNT(1)
IF LASTCC=4 -
THEN DELETE sortoffile_1 PURGE
PRINT INDATASET ('sortoffile_2') COUNT(1)
IF LASTCC=4 -
THEN DELETE sortoffile_2 PURGE
PRINT INDATASET ('sortoffile_3') COUNT(1)
IF LASTCC=4 -
THEN DELETE sortoffile_3 PURGE
SET MAXCC=0
//*

Any suggestions?
Many thanks in advance!
Johan Vermeulen
 
Posts: 2
Joined: Thu Oct 04, 2012 3:26 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Question: Sortof-statement and file allocations

Postby BillyBoyo » Thu Oct 04, 2012 7:03 pm

In general, I think the answer is "no".

Why do you need to delete the files?

I suspect there is a better way than 140 PRINT/IF/DELETE statements in IDCAMS if you can describe what you are trying to achieve by deleting the files.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Question: Sortof-statement and file allocations

Postby Johan Vermeulen » Thu Oct 04, 2012 7:34 pm

These jobs run every hour. In a later process, but same run, these 140 files are being ZIPPED and sent via C:D to servers.
Because we prefer to clean up the datasets that are not used, I tried to delete these datasets in the same JCL.

The IDCAMS statement was the only solution I found. I haven't found a parameter for the SORTOF-statement
that didn't allocate the datasets that are not used... :(

I know 140 PRINT/IF/DELETE statements in IDCAMS is not ideal, but at the moment this is the only alternative.
Ohterwise I wouldn't be posting my question on this forum ;)
Johan Vermeulen
 
Posts: 2
Joined: Thu Oct 04, 2012 3:26 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Question: Sortof-statement and file allocations

Postby dick scherrer » Thu Oct 04, 2012 8:48 pm

Hello and welcome to the forum,

I know 140 PRINT/IF/DELETE statements in IDCAMS is not ideal, but at the moment this is the only alternative.
No, this is Not the only alternative - if i understand the issue.

If you only create the files with data, there would be nothing to delete due to the file being empty. . .

Yes, it would take a bit more work, but would reduce the overhead of creating all of these files only to deleete them.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Question: Sortof-statement and file allocations

Postby NicC » Thu Oct 04, 2012 9:08 pm

If you only create the files with data
which is what TS is trying to determine - if there is a way of sort doing this. However, you still have to specify all 140 datasets in the JCL so they have to exist. There is no JCL parameter that says 'delete if not written to' - unfortunately.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Question: Sortof-statement and file allocations

Postby dick scherrer » Thu Oct 04, 2012 9:37 pm

Hello,

But there are ways to generate only the DD statements and SortControl for the files that will be used. . .

As i mentioned, it would be a bit more work, but it is quite do-able. It is just not an automagic "do it with sort" thingy.

FWIW - several places i've worked with had this kind of requirement but with far more files to be inbound/outbound. One such received "stuff" multiple times a day from about 450 manufacturing, distribution, and sales sites and each night new data was sent to these remote sites - when there was data to send.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Question: Sortof-statement and file allocations

Postby BillyBoyo » Sat Oct 06, 2012 5:25 am

Perhaps deleting with ADRDSSU would be quicker.

If you arrange a single-record file with the total output count on, you'd know how many files were used.

Possible to then parse the JCL, extracting the last "n" which you'd know are not used, and create the delete statement for all of those at once.

Or, going with Dick, count the records first, then generate only the JCL and Sort cards needed.

You'd have to mock-up the possibilities and see which gives you the most manageable way of getting the result you want.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post