Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sort, remove duplicates and merge three fields into one

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sudhirk63

New User


Joined: 08 Oct 2006
Posts: 19
Location: Bangalore

PostPosted: Sat Oct 13, 2007 12:12 am    Post subject: Sort, remove duplicates and merge three fields into one
Reply with quote

Hello ,

I am not able to get my head around to solve my problem . Would appreciate if some one helps me out.

I have three fields having names in my input file. The first two first being 15 characters long and third field being 30 characters long. Their starting positions being 172,187 and 272.

The input file layout could as as :

00000000SUDHIR0000RAMESH00000000TOM 00
00000000HARRY 0000CHRIS 00000000SUDHIR00
00000000CHRIS 0000TOM 00000000NICK 00

I would like the output to be one file of record length 30 having distinct names from the three fields.
The output desired is like :

SUDHIR
RAMESH
TOM
HARRY
CHRIS
NICK

The order of the output is not important, as if sort is used then the output record would be sorted.

The second problem I see is that one of the field is greater in length, hence the comparison would have to either neglect spaces or add spaces to the smaller fields.

Sudhir
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


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

PostPosted: Sat Oct 13, 2007 1:24 am    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=...  input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file
//TOOLIN   DD    *
COPY FROM(IN) USING(CTL1)
SELECT FROM(T1) TO(OUT) ON(1,30,CH) FIRST
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,BUILD=(172,15,/,187,15,/,272,30)
/*
Back to top
View user's profile Send private message
sudhirk63

New User


Joined: 08 Oct 2006
Posts: 19
Location: Bangalore

PostPosted: Tue Oct 16, 2007 12:14 am    Post subject:
Reply with quote

Hello Frank,

Tried the above JCL, the message I get in the DFSMSG is:

Code:

ICE200I 0 IDENTIFIER FROM CALLING PROGRAM IS 0001
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED 
ICE000I 0 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 00:03 ON TUE OCT
            OUTFIL FNAMES=T1,BUILD=(2,10,/,18,5,/,32,20)                       
                             $                                                 
ICE213A 0 INVALID OUTFIL STATEMENT OPERAND                                     
ICE146I 0 END OF STATEMENTS FROM CTL1CNTL - PARAMETER LIST STATEMENTS FOLLOW   
DEBUG NOABEND,ESTAE                                                     
OPTION LIST,MSGPRT=ALL,MSGDDN=DFSMSG,RESINV=0,SORTDD=CTL1,SORTIN=IN,COP*
               Y                                                       
END OF DFSORT         


The message in TOOLMSG is :

Code:

ICE600I 0 DFSORT ICETOOL UTILITY RUN STARTED                                   
                                                                               
ICE632I 0 SOURCE FOR ICETOOL STATEMENTS:  TOOLIN                               
                                                                               
                                                                               
ICE630I 0 MODE IN EFFECT:  STOP                                                 
                                                                               
          COPY FROM(IN) USING(CTL1)                                             
ICE606I 0 DFSORT CALL 0001 FOR COPY FROM IN       TO OUTFIL   USING CTL1CNTL TERMINATED
ICE602I 0 OPERATION RETURN CODE:  16                                           
                                                                               
ICE630I 2 MODE IN EFFECT:  SCAN                                                 
                                                                               
          SELECT FROM(T1) TO(OUT) ON(1,20,CH) FIRST                             
ICE612I 0 NO ERRORS FOUND IN STATEMENT                       
                                                             
                                                             
ICE601I 0 DFSORT ICETOOL UTILITY RUN ENDED - RETURN CODE:  16           


I am using version 14 of DFSORT, so it should have recognised the BUILD statement.

Could you let me what am I doing wrong.

Thanks.

Sudhir
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Oct 16, 2007 12:51 am    Post subject:
Reply with quote

Hello,

It may help if you post the jcl and sort control statements you submitted.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Oct 16, 2007 12:53 am    Post subject:
Reply with quote

Quote:
I am using version 14 of DFSORT, so it should have recognised the BUILD statement.


The fact that it didn't recognized BUILD tells me that your site is way, way behind on DFSORT service. BUILD has been available with DFSORT since Dec, 2004 with DFSORT R14 PTF UQ95213. Your site obviously doesn't have that PTF installed even though it's been available for several years. Ask your System Programmer to install DFSORT R14 PTF UK90006 (April, 2006). That will get you all of the latest DFSORT/ICETOOL functions.

In the meantime you can use the older OUTFIL OUTREC=(...) parameter instead of the newer BUILD=(...) parameter.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us