file sequence number



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

file sequence number

Postby asvdeb » Tue Aug 17, 2010 12:57 pm

Hi All,

I need to add the sequence number of the file in my trailer record.

The trailer rec need to be formated as

"TR"number of records in this file, the file sequence number

the file seq number needs to contain the number of the file, that means

file seq num=1 for the first file
=2 for the second file
=3 for the third file and so on

the job will run in daily basis, so this file seq num have to increase in such a way so that

today's file seq num=yesterday's file seq num + 1

Can anybody please answer me , weather it is possible or not? If yes th
asvdeb
 
Posts: 2
Joined: Fri Aug 13, 2010 12:28 pm
Has thanked: 0 time
Been thanked: 0 time

Re: file sequence number

 

Re: file sequence number

Postby NicC » Tue Aug 17, 2010 3:07 pm

I would get the file creation program to do that. But if that is not possible I am sure you could use SORT. In either case you will need a new file to hold the last sequence number which would have to be updated by the process. I am nowhere near being an expert on sort - I can just about use it for sorting and selecting or selecting and sorting records. Generally for a SORT solution I know you will have to provide LRECL, RECFM of the file and the exact layout of the trailer record that you want created.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: file sequence number

Postby skolusu » Tue Aug 17, 2010 9:38 pm

asvdeb,

Here is an idea. This will increase the seqnum everytime it ran.

Create a 80 byte FB recfm format. It will have just 1 lines to begin with. Populate the above defined file with this

let us say this filename is userid.filenum

FILENUM,C'00000001'


Now run this job. I also assumed your input is also FB 80 bytes

//STEP0100 EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                       
//SYMNAMES DD DSN=userid.filenum,           
//            DISP=SHR                       
//SORTIN   DD DSN=your input FB 80 byte file,           
//            DISP=SHR                       
//FILECNT  DD DSN=userid.filenum,           
//            DISP=SHR                       
//SORTOUT  DD SYSOUT=*   
//SYSIN    DD *                               
  SORT FIELDS=COPY                                           
  OUTREC OVERLAY=(81:FILENUM,81,8,ZD,ADD,+1,M11,LENGTH=8)     

  OUTFIL REMOVECC,BUILD=(1,80),                               
  TRAILER1=(C'TR;',COUNT=(M11,LENGTH=8),';',FILENUM)         
                                                             
  OUTFIL FNAMES=FILECNT,REMOVECC,NODETAIL,BUILD=(1,80),       
  TRAILER1=(C'FILENUM,C''',89,8,'''',80:X)                   
//*                                           


After every run you will see the filenum being incremented.
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: file sequence number

Postby asvdeb » Wed Aug 18, 2010 2:09 pm

Hi Skolusu,

Many thanks for your reply.

I ran the job with your suggested code. But the job did not run successfully.It is giving error message stating "ICE185A 0 AN S013 ABEND WAS ISSUED BY DFSORT, ANOTHER PROGRAM OR AN EXIT" .

I am searching for the error also, but could not get a solution for this.

Could you please tell me for what reason it is getting the error.

Thanks
asvdeb
asvdeb
 
Posts: 2
Joined: Fri Aug 13, 2010 12:28 pm
Has thanked: 0 time
Been thanked: 0 time

Re: file sequence number

Postby NicC » Wed Aug 18, 2010 5:32 pm

You had better post your JCL as an 013 is generally a member of a PDS not found but Kolusu's code did not include a PDS. If you do not have a PDS in your JCL then you had better show the full error messages and not just the ones in the DFSORT SYSOUT but from the JES messages too.
This is misleading and should be ignored. The 013 is a OPEN error, but most likely has nothing to do with a pds.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: file sequence number

Postby skolusu » Wed Aug 18, 2010 10:05 pm

asvdeb,

An S013 is probably because you changed the LRECL/RECFM of the Symnames dataset. A SYMNAMES DD statement data set MUST have the following attributes: RECFM=F or RECFM=FB and LRECL=80.

Show us the complete sysout of the job.
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post