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

ICETOOL : Please trace the error.


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

New User


Joined: 07 Jul 2005
Posts: 51

PostPosted: Fri Jul 08, 2005 11:43 am
Reply with quote

I want a output like :

Code:
 1111 XAAX  AAAA
 2222 XBBX  BBBB
 4444 XDDX  DDDD


From the inputs in1 and in2 given below .
But i am getting output as in 'out'..
I have used the jcl given below..
please find the error in it.
------in1------------

Code:
 1111 AAAA
 2222 BBBB
 3333 CCCC
 4444 DDDD   
 

------in2------------

Code:
 2222 XBBX         
 1111 XAAX         
 4444 XDDX         
 5555 XEEX                       
 

------ out ------------

Code:
 1111 XAAX 
 2222 XBBX 
 4444 XDDX 


---------JCL------------

Code:
 //TMP1   DD DSN=U117584.TRAIN.OUT1,DISP=MOD                 
 //OUT    DD DSN=U117584.TRAIN.OUT3,DISP=SHR                 
 //TOOLIN DD *                                               
   COPY FROM(IN1) TO(TMP1) USING(CPY1)                       
   COPY FROM(IN2) TO(TMP1) USING(CPY2)                       
   SPLICE FROM(TMP1) TO(OUT) ON(1,4,CH) WITH(6,9)                                               
 /*                                                         
 //CPY1CNTL DD *                                             
    OUTREC FIELDS=(1:1,4,11:6,9)                             
 /*                                                         
 //CPY2CNTL DD *                                             
    OUTREC FIELDS=(1:1,4,6:6,9)                               
 /*                                                         
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Jul 08, 2005 6:12 pm
Reply with quote

Change the SPLICE statement to:

SPLICE FROM(TMP1) TO(OUT) ON(1,4,CH) WITH(6,4)

and you will get the results you require. You don't want to overlay the blanks from positions 11-14 over the values that are already in those positions.
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: Fri Jul 08, 2005 8:42 pm
Reply with quote

Superk is right. Actually, I'd suggest changing the job to the following to make it clear where the data comes from and where the spaces come from. I'd also use a temporary file for the TMP1 MOD data set instead of a permanent file so you don't have to empty out TMP1 each time you run the job.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1
//IN2 DD DSN=... input file2
//TMP1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file
//TOOLIN DD *
  COPY FROM(IN1) TO(TMP1) USING(CPY1)
  COPY FROM(IN2) TO(TMP1) USING(CPY2)
  SPLICE FROM(TMP1) TO(OUT) ON(1,4,CH) WITH(6,4)
/*
//CPY1CNTL DD *
   OUTREC FIELDS=(1:1,4,11:6,4,19:X)
/*
//CPY2CNTL DD *
   OUTREC FIELDS=(1:1,4,6:6,4,19:X)
/*
Back to top
View user's profile Send private message
Elixir

Active User


Joined: 08 Feb 2009
Posts: 116
Location: CHENNAI/NEW JERSEY - INDIA/USA

PostPosted: Thu Mar 31, 2011 9:41 pm
Reply with quote

Hi,

I am replying to an old thread becoz my requirement is similar to this,

IN01

1111 AAAA
2222 BBBB
3333 CCCC
4444 EEEE
4444 DDDD

IN02

2222 XBBX
1111 XAAX
4444 XDDX
5555 XEEX
4444 XDEX

Ouput required,

1111 XAAX AAAA
2222 XBBX BBBB
4444 XDDX DDDD
4444 XDEX EEEE

When I tried running using same TOOLIN parameters, I get only one record corresponding to 4444.

Kindly let me know if we can populated multiple entries corresponding to the Key field in the output file.

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 31, 2011 11:24 pm
Reply with quote

Elixir,

It would have been easier to diagnose the problem if you posted the entire TOOLMSG and DFSMSG output. Also I noticed that there is a many to many match in your data. Looks like both files have duplicates and in that case you can't use SPLICE. You need to use JOINKEYS. However you need to do a better job of explaining the rules (especially when there are duplicates involved). The key 4444 has 2 keys and in IN01 file and some how you managed to matched the second 4444 DDDD record with the first 4444 XDDX record and followed the same pattern for the other 2 records. What happens if there are more than 2 records per key?
Back to top
View user's profile Send private message
Elixir

Active User


Joined: 08 Feb 2009
Posts: 116
Location: CHENNAI/NEW JERSEY - INDIA/USA

PostPosted: Wed Apr 20, 2011 8:24 pm
Reply with quote

SKolusu,

IN01

1111 AAAA
2222 BBBB
3333 CCCC
4444 EEEE
4444 DDDD

IN02

2222 XBBX
1111 XAAX
4444 XDDX
5555 XEEX
4444 XDEX

Requied output:

1111 XAAX AAAA
2222 XBBX BBBB
4444 XDDX DDDD
4444 XDEX EEEE

Kindly let me know how to achieve this.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Apr 20, 2011 9:40 pm
Reply with quote

F1
Code:

1111 AAAA   
2222 BBBB   
3333 CCCC   
4444 EEEE   
4444 DDDD   


F2
Code:
2222 XBBX     
1111 XAAX     
4444 XDDX     
5555 XEEX     
4444 XDEX     


Your expected output:
Code:
1111 XAAX AAAA
2222 XBBX BBBB
4444 XDDX DDDD
4444 XDEX EEEE


First state your rule clearly
I don't understand what is the criteria that you don't want record
4444 XDDX EEEE but want 4444 XDEX EEEE
Also
4444 XDEX DDDD but want 4444 XDDX DDDD

Is it because in both third character is same??? icon_wink.gif
Sorry.. but today am thinking in all nonsense directions ... icon_rolleyes.gif icon_rolleyes.gif
4444 XDEX EEEE
4444 XDDX DDDD
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 Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
Search our Forums:

Back to Top