MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Eliminate duplicate and write only first 17 chars

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
juan00982
Beginner


Joined: 29 Jun 2004
Posts: 36
Topics: 13
Location: PR

PostPosted: Tue Feb 14, 2006 2:05 pm    Post subject: Eliminate duplicate and write only first 17 chars Reply with quote

Hi

I have a 255 record lengh file, the first 17 chars are the key. I want to eliminate all dup records and write only a 80 record length file containing only the first 17 chars without the dups. Is this is possible?.

Thanks in advance for all the help you can provide.
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Feb 14, 2006 2:16 pm    Post subject: Reply with quote

Not sure how an 80 record length file can contain only the first 17 chars ... that would make it a 17 record length file. I'll assume you want the first 17 chars and blank padding up to position 80. I'll also assume that the RECFM is FB. If those assumptions are wrong, let us know the correct information.

Given those assumptions, you can use a DFSORT job like this:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/255)
//SORTOUT DD=...  output file (FB/80)
//SYSIN DD *
   SORT FIELDS=(1,17,CH,A)
   SUM FIELDS=NONE
   OUTREC FIELDS=(1,17,80:X)
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
juan00982
Beginner


Joined: 29 Jun 2004
Posts: 36
Topics: 13
Location: PR

PostPosted: Tue Feb 14, 2006 2:33 pm    Post subject: Reply with quote

Thanks for your quick resopnse.

Yes you are right, the RECFM is FB and on the output file I want the 17 chars and blanks on the rest 63 chars so that I can have my 80 RECFM file.

I don't know much about OS/390 and I'm getting an error.

Below is my JCL.
Code:

//SORT JOB (1001),                         
//        'TSO2',                         
//        CLASS=A,                         
//        MSGCLASS=X,                     
//        MSGLEVEL=(1,1),                 
//        REGION=0M,                       
//        TIME=1440,                       
//        NOTIFY=&SYSUID                   
//S1 EXEC PGM=ICEMAN                       
//SYSOUT   DD  SYSOUT=*                   
//SORTIN   DD  DSN=@ITS.SRV1.XFSFOUT       
//SORTOUT  DD  DSN=@ITS.TEMP.SORTED,       
//             DISP=(NEW,CATLG,DELETE),   
//             SPACE=(CYL,(100,50),RLSE)   
//SYSIN DD *                               
   SORT FIELDS=(1,17,CH,A)       
   SUM FIELDS=NONE               
   OUTREC FIELDS=(1,17,80:X)     
/*                               

I'm getting the following error.

ICH70001I TSO2     LAST ACCESS AT 15:24:59 ON TUESDAY, FEBRUARY 14, 2006   
IEF344I SORT S1 SORTIN - ALLOCATION FAILED DUE TO DATA FACILITY SYSTEM ERROR
IGD17045I SPACE NOT SPECIFIED FOR ALLOCATION OF DATA SET @ITS.SRV1.XFSFOUT 
IEF272I SORT S1 - STEP WAS NOT EXECUTED.                                   

Why is it asking for space on my input file?

Thanks.
Back to top
View user's profile Send private message Send e-mail
juan00982
Beginner


Joined: 29 Jun 2004
Posts: 36
Topics: 13
Location: PR

PostPosted: Tue Feb 14, 2006 2:39 pm    Post subject: Reply with quote

Sorry I forgot to add a couple of lines. This worked, thanks for your help.
Code:

//SORT JOB (1001),                                 
//        'TSO2',                                 
//        CLASS=A,                                 
//        MSGCLASS=X,                             
//        MSGLEVEL=(1,1),                         
//        REGION=0M,                               
//        TIME=1440,                               
//        NOTIFY=&SYSUID                           
//S1 EXEC PGM=ICEMAN                               
//SYSOUT   DD  SYSOUT=*                           
//SORTIN   DD  DSN=@ITS.SRV1.XFSFOUT,DISP=SHR     
//SORTOUT  DD  DSN=@ITS.TEMP.SORTED,               
//             DISP=(NEW,CATLG,DELETE),           
//             VOL=SER=VM1204,                     
//             SPACE=(CYL,(100,50),RLSE)           
//SYSIN DD *                                       
   SORT FIELDS=(1,17,CH,A)     
   SUM FIELDS=NONE             
   OUTREC FIELDS=(1,17,80:X)   
/*
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Feb 14, 2006 2:40 pm    Post subject: Reply with quote

Quote:

Why is it asking for space on my input file?

juan00982,

Because you don't have disp coded for your sortin. The default disposition is (new delete delete) and hence the system is asking for space parameters.

try this job

Code:

//SORT     JOB (1001),               
//             'TSO2',               
//             CLASS=A,               
//             MSGCLASS=X,           
//             MSGLEVEL=(1,1),       
//             REGION=0M,             
//             TIME=1440,             
//             NOTIFY=&SYSUID         
//*                                   
//S1      EXEC PGM=ICEMAN             
//SYSOUT  DD SYSOUT=*                 
//SORTIN  DD DSN=@ITS.SRV1.XFSFOUT,   
//           DISP=SHR                 
//SORTOUT DD DSN=@ITS.TEMP.SORTED,   
//           DISP=(NEW,CATLG,DELETE),
//           UNIT=SYSDA,             
//           SPACE=(CYL,(100,50),RLSE)
//SYSIN DD *                         
  SORT FIELDS=(1,17,CH,A)             
  SUM FIELDS=NONE                     
  OUTREC FIELDS=(1,17,80:X)           
/*                                   


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group