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
 

 

need to add new fields to variable dataset using icetool

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

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Tue Aug 15, 2006 11:26 pm    Post subject: need to add new fields to variable dataset using icetool
Reply with quote

I need to extract 2 fields from file1 and add these two to file2 if the key matches,how can i do this using icetool

File1-variable length-28
field-11
field-12
field-13
field-14

File2-variable length-110
field-21
field-22
field-23...till
field-29

now i need to add field-13 and field-14 from File1 to File2 so that the output file length = length of File2 + length(Field-13+field-14)

how can i use ICETOOL to accomplish this.
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 Aug 15, 2006 11:40 pm    Post subject:
Reply with quote

You need to give more details.

What is the starting position, length and format of each field in file1, file2 and the output file? Remember that the RDW is in positions 1-4 and the first data byte starts in position 5.

What is the starting position, length and format of the key you want to match on in file1 and in file2?

Where exactly do you want to insert the fields in the output record?

Are all of the VB records in file1 the same length or do the lengths vary?
Are all of the VB records in file2 the same length or do the lengths vary?

It would help if you showed an example of the records in each input file and the expected output records.
Back to top
View user's profile Send private message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Tue Aug 15, 2006 11:56 pm    Post subject:
Reply with quote

Code:

01  WS-FILE1.                                                 
    05 FILE1-LENGTH                    PIC 9(04) COMP.         
    05 FILLER                          PIC X(02).             
    05 FIELD-11                        PIC X(03).             
    05 FILLER                          PIC X(01).             
    05 FIELD-12                        PIC S9(13)V9(02) COMP-3.
    05 FIELD-13                        PIC S9(13)V9(02) COMP-3.
    05 FIELD-14                        PIC S9(13)V9(02) COMP-3.
    05 FIELD-15                        PIC S9(13)V9(02) COMP-3.
    05 FIELD-16                        PIC X(01).             
    05 FILLER                          PIC X(03).             
    05 FIELD-17                        PIC X(03).             
    05 FILLER                          PIC X(01).             
    05 FIELD-18                        PIC S9(13)V9(02) COMP-3.
    05 FIELD-19                        PIC S9(13)V9(02) COMP-3.
    05 FIELD-20                        PIC S9(13)V9(02) COMP-3.
    05 FIELD-21                        PIC S9(13)V9(02) COMP-3.
    05 FIELD-22                        PIC S9(13)V9(02) COMP-3.
    05 FIELD-23                        PIC S9(09)V9(08) COMP-3.
    05 FIELD-24                        PIC S9(09)V9(08) COMP-3.


FIELD-17 -- KEY FOR FILE1

Code:

01 WS-FILE2.                                                 
   05 FILE2-LENGTH                    PIC 9(04) COMP.         
   05 FILLER                          PIC X(02).             
   05 FIELD-91                        PIC X(03).             
   05 FILLER                          PIC X(01).             
   05 FIELD-92                        PIC S9(13)V9(02) COMP-3.
   05 FIELD-93                        PIC S9(13)V9(02) COMP-3.
   05 FIELD-94                        PIC X(01).             
   05 FILLER                          PIC X(03).             


FIELD-91 -- KEY FOR FILE2

now, i need to compare FIELD-91 and FIELD-17, if same, need to add the fields FIELD-92,FIELD-93 from FILE2 to FILE-1.
e.g

FILE-1
XYZ +12345.00 +2345.00 +334.00 +5678.00 AAA....
kkk +12345.00 +2345.00 +334.00 +5678.00 AAA....

FILE-2
AAA +9999.99 +8888.88....

OUTPUT FILE
XYZ +12345.00 +2345.00 +334.00 +5678.00 AAA....+9999.99 +8888.88
kkk +12345.00 +2345.00 +334.00 +5678.00 AAA....+9999.99 +8888.88

the '+' indicates COMP-3 values
Back to top
View user's profile Send private message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Wed Aug 16, 2006 12:18 am    Post subject:
Reply with quote

I tried with this:
Code:

//STEP01  EXEC PGM=ICETOOL                           
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1     DD DSN=FILE-1, 
//           DISP=SHR                               
//IN2     DD DSN=FILE-2,
//           DISP=SHR                               
//OUT11   DD DSN=OUT-FILE,
//           SPACE=(TRK,(10,10),RLSE),               
//           DISP=(NEW,CATLG,DELETE)                 
//T1      DD DSN=&&TEMP,DISP=(MOD,PASS),             
//           SPACE=(TRK,(10,10),RLSE)               
//TOOLIN  DD *                                       
COPY FROM(IN1) TO(T1) USING(CTL1)                   
COPY FROM(IN2) TO(T1) USING(CTL2)                   
SPLICE FROM(T1) TO(OUT11) ON(41,3,CH) WITHALL -     
       WITH(107,16) USING(CTL3)                     
/*                                                   
//CTL1CNTL DD *                                     
 OUTREC FIELDS=(1:5,40,                             
               41:45,3,                               
               44:48,59,                 
              107:16X),CONVERT           
/*                                       
//CTL2CNTL DD *                         
 OUTREC FIELDS=(1:40X,                   
               41:5,3,                   
               44:63X,                   
              107:9,16),CONVERT         
/*                                       
//CTL3CNTL DD *                         
 OUTFIL FNAMES=OUT11,FTOV,OUTREC=(1,122)
/*                                       


But i am getting output as
XYZ +12345.00 +2345.00 +334.00 +5678.00 AAA....00000
XYZ +12345.00 +2345.00 +334.00 +5678.00 AAA....00000

The record KKK is missing and XYZ is repeated...

The key is 'AAA'
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: Wed Aug 16, 2006 1:29 am    Post subject:
Reply with quote

It appears that file1 has duplicate keys within it - right (AAA in both records)?

It appears that file2 does NOT have duplicate keys within it - right? If file2 can have duplicate keys within it, then show an example of input and output for that case.

Based on your COBOL layouts, the DFSORT position and lengths are as follows:

Code:

Pos Len      01  WS-FILE1.
 1    2          05 FILE1-LENGTH  PIC 9(04) COMP.
 3    2          05 FILLER        PIC X(02).
 5    3          05 FIELD-11      PIC X(03).
 8    1          05 FILLER        PIC X(01).
 9    8          05 FIELD-12      PIC S9(13)V9(02) COMP-3.
 17   8          05 FIELD-13      PIC S9(13)V9(02) COMP-3.
 25   8          05 FIELD-14      PIC S9(13)V9(02) COMP-3.
 33   8          05 FIELD-15      PIC S9(13)V9(02) COMP-3.
 41   1          05 FIELD-16      PIC X(01).
 42   3          05 FILLER        PIC X(03).
 45   3          05 FIELD-17      PIC X(03).                  *
 48   1          05 FILLER        PIC X(01).
 49   8          05 FIELD-18      PIC S9(13)V9(02) COMP-3.
 57   8          05 FIELD-19      PIC S9(13)V9(02) COMP-3.
 65   8          05 FIELD-20      PIC S9(13)V9(02) COMP-3.
 73   8          05 FIELD-21      PIC S9(13)V9(02) COMP-3.
 81   8          05 FIELD-22      PIC S9(13)V9(02) COMP-3.
 89   9          05 FIELD-23      PIC S9(09)V9(08) COMP-3.
 98   9          05 FIELD-24      PIC S9(09)V9(08) COMP-3.

Total length = 106

FIELD-17 -- KEY FOR FILE1 -> 45,3

Pos Len      01 WS-FILE2.
 1     2         05 FILE2-LENGTH   PIC 9(04) COMP.
 3     2         05 FILLER         PIC X(02).
 5     3         05 FIELD-91       PIC X(03).                   *
 8     1         05 FILLER         PIC X(01).
 9     8         05 FIELD-92       PIC S9(13)V9(02) COMP-3.
17    8         05 FIELD-93       PIC S9(13)V9(02) COMP-3.
25    1         05 FIELD-94       PIC X(01).
26    3         05 FILLER         PIC X(03).

Total length = 28

FIELD-91 -- KEY FOR FILE2 -> 5,3


And for matching keys, you want the output to contain positions 1-106 from the file1 record followed by positions 9-24 from the file2 record - right?
Back to top
View user's profile Send private message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Wed Aug 16, 2006 1:34 am    Post subject:
Reply with quote

File-1 has duplicate keys

File-2 does not have duplicate keys

Yes, the output should have 1-106 from File-1 and 9-24 from File-2
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: Wed Aug 16, 2006 3:52 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=*
//IN1 DD DSN=...  input file1 (VB)
//IN2 DD DSN=...  input file2 (VB)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (VB)
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(47,3,BI) KEEPNODUPS -
  WITHALL WITH(6,103) USING(CTL3)
/*
//CTL1CNTL DD *
  OUTREC BUILD=(1,4,C'BB',47:5,3,109:9,16)
/*
//CTL2CNTL DD *
  OUTREC BUILD=(1,4,C'VV',5,102,124:X)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(5,2,CH,EQ,C'BV'),
     BUILD=(1,4,7)
/*
Back to top
View user's profile Send private message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Wed Aug 16, 2006 6:19 pm    Post subject:
Reply with quote

i am getting syntax error in OUTREC

Error description in DFSMSG
CTL1CNTL :
OUTREC BUILD=(1,4,C'BB',47:5,3,109:9,16)
*
OUTREC STATEMENT : SYNTAX ERROR

Error description in JESMSGLG
STEP01 , -OUTREC STATEMENT : SYNTAX ERROR
STEP01 - ABEND=S000 U0016 REASON=00000000
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Wed Aug 16, 2006 8:00 pm    Post subject: Re: need to add new fields to variable dataset using icetool
Reply with quote

kalukakkad, please post the ENTIRE error messages with the error codes intact.
Back to top
View user's profile Send private message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Wed Aug 16, 2006 8:08 pm    Post subject:
Reply with quote

PARMEXIT : SIZE=MAX-64K
CTL1CNTL :
OUTREC BUILD=(1,4,C'BB',47:5,3,109:9,16)
*
WER428I CALLER-PROVIDED IDENTIFIER IS "0001"
WER161B ALTERNATE PARM USED
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
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: Wed Aug 16, 2006 8:43 pm    Post subject:
Reply with quote

kalukakkad,

The WER messages indicate you're using Syncsort, not DFSORT. The job works fine with DFSORT.

I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
Back to top
View user's profile Send private message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Wed Aug 16, 2006 8:57 pm    Post subject:
Reply with quote

Thanks Frank for all the help u provided....
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 Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm


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