View previous topic :: View next topic
|
Author |
Message |
NCROLL
New User
Joined: 19 May 2008 Posts: 5 Location: UK
|
|
|
|
I want to take a single value out of one dataset and then have this value occur in each record of a 2nd dataset I am to process. Can this be achieved using ICETOOL ?
Here is a working example
Record 1
Code: |
12345678901234567890123456789012345678901234567890123456789
000IVP USER SCRBOSPRO01NNNNYY N N N NNN YN Y0250
1950101AAPPRO01 051408 P 200725200811 Y
1950102A
1950103A
1950104A 00000000000000{
1950105AACCOUNTS PAYABLE PROCESSING
|
From this record I only want to capture the data from record two for bytes 9 through 26. ie. PRO01 051408
Dataset two coming in looks like this
Code: |
122F06CONTRAF06019999999EUR
122F06988600000013005235EUR
122F06988600000013005251EUR
122F06988600000017502554EUR
122F06988600000017505286EUR
122F06988600000022002538EUR |
The dataset I want to have as my result would be ….
Code: |
PRO01 051408122F06CONTRAF06019999999EUR
PRO01 051408122F06988600000013005235EUR
PRO01 051408122F06988600000013005251EUR
PRO01 051408122F06988600000017502554EUR
PRO01 051408122F06988600000017505286EUR
PRO01 051408122F06988600000022002538EUR |
Should I just write this using a cobol program or can ICETOOL actually do this? If so how? From a basic understanding I think SPLICE should be able to do this but right now it is not obvious how. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You don't need SPLICE for this - you can do it quite easily by using DFSORT Symbols as follows:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file1
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
INREC BUILD=(11,16,17:SEQNUM,8,ZD)
OUTFIL INCLUDE=(17,8,ZD,EQ,+2),
BUILD=(C'CON,''',1,16,C'''',80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file2
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(1:CON)
/*
|
|
|
Back to top |
|
|
NCROLL
New User
Joined: 19 May 2008 Posts: 5 Location: UK
|
|
|
|
Thanks Frank.
You have made this look very simple but I had never considered building a synames card as input with the constant declared in there captured from the first dataset.
This has opened my eyes about other uses that ICETOOL has.
Once again thanks you for this. |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
Hi ,
I was just wondering what would be case if the second input file had no spaces infront of the record. If we want to append 'PRO01 051408' to all the records in the second file whose records start from column 1, what changes should be made to the above suggested code.
Thanks
Manu |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You would change the INREC statement for S2 to:
Code: |
INREC BUILD=(CON,1,n)
|
where n is the number of bytes you want from the original records (1-n).
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
Thanks a lot Frank. Will look into the document to familiarise myself with DFSORT. |
|
Back to top |
|
|
|