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

How to include all detail records b/w specific HDR and TRLR.


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

New User


Joined: 09 Sep 2005
Posts: 31
Location: Delhi

PostPosted: Wed Jul 11, 2007 12:17 pm
Reply with quote

I have the following file format:

B10625FD602000000000000000070920070

PT00011100625 1191003 ...................................
PT00021100625 1191003 ...................................
PT00031100625 1191010 ...................................

BT0625FD60200137139960941


Record starting B1 is the HDR.

Record starting BT is the TRLR.

My question is :

How can I include all the records under this HDR and TRLR in a seperate dataset.

I have a SORT condition where I can sort the records based on HDR and TRLRs, but how to include the records under them i.e. all the detail records under a particular HDR and TRLR.
Back to top
View user's profile Send private message
Nimesh.Srivastava

New User


Joined: 30 Nov 2006
Posts: 78
Location: SINGAPORE

PostPosted: Wed Jul 11, 2007 12:26 pm
Reply with quote

shitij,
for your first requirement you can use the following sort card to copy all the records between the header and trailor in a separate dataset
Code:
//SORTIN DD DSN= input dataset
//SORTOUT DD DSN= output dataset
//SYSIN    DD    *
  OPTION COPY
  OMIT COND=(1,2,CH,EQ,C'B1',|,
             (1,2,CH,EQ,C'BT'))

But I am not clear on your second requirement, can you please elaborate more on the same.

Hope this helps
Nimesh
Back to top
View user's profile Send private message
sandeep1dimri

New User


Joined: 30 Oct 2006
Posts: 76

PostPosted: Wed Jul 11, 2007 12:31 pm
Reply with quote

hi

how many header and detail combination u hve in input file

i mean to say that one combintaion is
Record starting B1 is the HDR.
Record starting BT is the TRLR.

do u have other combination too.

Plese let me know then we can provide various suggestions

Thanks
sandeep
Back to top
View user's profile Send private message
shitij

New User


Joined: 09 Sep 2005
Posts: 31
Location: Delhi

PostPosted: Wed Jul 11, 2007 2:36 pm
Reply with quote

Hi,


And thanks for your concern, I am highly obliged.

***********************************************************
I have same HDRs and TRLRs for the file:

B10625FD602000000000000000070920070

BT0625FD60200137139960941


But I can distinguish them from the 10th Character of the HDR and TRLR i.e.

If position 10 = 0104 or 0200 or 4333

Just would want all the records b/w a partcular HDR and TRLR to come out in a file - Based on 10th position of the HDR and TRLR.
Back to top
View user's profile Send private message
shitij

New User


Joined: 09 Sep 2005
Posts: 31
Location: Delhi

PostPosted: Wed Jul 11, 2007 3:01 pm
Reply with quote

Hi Namish,

I think your option will give me - only header and trailer records in a seperate file.

What I am looking for is the data between the Header and Trailer - that shud come along that.

And I think '|' is nothing but AND option itself, In that case the above condition is just fetching HDR and TRLR records only and not the data b/w them.
Back to top
View user's profile Send private message
sandeep1dimri

New User


Joined: 30 Oct 2006
Posts: 76

PostPosted: Wed Jul 11, 2007 3:16 pm
Reply with quote

plse chg Nimesh card to
Code:
//SORTIN DD DSN= input dataset
//SORTOUT DD DSN= output dataset
//SYSIN    DD    *
  OPTION COPY
  OMIT COND=(1,2,CH,EQ,C'B1',OR,
             (1,2,CH,EQ,C'BT'))

/*
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Jul 11, 2007 3:22 pm
Reply with quote

shitij

Quote:
And I think '|' is nothing but AND option itself

'|' is OR condition
and '&' is AND condition

Nimesh.Srivastava's solution is correct.
Check it once again!

If you want to check this way
Quote:
But I can distinguish them from the 10th Character of the HDR and TRLR i.e.

If position 10 = 0104 or 0200 or 4333

Then the OMIT condition would be
Code:
OMIT COND=(10,4,CH,EQ,C'0104',OR,
10,4,CH,EQ,C'0200',OR,
10,4,CH,EQ,C'4333')
Back to top
View user's profile Send private message
Nimesh.Srivastava

New User


Joined: 30 Nov 2006
Posts: 78
Location: SINGAPORE

PostPosted: Wed Jul 11, 2007 3:23 pm
Reply with quote

shitij,
its very confusing, in the first post you have written
Quote:
Record starting B1 is the HDR.

Record starting BT is the TRLR.

and last post
Quote:
But I can distinguish them from the 10th Character of the HDR and TRLR i.e.
If position 10 = 0104 or 0200 or 4333


if you want all the records between the header and trailor to go into a single dataset then you can use the sort card specified earlier.
or else what I make out,if your file can have multiple occurences of header and trailor based upon values from 10th position
go through this post from DFSORT, it might help you
ibmmainframes.com/viewtopic.php?t=22454&highlight=header

Hope this helps
Nimesh
Back to top
View user's profile Send private message
Nimesh.Srivastava

New User


Joined: 30 Nov 2006
Posts: 78
Location: SINGAPORE

PostPosted: Wed Jul 11, 2007 3:30 pm
Reply with quote

shitiz,
by the time I wrote you have replied
Quote:
I think your option will give me - only header and trailer records in a seperate file.
What I am looking for is the data between the Header and Trailer - that shud come along that.
And I think '|' is nothing but AND option itself, In that case the above condition is just fetching HDR and TRLR records only and not the data b/w them.


no the sort would give all records between the header & trailor its OMIT not INCLUDE condition.
| pipe is the symbol for OR not AND

Nimesh
Back to top
View user's profile Send private message
shitij

New User


Joined: 09 Sep 2005
Posts: 31
Location: Delhi

PostPosted: Wed Jul 11, 2007 4:57 pm
Reply with quote

I think I am not clear on this :-

I have the following file format:

B10625FD602000000000000000070920070

PT00011100625 1191003 ...................................
PT00021100625 1191003 ...................................
PT00031100625 1191010 ...................................

BT0625FD60200137139960941


Record starting B1 is the HDR.

Record starting BT is the TRLR.

My question is :

How can I include all the detail records i.e. all the PT records (those are the detail records) under this HDR and TRLR in a seperate dataset.

Ur conditions for OMIT - will get me all the B1 and BT fields, I am looking for a condition which can bring all the PT records i.e. DETAIL RECORDS on the basis of HDR and TRLR.


I hope I am clear now - else I will be glad to explain more.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Jul 11, 2007 5:21 pm
Reply with quote

shitij

Look at the topic Include or omit groups of records at [url]http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/ [/url]
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 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
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