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

Sort a file with record length 4500


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

New User


Joined: 14 Sep 2005
Posts: 74
Location: Atlanta, (USA)

PostPosted: Wed Mar 26, 2008 11:47 pm
Reply with quote

Hi,
I am trying to eliminate duplicate records from a file of Lrecl = 4500.
I am trying to use the following
Code:
SORT FIELDS=(1,4500,CH,A)
SUM FIELDS=NONE


Its giving me the following error
Code:
            SORT FIELDS=(1,4500,CH,A)                     
                                   $                     
ICE017A C CONTROL FIELD DISPLACEMENT OR LENGTH VALUE ERROR
            SUM FIELDS=NONE                               


I see it might be that the length specified is not acceptable. Is there anyway in which I can perform the sort on the whole file and eliminate the duplicate records.

Thanks,
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Mar 27, 2008 3:43 am
Reply with quote

Muffirulz,

The following DFSORT/ICETOOL jcl will give you the desired results.

Code:

//STEP0100 EXEC PGM=ICETOOL 
//TOOLMSG  DD SYSOUT=*       
//DFSMSG   DD SYSOUT=*       
//IN       DD DSN=Your 4500 lrecl dataset,
//            DISP=SHR
//T1       DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)     
//T2       DD DSN=&&T2,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)     
//KEEP     DD DSN=YOUR FINAL OUTPUT WITHOUT DUPS,
//            DISP=(MOD,CATLG,DELETE)
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)   
//TOOLIN   DD *
  SELECT FROM(IN) TO(T1) ALLDUPS DISCARD(KEEP) USING(CTL1)-
      ON(01,1500,CH) ON(1501,1500,CH) ON(3001,1000,CH)

  SPLICE FROM(T1) TO(T2) USING(CTL2) WITH(1,4500) WITHALL -
      ON(01,1500,CH) ON(1501,1500,CH) ON(3001,1000,CH)

  SELECT FROM(T2) TO(KEEP) FIRST USING(CTL3) -
      ON(4501,08,CH) ON(4001,500,CH)

//CTL1CNTL DD *
  INREC OVERLAY=(4501:8X)
  OUTFIL FNAMES=T1,REMOVECC,
  OVERLAY=(4501:SEQNUM,8,ZD),
  SECTIONS=(0001,256,SKIP=0L,
            0257,256,SKIP=0L,
            0513,256,SKIP=0L,
            0769,256,SKIP=0L,
            1025,256,SKIP=0L,
            1281,256,SKIP=0L,
            1537,256,SKIP=0L,
            1793,256,SKIP=0L,
            2049,256,SKIP=0L,
            2305,256,SKIP=0L,
            2561,256,SKIP=0L,
            2817,256,SKIP=0L,
            3073,256,SKIP=0L,
            3329,256,SKIP=0L,
            3585,256,SKIP=0L,
            3841,160,SKIP=0L,
  TRAILER3=(0001,256,
            0257,256,
            0513,256,
            0769,256,
            1025,256,
            1281,256,
            1537,256,
            1793,256,
            2049,256,
            2305,256,
            2561,256,
            2817,256,
            3073,256,
            3329,256,
            3585,256,
            3841,160,
            4501:4501,8))

  OUTFIL FNAMES=KEEP,OUTREC=(01,4500)
/*
//CTL2CNTL DD *
  SORT FIELDS=(0001,4000,CH,A,
               4501,0008,CH,D)
  INREC IFTHEN=(WHEN=(4501,8,CH,EQ,C' '),
       OVERLAY=(4501:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,
       OVERLAY=(4501:8X))
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=KEEP,OUTREC=(01,4500)
/*


Hope this helps...

Cheers
Back to top
View user's profile Send private message
achittu

New User


Joined: 26 Feb 2007
Posts: 14
Location: chennai

PostPosted: Sun Mar 30, 2008 12:23 pm
Reply with quote

Try the following :

Code:

//STEP01   EXEC PGM=ICETOOL 
//TOOLMSG  DD SYSOUT=*       
//DFSMSG   DD SYSOUT=*       
//IN       DD DSN=Your 4500 lrecl dataset,DISP=SHR
//OUT      DD DSN=Your Output Dataset Name
//TOOLIN   DD *
  SELECT FROM(IN) TO(OUT) NODUPS ON(01,1500,CH) -
   ON(1501,1500,CH) ON(3001,1500,CH)
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Mar 31, 2008 1:06 am
Reply with quote

Quote:
Try the following:

...


achittu,

If you had followed your own advice and tried that, you would have found out that it doesn't work. 4500 bytes is larger than the limit allowed for that kind of thing.
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 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top