Page 1 of 2

Is it possible to use SEQNUM on TRAILER1?

PostPosted: Thu Nov 20, 2008 6:14 pm
by ranga_subham
Hi, Is it possible to use SEQNUM on TRAILER1 when NODETAIL & REMOVECC used?

I tried it with OUTREC OVERLAY, BUILD & FIELDSalso but wasn't getting in output.

Please suggest.

Thanks.

Re: Is it possible to use SEQNUM on TRAILER1?

PostPosted: Thu Nov 20, 2008 8:43 pm
by Alissa Margulies
Why are you trying to put a SEQNUM on a TRAILER1? If I could understand your requirement, maybe I could be more help.

Re: Is it possible to use SEQNUM on TRAILER1?

PostPosted: Mon Nov 24, 2008 4:33 pm
by ranga_subham
Alissa, I was on vacation so could not give reply... :roll:

//STEP0001 EXEC PGM=SORT                                   
//SORTOUT  DD SYSOUT=*                                     
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                             
ABCD0001                                                   
ABCE2001                                                   
ABCF3004                                                   
//SYSIN    DD *                                             
 SORT FIELDS=COPY                                           
 OUTFIL REMOVECC,NODETAIL,TRAILER1=(COUNT=(M11),SEQNUM,3,ZD)


I was trying to get the output with SEQNUM :!:

Thanks.

Re: Is it possible to use SEQNUM on TRAILER1?

PostPosted: Tue Nov 25, 2008 8:39 am
by Alissa Margulies
I still don't understand your requirement. Are you just trying to insert the number of records? If so, then COUNT is sufficient, you do not need SEQNUM. If this is not what you want, then please post an example of your expected output.

Re: Is it possible to use SEQNUM on TRAILER1?

PostPosted: Tue Nov 25, 2008 2:49 pm
by ranga_subham
Alissa, thanks for the reply.

I am trying to count no. of records from 10 files but want to have sequence number also alongside for each count. Let us say, the first has 10, 2nd has 20, 3rd has 30 records.

I want to see my output as given below:

00000000010 001
00000000020 002
00000000030 002


Please let me know if it is possible.

Thanks.

Re: Is it possible to use SEQNUM on TRAILER1?

PostPosted: Tue Nov 25, 2008 8:54 pm
by Alissa Margulies
Your output does not match the sample input in your previous post. Is there something unique in the records of each input file that identifies it as to which file it comes from? For example, does every record from file1 have a '1' in a certain position, whereas file2 would have a value of '2' in that same position? If there is an identifying field, then we can use SECTIONS with a COUNT in TRAILER3.

Re: Is it possible to use SEQNUM on TRAILER1?

PostPosted: Tue Nov 25, 2008 9:58 pm
by ranga_subham
I have asked my seniors about this but they said like what you have asked for cannot be guranteed because the files are user created without any standards.

Thanks.

Re: Is it possible to use SEQNUM on TRAILER1?

PostPosted: Wed Nov 26, 2008 1:27 am
by Alissa Margulies
If you are concatenating all 10 files in this job and there are no unique file identifiers, then there is no way for the sort to know which file the record came from. Each input file would have to be pre-processed to include an identifier field.

Re: Is it possible to use SEQNUM on TRAILER1?

PostPosted: Wed Nov 26, 2008 3:58 pm
by ranga_subham
Ok Alissa. I thought it was achievable using SORT :shock: I don't know what will be an alternative to achieve it ! :o

I think, should go for multiple SORT steps :!: :!: Would anybody please suggest me an alternative in Ezytrieve or COBOL or something else :?: :?

Thanks.

Re: Is it possible to use SEQNUM on TRAILER1?

PostPosted: Wed Nov 26, 2008 10:36 pm
by dick scherrer
Hello,

Alissa told you how to do what you need :!:

If you had simply followed the suggestion, it would be running now :|