View previous topic :: View next topic
|
Author |
Message |
shitij
New User
Joined: 09 Sep 2005 Posts: 31 Location: Delhi
|
|
|
|
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 |
|
|
Nimesh.Srivastava
New User
Joined: 30 Nov 2006 Posts: 78 Location: SINGAPORE
|
|
|
|
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 |
|
|
sandeep1dimri
New User
Joined: 30 Oct 2006 Posts: 76
|
|
|
|
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 |
|
|
shitij
New User
Joined: 09 Sep 2005 Posts: 31 Location: Delhi
|
|
|
|
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 |
|
|
shitij
New User
Joined: 09 Sep 2005 Posts: 31 Location: Delhi
|
|
|
|
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 |
|
|
sandeep1dimri
New User
Joined: 30 Oct 2006 Posts: 76
|
|
|
|
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 |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
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 |
|
|
Nimesh.Srivastava
New User
Joined: 30 Nov 2006 Posts: 78 Location: SINGAPORE
|
|
|
|
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 |
|
|
Nimesh.Srivastava
New User
Joined: 30 Nov 2006 Posts: 78 Location: SINGAPORE
|
|
|
|
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 |
|
|
shitij
New User
Joined: 09 Sep 2005 Posts: 31 Location: Delhi
|
|
|
|
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 |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
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 |
|
|
|