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

Sort, remove duplicates and merge three fields into one


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Sat Oct 13, 2007 1:24 am
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
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

Moderator Emeritus


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

PostPosted: Tue Oct 16, 2007 12:51 am
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 Developer


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

PostPosted: Tue Oct 16, 2007 12:53 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top