Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Group operations: When trailer record repeats multiple times

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Sun Jun 13, 2010 2:29 pm    Post subject: Group operations: When trailer record repeats multiple times
Reply with quote

Hi there,

I would like to know how to go about the group operations when a trailer record repeats multiple times. We do not exactly know the number of times trailer is repeated in each record. So, we can take the occurence of next header to the end of the previous record.

i have gone through

ftp://ftp.software.ibm.com/storage/dfsort/mvs/sortugpf.pdf

the following example is given there.


Code:

OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'HDR'),
END=(1,3,CH,EQ,C'TRL'),PUSH=(31:ID=1))
OUTFIL INCLUDE=(31,1,CH,NE,C' '),BUILD=(1,3)


for example my input looks like below
Code:

....5...10...15...20...25
header        0
body
body
trailer
header        1
body
body
trailer
trailer
header        1
body
body
trailer
trailer
trailer
header
body
trailer


input file is LRECL 120 FB. If pos 15 is '1' then write the entire record in the output LRECL 120 FB.

Expected output
Code:

....5...10...15...20...25
header        1
body
body
trailer
trailer
header        1
body
body
trailer
trailer
trailer


Your help is much appreciated
Back to top
View user's profile Send private message

THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Mon Jun 14, 2010 7:46 am    Post subject:
Reply with quote

Based on position 15 on header lines, if it is 1 then copy the entire record to the output. Even if that record(Header/body/trailers) has multiple tailers all the trailers of that record should be in the output dataset.

All the header/Body/trailers will have a single trailer atleast.

But, we must consider the header of the next record to be the end of the previous record.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jun 14, 2010 8:01 am    Post subject: Reply to: Group operations: When trailer record repeats mult
Reply with quote

Hi Srini,

Please review the topic and see if what is here is what you want. Looks like Bill and i were updating at the same time.

Why is the 1-char field indented as additional records are shown?

Note - i've added a "ruler" to the data and i'm not sure the data matches the descripton. Let me know if something needs to be changed,

d
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jun 14, 2010 10:12 am    Post subject: Reply to: Group operations: When trailer record repeats mult
Reply with quote

As requested - changes are made,

d
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Jun 14, 2010 9:15 pm    Post subject: Reply to: Group operations: When trailer record repeats mult
Reply with quote

THINKSRINIII,

Assuming your input is FB recfm and 80 byte LRECL, use the following DFSORT control cards which will give you the desired results.

Code:

//SYSIN    DD *                                                       
  SORT FIELDS=COPY                                                   
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,6,CH,EQ,C'HEADER'),PUSH=(81:15,1))
  OUTFIL BUILD=(1,80),INCLUDE=(81,1,ZD,EQ,1)                         
//*
Back to top
View user's profile Send private message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Tue Jun 15, 2010 2:17 pm    Post subject:
Reply with quote

Many thanks for your time Kolusu.. I am trying to incorporate this solution into the below post where we have used "BEGIN" and "END" to denote a record with ID and Sequence number

http://ibmmainframes.com/viewtopic.php?t=49220

I will let you the results.

Thanks
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Why TS/OP would Not contact site supp... RahulG31 All Other Mainframe Topics 2 Wed Mar 22, 2017 7:46 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us