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

Problem in writing to output.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Thu Dec 17, 2009 8:03 pm
Reply with quote

Hi all,

I have two input file,

File 1:

Code:


001 12345678
001 23456789
001 32145671



File 2:

Code:


001 12345678
001 23456712
001 23456712
001 12342344



Required Output :

Code:


001 23456712
001 23456712
001 12342344



i'm using this Icetool step,

Code:


//STEP001  EXEC  PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD *                                                       
001 12345678                                                           
001 23456789                                                           
001 32145671                                                           
/*                                                                     
//IN2      DD *                                                       
001 12345678                                                           
001 23456712                                                           
001 23456712                                                           
001 12342344                                                           
/*                                                                     
//T1       DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(MOD,PASS)   
//OUT      DD SYSOUT=*                                                 
//TOOLIN   DD *                                                       
COPY FROM(IN1) TO(T1) USING(CTL1)                                     
COPY FROM(IN2) TO(T1) USING(CTL2)                                     
SELECT FROM(T1) TO(OUT) ON(4,8,CH) NODUPS USING(CTL3)                 
/*                                                                     
//CTL1CNTL DD *                                                       
  INREC OVERLAY=(81:C'1')                                             
/*                                                                     
//CTL2CNTL DD *                                                       
  INREC OVERLAY=(81:C'2')                                             
/*                                                                     
//CTL3CNTL DD *                                                       
  OUTFIL FNAMES=OUT,INCLUDE=(81,1,CH,EQ,C'2'),                         
  BUILD=(1,80)                                                         
/*                                                                     




SUGGEST ME WHERE I'M GOING WRONG.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Dec 17, 2009 8:31 pm
Reply with quote

Please take some time and think about what we might need to help you.

What are the rules for the data being included into the required output file.
What are you actually getting in your output file.
Back to top
View user's profile Send private message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Thu Dec 17, 2009 8:42 pm
Reply with quote

HI all,

Sorry for not explaining the condition.

If the eight digit starting from Pos - 5 is present in file 2 but not in File 1. I need to write it to the output.

Even i have to write the duplicates if any ( Example 23456712 appears twice/thrice) in file 2 but not in file 1.I need to write it to the output.

Let me know if i'm confusing.
Back to top
View user's profile Send private message
lalitsharma_77

New User


Joined: 29 Nov 2007
Posts: 10
Location: Pune

PostPosted: Thu Dec 17, 2009 11:40 pm
Reply with quote

Hi Vineshwaran,

I am not sure whether JOINKEYS PTF is installed in your shop or not. If yes then the following DFSORT job will give you the required result.

Code:

//STEP010 EXEC PGM=SORT             
//SORTOUT  DD SYSOUT=*               
//SYSOUT   DD SYSOUT=*               
//SORTJNF1 DD *                     
001 12345678                         
001 23456789                         
001 32145671                         
/*                                   
//SORTJNF2 DD *                     
001 12345678                         
001 23456712                         
001 23456712                         
001 12342344                         
/*                                   
//SYSIN    DD *                     
  JOINKEYS FILE=F1,FIELDS=(5,8,A)   
  JOINKEYS FILE=F2,FIELDS=(5,8,A)   
  JOIN UNPAIRED,F2,ONLY             
  SORT FIELDS=(5,8,CH,D)             
/*     


Output::

Code:

001 23456712
001 23456712
001 12342344                   


Thanks
Lalit
Back to top
View user's profile Send private message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Mon Dec 21, 2009 12:14 pm
Reply with quote

Hi lalit,

Sorry,JOINKEYS PTF is not installed in my system.

I'm still struck up with this icon_sad.gif icon_sad.gif
Back to top
View user's profile Send private message
Lijo

New User


Joined: 24 Aug 2008
Posts: 41
Location: Cochin

PostPosted: Mon Dec 21, 2009 3:10 pm
Reply with quote

I am not sure if this can achieved using SELECT operator, but try this solution using SPLICE operator:
Code:
//STEP001  EXEC  PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN1      DD *
001 12345678
001 23456789
001 32145671
/*
//IN2      DD *
001 12345678
001 23456712
001 23456712
001 12342344
/*
//T1       DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(MOD,PASS)
//OUT      DD SYSOUT=*
//TOOLIN   DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(5,8,CH) WITH(82,1) -
 KEEPBASE KEEPNODUPS USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'11')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(81:C'22')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(81,2,CH,EQ,C'22'),
  BUILD=(1,80)
/*
Back to top
View user's profile Send private message
karisurya

New User


Joined: 02 Aug 2007
Posts: 64
Location: Bangalore

PostPosted: Mon Dec 21, 2009 3:25 pm
Reply with quote

Yes Ligo solution should work.

Vigneshwaran,
Just for info if you had referred manuals under Icetool you might have easily found out solution your self. The requirement is explained as example there under SLICE subtopic.

Regards,
Surya
Back to top
View user's profile Send private message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Mon Dec 21, 2009 3:29 pm
Reply with quote

Hi all,

Yes Lijo Solution is working.

Yes Surya i jus now looking into a ICETOOL manual and i could see it.
May be i was breaking my mind to find solution using SELECT operation( Single Direction Thinking)

Thanks all fr postiong.
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts Two input files & writing counter... DFSORT/ICETOOL 12
Search our Forums:

Back to Top