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

How to Update trailer Count after omitting Detail records


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

New User


Joined: 20 Sep 2006
Posts: 63
Location: pune

PostPosted: Thu May 06, 2010 2:45 pm
Reply with quote

Hi,
I have one input file with Header, Detail, and Trailer record. There are more than one header and trailer records. I want to omit some Detail records from the file and want to update any one trailer record.

Input File -
RECFM = FB
LRECL = 1300

01 REC-TYPE PIX X(02).
88 HEADER-REC VALUE '10'.
88 DETAIL-REC VALUE '20'.
88 TRAILER-REC VALUE '90'.

Recorde to be Omited

OMIT COND=(612,02,BI,EQ,X'00')

I have used following SORT CARD but it's not working.

SORT FIELDS=COPY
OMIT COND=(612,02,BI,EQ,X'00')
OUTREC IFOUTLEN=1300,
IFTHEN=(WHEN=INIT,OVERLAY=(1301:SEQNUM,9,ZD,START=0)),
IFTHEN=(WHEN=(1,2,ZD,EQ,90),OVERLAY=(3:1301,9))

Thanks,
Sandip Walsinge.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu May 06, 2010 3:12 pm
Reply with quote

What do you mean by "it's not working"?
Please post all sysouts related to "it's not working".
What does the input look like?
What does the "it's not working" output look like?
What would the output look like if it was working?
Back to top
View user's profile Send private message
sandip_mainframe
Warnings : 2

New User


Joined: 20 Sep 2006
Posts: 63
Location: pune

PostPosted: Thu May 06, 2010 3:20 pm
Reply with quote

Hi CICS Guy,

Input File looks like this -

10 20100505022141
10 20100505030941
20082010050501554914SU 120100504YS0101N777777.............
20082010050501554914SC 03120100430NS0101N777777............
20082010050501554914SC 03120100430NS0101N777777...........
20082010050501554914SM 04120100504NS0101N777777.............
20082010050501554914SC 03120100504NS0101N777777.............
.
.
.
90000007377
90000147370


In output file it's updating all trailer records, but I want update just one Trailer record.
It should update any one Trailer record from below Trailer record
90000007377
90000147370
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu May 06, 2010 9:58 pm
Reply with quote

sandip_mainframe,

Assuming that you don't consider the header records as part of count and only consider the detail records, here is a job which would update the FIRST trailer record (90 in pos 1 thru 2)

Code:

//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN=Your input 1300 FB file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                   
  OMIT COND=(612,02,BI,EQ,X'00')                                     
  OUTREC IFOUTLEN=1300,                                             
  IFTHEN=(WHEN=(1,2,CH,NE,C'10'),OVERLAY=(1301:SEQNUM,9,ZD,START=0, 
                SEQNUM,8,ZD,RESTART=(1,2)),HIT=NEXT),               
  IFTHEN=(WHEN=(1,2,ZD,EQ,90,AND,1310,8,ZD,EQ,1),OVERLAY=(3:1301,9))
//*
Back to top
View user's profile Send private message
sandip_mainframe
Warnings : 2

New User


Joined: 20 Sep 2006
Posts: 63
Location: pune

PostPosted: Fri May 07, 2010 2:12 pm
Reply with quote

Hi Skolusu,
Thanks a lot for your help. The sort card provided by you is working.

Do you have any documentation for such a complex sort card, if you have any document or any link please post it, so that I can learn such a complex sort cards.


Thanks,
Sandip Walsinge
Pune.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri May 07, 2010 2:24 pm
Reply with quote

Quote:
Do you have any documentation for such a complex sort card, if you have any document or any link please post it, so that I can learn such a complex sort cards.

First thing... This is not complex sortcard...

Other thing, If you need such good examples you can have look at various posts and their answers by Kolusu\Frank. under DFSORT\ICETOOL part of the forum
That would give you fair idea of its usage.

If you are not aware of DFSORT\ICETOOL then you can start from Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri May 07, 2010 9:33 pm
Reply with quote

sandip_mainframe,

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top