Merge TAPE files using SORT



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Merge TAPE files using SORT

Postby pecram24 » Tue Jan 29, 2013 3:21 pm

hi,

I am trying to merge two TAPE files of (Format VB ) into a new TAPE file ( Format VB ). All the files are having same record length of 32137.
The First File is having Detail Records and the Second file is having Trailer Records. I am able to create the output TAPE file.
But the Issue is, when i am trying to move the Trailer Record from 5000 to 32137 into a Variable in COBOL it fails in S0C4.
When i am displaying the content, for the Tape file it shows SPACES and \. If we run the COBOL program after converting the TAPE file into DASD the program is running fine and the display shows some junk values, the previous record values. ( But not the Last before record ).

\
Please help me in this.
pecram24
 
Posts: 5
Joined: Tue Jan 29, 2013 3:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Merge TAPE files using SORT

Postby BillyBoyo » Tue Jan 29, 2013 8:01 pm

So is this a Cobol question, or a Sort question?

Usually, the point of VB files is to have different record-lengths on them. Although you say they are all the same length, I'd guess that your trailer record is much shorter than your other records (if you are accurate about those all being the same length). If the trailer is short, I guess the header is also short, although you may notice it less because of not getting a S0C4.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Merge TAPE files using SORT

Postby pecram24 » Wed Jan 30, 2013 7:03 am

Hi,


As u said the Trailer record content is very short when we compare it with the Details records. Say if the Details records are having details from 1 - 30000, the trailer records are having the info from 1- 500. i Doubt that during the sort the contents are moved from detail records to the Trailer records from char 500 . Could you please confirm is there any chance for it ?

Thanks!
Ram
pecram24
 
Posts: 5
Joined: Tue Jan 29, 2013 3:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Merge TAPE files using SORT

Postby BillyBoyo » Wed Jan 30, 2013 12:23 pm

If you show your Sort cards, we can tell.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Merge TAPE files using SORT

Postby pecram24 » Wed Jan 30, 2013 12:42 pm

SORT FIELDS=(5,23,A,59,12,A,38,2,A,50,1,A),FORMAT=CH
pecram24
 
Posts: 5
Joined: Tue Jan 29, 2013 3:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Merge TAPE files using SORT

Postby BillyBoyo » Wed Jan 30, 2013 1:28 pm

No, your "sort cards" are all the "cards" which you have under //SYSIN DD *. That which you have shown is a "sort card" which is a SORT statement.

It would have been clearer, I hope, if I had said "your Sort Control Cards".
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Merge TAPE files using SORT

Postby pecram24 » Wed Jan 30, 2013 1:37 pm

yeah i got.. but there is only one sort card which i used to merge the files..
pecram24
 
Posts: 5
Joined: Tue Jan 29, 2013 3:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Merge TAPE files using SORT

Postby BillyBoyo » Wed Jan 30, 2013 3:44 pm

OK, so we can confirm "NO" to the question of whether SORT, in your particular case, is being told to anything other than sort the trailer record.

Which leaves you with your Cobol program, and when the trailer is being processed you have incorrect references to data "beyond" the end of the trailer record, which will sometimes "work" (pick up other data from one of the "input buffers") and sometimes abend with S0C4 because you are at that time looking "outside" (probably) the last "input buffer".
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Merge TAPE files using SORT

Postby pecram24 » Wed Jan 30, 2013 4:04 pm

Okay.. Thanks for your information.
pecram24
 
Posts: 5
Joined: Tue Jan 29, 2013 3:07 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post