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

COUNT operator of ICETOOL


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

New User


Joined: 28 Aug 2006
Posts: 27
Location: NY, US

PostPosted: Tue Oct 17, 2006 11:07 pm
Reply with quote

Hi,

I have a sequential file with header and trailer records. I have to put the header and trailer records in a different file for processing.

I was thinking of using COUNT operator to do it (getting the count and pulling record1 and record(count-1) ). But I do not know how exactly to do this.

Appreciate if someone could provide some information on this or anyother better way to do this.


Thanks in advance,
Daphne
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Oct 18, 2006 12:53 am
Reply with quote

Daphne,

I need some more information before I can show you how to do what you want to do.

Is there anything that identifies the header (e.g. 'HDR' in positions 1-3) or trailer (e.g. 'TRL' in positions 1-3) or are they just identified by being the first and last record in the file, respectively?

What is the RECFM and LRECL of the input file?

Please show an example of your input records and what exactly you want for output (one output file with just the header and trailer? another output file without the header and trailer? or what?).
Back to top
View user's profile Send private message
Daphne

New User


Joined: 28 Aug 2006
Posts: 27
Location: NY, US

PostPosted: Wed Oct 18, 2006 2:32 am
Reply with quote

Hi Frank,

Thanks for the reply. Kindly find below the details.

1) Yes. The header and trailer will be identified only by them being the first and last record in the file respectively.

2) RECFM = FB , LRECL = 150

3) I need one file with just the header and trailer records and another file with the detail records alone.

4) Kindly find below the file layout(only header and trailer records).

File Header Record

Service Code 001 ? 003
Type of File 004 ? 004
Filler 005 ? 016
Year 017 ? 020
Pay Type 021 ? 022
Date File Created 023 ? 030
Time File Created 031 ? 036
Filler 037 ? 147
File Source Code 148 ? 150


File Trailer Record

Service Code 001 ? 003
Type of File 004 ? 004
Filler 005 ? 016
Year 017 ? 020
Pay Type 021 ? 022
Number of
Detail records 023 ? 033
Filler 034 ? 150

Thank you,
Daphne
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Oct 18, 2006 3:15 am
Reply with quote

Daphne,

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/150)
//SYM DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
* Add seqnums in 151-158
  INREC OVERLAY=(151:SEQNUM,8,ZD)
* Sym:  Create a DFSORT symbol as:
* Lastrec,+n
* where n is the seqnum of the last record.
  OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,
    BUILD=(80X),
    TRAILER1=('Lastrec,+',151,8,80:X)
* T1:  Copy input records with seqnums in 151-158.
  OUTFIL FNAMES=T1
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=&&T1,DISP=(OLD,PASS)
//HT DD DSN=...  header/trailer output (FB/150)
//DT DD DSN=...  detail output (FB/150)
//SYSIN    DD    *
  OPTION COPY
* HT: Use seqnums in 151-158 to get header record (seqnum=1)
* and trailer record (seqnum=Lastrec).  Remove seqnum.
  OUTFIL FNAMES=HT,
    INCLUDE=(151,8,ZD,EQ,+1,OR,151,8,ZD,EQ,Lastrec),
    BUILD=(1,150)
* DT: Get detail records.  Remove seqnum.
  OUTFIL FNAMES=DT,SAVE,BUILD=(1,150)
/*
Back to top
View user's profile Send private message
Daphne

New User


Joined: 28 Aug 2006
Posts: 27
Location: NY, US

PostPosted: Fri Oct 20, 2006 12:16 am
Reply with quote

Hi Frank,

Thanks a lot. I executed the JCL and then found out our shop is using SYNCSORT.

Anyway I have learned a lot. In the course of doing this I read your publications on DFSORT, ICETOOL and SYMBOLS. They are wonderful documents.

Thanks,
Daphne
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Oct 20, 2006 1:17 am
Reply with quote

Daphne,

If you or anyone else on this board would like some documents prepared by the DFSORT Team that describe what we see as the advantages of DFSORT over Syncsort, as well as considersations for migrating from Syncsort to DFSORT, send me an e-mail offline (yaeger@us.ibm.com). Please put "DFSORT" somewere in your Subject line to catch my attention.
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