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

ICETOOL trailer count update


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Dharmesh Amal

New User


Joined: 08 Oct 2013
Posts: 6
Location: Canada

PostPosted: Tue Oct 08, 2013 6:25 pm
Reply with quote

Hi I am using ICETOOL to sort a few workfiles and I need to update the counts in the trailer record for both the files... Can I update the count in the in the same step -if so how?

The trailer record is.. where 9022 is the current count and I need to replace this with the new count

***FileFooter|9022|09:28:44 07/10/2013

//STEP23 EXEC PGM=ICETOOL,COND=(0,LT)
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN2 DD DSN=FILE2,DISP=(SHR)
//IN3 DD DSN=FILE3,DISP=(SHR)
//OUT2 DD DISP=(,CATLG,CATLG),DSN=FILE22,
// UNIT=CMNPAK,SPACE=(TRK,(225,75),RLSE),
// DCB=(LRECL=200,BLKSIZE=27800,RECFM=FB)
//OUT3 DD DISP=(,CATLG,CATLG),DSN=FILE33,
// UNIT=(CMNPAK,5),SPACE=(TRK,(225,750),RLSE),
// DCB=(LRECL=200,BLKSIZE=27800,RECFM=FB)
//TOOLIN DD *
DATASORT FROM(IN2) TO(OUT2) HEADER TRAILER USING(CTL2)
DATASORT FROM(IN3) TO(OUT3) HEADER TRAILER USING(CTL2)
/*
//CTL2CNTL DD *
SORT FIELDS=(1,44,CH,A)
SUM FIELDS=NONE
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: Tue Oct 08, 2013 7:06 pm
Reply with quote

Your trailer seems to imply a "delimited" file. Is it? Or are all the data in fixed positions with fixed lengths?

If you have a delimited file, be fully aware that the order you get on output is dictated by the entire sort key, not just by the complete fields that you may be hoping for.

DATASORT is a very good choice when you don't want to disturb a header/trailer/both which does not have a natural sort key.

For INREC, INCLUDE/OMIT, SORT, SUM, only the records not identified as HEADER or TRAILER (in their variousness) will be processed.

For OUTFIL, however, all records will be processed.

Which means you can use OUTFIL IFTRAIL, if you are up-to-date in your DFSORT.

You don't need to specify any DCB information on your output datasets. DFSORT will provide accurate LRECL and optimal BLKSIZE for you automatically.

So, is all your data fixed? What level of DFSORT are you at? Paste the sysout from your step so that we can see, please.
Back to top
View user's profile Send private message
Dharmesh Amal

New User


Joined: 08 Oct 2013
Posts: 6
Location: Canada

PostPosted: Tue Oct 08, 2013 7:55 pm
Reply with quote

Thanks Bill
The data is fixed format and the header/trailer is written at start/end of program. The sort key is A44 - the first two fields.
The header is different for the two files - text column tiitles.
The Trailer is (text|count|time date).

xxxx-2013-ZOO1530H-F-LEC0101 |**missin|F |NOT| |
yyyyy-2014-ZOO1535H-S-LEC0101 |**missin|S |NOT| |
***FileFooter|9022|09:28:44 07/10/2013

Guess I need to use OUTFIL IFTRAIL.. how do I replace the DATASORT?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Oct 08, 2013 7:58 pm
Reply with quote

Bill Woodger wrote:
What level of DFSORT are you at? Paste the sysout from your step so that we can see, please.
Back to top
View user's profile Send private message
Dharmesh Amal

New User


Joined: 08 Oct 2013
Posts: 6
Location: Canada

PostPosted: Tue Oct 08, 2013 8:15 pm
Reply with quote

ICE600I 0 DFSORT ICETOOL UTILITY RUN STARTED

ICE650I 0 VISIT www.ibm.com/storage/dfsort FOR ICETOOL PAPERS, EXAMP

ICE632I 0 SOURCE FOR ICETOOL STATEMENTS: TOOLIN


ICE630I 0 MODE IN EFFECT: STOP

DATASORT FROM(IN2) TO(OUT2) HEADER TRAILER USING(CTL2)
ICE606I 0 DFSORT CALL 0001 FOR SORT FROM IN2 TO OUT2 USING CTL2CN
ICE602I 0 OPERATION RETURN CODE: 00

DATASORT FROM(IN3) TO(OUT3) HEADER TRAILER USING(CTL2)
ICE606I 0 DFSORT CALL 0002 FOR SORT FROM IN3 TO OUT3 USING CTL2CN
ICE602I 0 OPERATION RETURN CODE: 00


ICE601I 0 DFSORT ICETOOL UTILITY RUN ENDED - RETURN CODE: 00

1ICE200I 0 IDENTIFIER FROM CALLING PROGRAM IS 0001
ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K59562 C6-BASE C7-K58148 C8-K58148 E9-K58148 C9-BASE E5-K5
ICE143I 0 BLOCKSET SORT TECHNIQUE SELECTED
ICE250I 0 VISIT www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPL
ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 10:10 ON T
0 SORT FIELDS=(1,44,CH,A)
SUM FIELDS=NONE
ICE146I 0 END OF STATEMENTS FROM CTL2CNTL - PARAMETER LIST STATEMENTS FOLLO
DEBUG NOABEND,ESTAE
OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL2,SORTIN=
RTOUT=OUT2,DYNALLOC,EQUALS,NOCHECK
MODS E15=(ICE15DU,12288),E35=(ICE35DU,12288)
SORT FIELDS=COPY
ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K59562 C6-BASE C7-K58148 C8-K58148 E9-K58148 C9-BASE E5-K5
ICE193I 0 ICEAM2 INVOCATION ENVIRONMENT IN EFFECT - ICEAM2 ENVIRONMENT SELE
ICE088I 1 STEP23 . , INPUT LRECL = 200, BLKSIZE = 27800, T
ICE093I 0 MAIN STORAGE = (MAX,6291456,6291456)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (5259264,5242880)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZE
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=Y,LIST=
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,C
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=N,WRKREL=Y,OUTREL=Y,
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=16384,CINV=Y
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE236I 0 OPTIONS: DYNAPCT=10 ,MOWRK=Y
ICE084I 0 EXCP ACCESS METHOD USED FOR OUT2
ICE084I 0 EXCP ACCESS METHOD USED FOR IN2
ICE750I 0 DC 1807000 TC 0 CS DSVUU KSZ 48 VSZ 48
ICE752I 0 FSZ=9035 RC IGN=0 E AVG=204 0 WSP=2394 C DYN=2 53216
ICE751I 1 DE-K58148 D5-K58148 D3-K58148 D7-K58148 E8-K58148
ICE090I 0 OUTPUT LRECL = 200, BLKSIZE = 27800, TYPE = FB
ICE055I 0 INSERT 2, DELETE 16
ICE054I 0 RECORDS - IN: 9024, OUT: 9010
ICE134I 0 NUMBER OF BYTES SORTED: 1804400
ICE253I 0 RECORDS SORTED - PROCESSED: 9022, EXPECTED: 9035
ICE165I 0 TOTAL WORK DATA SET TRACKS ALLOCATED: 15 , TRACKS USED: 0
ICE199I 0 MEMORY OBJECT USED AS MAIN STORAGE = 0M BYTES
ICE299I 0 MEMORY OBJECT USED AS WORK STORAGE = 2M BYTES
ICE180I 0 HIPERSPACE STORAGE USED = 0K BYTES
ICE188I 0 DATA SPACE STORAGE USED = 0K BYTES
ICE052I 0 END OF DFSORT
ICE200I 0 IDENTIFIER FROM CALLING PROGRAM IS 0002
ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K59562 C6-BASE C7-K58148 C8-K58148 E9-K58148 C9-BASE E5-K5
ICE143I 0 BLOCKSET SORT TECHNIQUE SELECTED
ICE250I 0 VISIT www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPL
ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 10:10 ON T
SORT FIELDS=(1,44,CH,A)
SUM FIELDS=NONE
ICE146I 0 END OF STATEMENTS FROM CTL2CNTL - PARAMETER LIST STATEMENTS FOLLO
DEBUG NOABEND,ESTAE
OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL2,SORTIN=
RTOUT=OUT3,DYNALLOC,EQUALS,NOCHECK
MODS E15=(ICE15DU,12288),E35=(ICE35DU,12288)
SORT FIELDS=COPY
ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K59562 C6-BASE C7-K58148 C8-K58148 E9-K58148 C9-BASE E5-K5
ICE193I 0 ICEAM2 INVOCATION ENVIRONMENT IN EFFECT - ICEAM2 ENVIRONMENT SELE
ICE088I 1 STEP23 . , INPUT LRECL = 200, BLKSIZE = 27800, T
ICE093I 0 MAIN STORAGE = (MAX,6291456,6291456)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (5259264,5242880)
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: Tue Oct 08, 2013 11:04 pm
Reply with quote

Yes, DATASORT is good. IFTRAIL would work in the USING for a DATASORT. Unfortunately ICE201I G says that you don't have IFTRAIL. You need H for IFTRAIL.

Can you show good samples of your two trailer records, please?

Other than the count, do they contain any data which is not fixed/literal?
Back to top
View user's profile Send private message
Dharmesh Amal

New User


Joined: 08 Oct 2013
Posts: 6
Location: Canada

PostPosted: Wed Oct 09, 2013 1:05 am
Reply with quote

The trailer is exactly as you see it, if you are familiar with Adabas/Natural it is done by the COMPRESS statement - COMPRESS '***Filefooter|' #COUNT(I4) '|' and time & date leaving no space. This can be rewritten if it makes it easy.

Code:
=cols>,----+----1----+----2----+----3----+----4----+-
000287,***FileFooter|285|09:28:44 07/10/2013
******,**************************** bottom of data **


Code:
=cols>,----+----1----+----2----+----3----+----4----+-
009024,***FileFooter|9022|09:28:44 07/10/2013
******,**************************** bottom of data **


Code'd
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: Wed Oct 09, 2013 1:36 am
Reply with quote

Code:
  OUTFIL IFOUTLEN=200,
         IFTHEN=(WHEN=INIT,OVERLAY=(201:SEQNUM,4,ZD)),
         IFTHEN=(WHEN=(1,13,CH,EQ,C'***FileFooter'),                   
                 OVERLAY=(15:201,4,ZD,SUB,+2,ZD,LENGTH=4))   


If you add something like that into your USING file, it'll be close.

However, your record-counts are not the same length on the trailer on the two files.

The easiest thing to do would be to replace the OVERLAY with

Code:
   BUILD=(1,14,201,4,ZD,SUB,+2,ZD,LENGTH=4,15,182))


This is untested.
Back to top
View user's profile Send private message
Dharmesh Amal

New User


Joined: 08 Oct 2013
Posts: 6
Location: Canada

PostPosted: Tue Oct 22, 2013 8:08 pm
Reply with quote

The above printed the totals twice. This works except for the preceding zeros, can we format this using edit mask M10 in the BUILD statement?

Code:
OUTFIL IFOUTLEN=200,
  IFTHEN=(WHEN=INIT,OVERLAY=(196:SEQNUM,4,ZD)),
  IFTHEN=(WHEN=(1,13,CH,EQ,C'***FileFooter'),
  BUILD=(1,14,196,4,ZD,SUB,+2,ZD,LENGTH=6,C'|',
           TIME1(:),X,DATE1(/)))


gives
Code:
***FileFooter|000285|10:34:58 2013/10/22


want
Code:
***FileFooter|285|10:34:58 2013/10/22
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: Wed Oct 23, 2013 2:39 am
Reply with quote

I'm not sure what you mean by printing the total twice. Your are only keeping four digits for the total, and if you look to the right of your rcord, you'll see the total there as well.

Yes you can use any edit mask you want.

If you are saying that for some reason you want 285 instead of the identival value 000285, then you will need more coding.

You could use FS or CSF and SQZ, but you have a blank later on that you want to keep, so you'd have to protect that with quotes/apostrophes and take those off later. Or HIT=NEXT on your IFTHEN and some more IFTHENs starting with C'00000' then C'0000' etc in the start position of the number, and shift everything from the first non-zero digit left by the number of zeros (5, 4, 3, etc).

Have a search for user SQZ, postings by skolusu, in DFSORT forum, using the Search at the top of the page. This will give you some examples of SQZ.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top