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

About SPLICE funtion of ICETOOL


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

New User


Joined: 11 Dec 2008
Posts: 33
Location: China

PostPosted: Mon Jan 11, 2010 5:04 pm
Reply with quote

Dears,

I got into knots when testing my cobol program.I think something looks like complicated can be achieved by sort in below situation:

file one,account information file in vsam sorted by account number.I selected my desired record as below into temp1:

OPTION COPY,VLSCMP
INCLUDE COND=(147,1,CH,EQ,C'H',OR,
147,1,CH,EQ,C'K',OR,
147,1,CH,EQ,C'4',OR,
147,1,CH,EQ,C'D',OR,
147,1,CH,EQ,C'G',OR,
147,1,CH,EQ,C'N')


16100000 0DHBCA 01/04/1017130500
1610036600004000000850 1 000000000MV
1610036600004000005140 131565794 000366000004
1610036600004000006110 131700986 000366000004
1610036600004000008160 131794686 000366000004
1610036600004000009130 131783344 000366000004
1610036600004000010140 1E793627 000366000A10
1610036600004000012190 1G703054 000366000004
1610036600004000014130 1H382557E 000366000004
......
......
......
1610036600004000500150
1610036600004000501120
1610036600004000503170
1610036600004000505110
1610036600004000507160
1610036600004000508130
1610036600004000509100
1610036600004000510110
1610036600004000511190


file two,account transaction log file also sorted by account no,I selected my desired records to temp2:

OPTION COPY,VLSCMP
INCLUDE COND=(29,4,CH,EQ,C'U101',OR,
29,4,CH,EQ,C'GTG8',OR,
29,4,CH,EQ,C'GTG6')
161003660000000000000020ST22..............1................................
16100366000040000051401733 ..
16100366000040000051400335 ..... . ?
16100366000040000061101733 ..
16100366000040000081600335 ........?
16100366000040000101400335 .......q.
16100366000040000141301733 ..
16100366000040000141300335 ........n.
16100366000040000161801733 ..
16100366000040000171501733 ..
16100366000040000171500335 .......?<
16100366000040000181201733 ..
16100366000040000201001733 ..
161003660000400002118007RS05..0 .000.......
16100366000040000211801733 ..
16100366000040000211800335 ..........
16100366000040000221501733 ..
16100366000040000221500335 .......l .
16100366000040000231201733 ..
16100366000040000251701733 ..
16100366000040000261401733 ..
16100366000040000271101733 ..
16100366000040000301701733 ..
16100366000040000301700335 ........ @
16100366000040000321101733 ..
16100366000040000331901733 ..

file three,my desired output file:browse temp2 one by one using account number in temp1,if account number matches then write the record directly in temp2 to the output file.

Can we use SPLICE of ICETOOL to reach this goal?Hope someone will give the jcl example.
Back to top
View user's profile Send private message
lee_issc

New User


Joined: 11 Dec 2008
Posts: 33
Location: China

PostPosted: Mon Jan 11, 2010 6:41 pm
Reply with quote

some detail.

file1:
1-22:account number
other fields i don't need
file2:
1-22:account number
23-26:account trans type
output file:
1-22:account number
23-26:account trans type
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 Jan 12, 2010 10:47 pm
Reply with quote

You haven't really given a clear description/example. It's very difficult to help when you just show us what you tried that didn't work without explaining what exactly you're trying to do. Please start over and supply the following information:

Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Back to top
View user's profile Send private message
lee_issc

New User


Joined: 11 Dec 2008
Posts: 33
Location: China

PostPosted: Wed Jan 13, 2010 8:45 am
Reply with quote

Frank,

file1:VB 9004 (keyed by account number and the record are unique)

Account number(22 Chars from position 1)+other fields

A1+1111111

A2+2522222333

A4+3666666


file2:VB 2185(keyed by account number but may have same account number)

Account number(22 Chars from position 1)+other fields

A1+xxxxxxxxxxxxxxx
A1+xxxxxxxxxxxx
A1+xxxxxxxxxxxxxxx
A2+xxxxxxxxxxxxxx
A3+xxxxxxxxxxxxxxxxx
A3+xxxxxxxxxxxxxxx
A4+xxxxxxxxxxxxxxxxx
A4+xxxxxxxxxxxxxxxxxxxx
A4+xxxxxxxxxxxxxxxxxx
A4+xxxxxxxxxxxx
A5+xxxxxxxxxxxxxxx
A5+xxxxxxxxxxxxxxxxx
A5+xxxxxxxxxxxxxxx
A6+xxxxxxxxxxxxxxxxxxx

desired output:

A1+xxxxxxxxxxxxxxx
A1+xxxxxxxxxxxx
A1+xxxxxxxxxxxxxxx
A2+xxxxxxxxxxxxxx
A4+xxxxxxxxxxxxxxxxx
A4+xxxxxxxxxxxxxxxxxxxx
A4+xxxxxxxxxxxxxxxxxx
A4+xxxxxxxxxxxx

Hope it is clear.
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: Wed Jan 13, 2010 11:02 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for (you can add INCLUDE statements as needed but remember that the first data byte starts in position 5 after the RDW in positions 1-4):

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=... input file1 (VB/9004)
//IN2 DD DSN=... input file2 (VB/2185)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD LRECL=2185,DSN=...  output file (VB/2185)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(7,22,CH) VLENOVLY WITHALL -
  WITH(6,2182) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC BUILD=(1,4,C'BB',7:5)
/*
//CTL2CNTL DD *
  INREC BUILD=(1,4,C'VV',7:5)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(5,2,CH,EQ,C'BV'),
    BUILD=(1,4,5:7)
/*
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Denomination counts by using PARSE in... DFSORT/ICETOOL 8
No new posts ICETOOL to SUM String DFSORT/ICETOOL 1
No new posts ICETOOL returns no records JCL & VSAM 1
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:


Back to Top