View previous topic :: View next topic
|
Author |
Message |
Alexis Sebastian
New User
Joined: 04 Mar 2010 Posts: 38 Location: DC
|
|
|
|
Hi,
Could anyone please help me on this requirement?
Input File Length - 80 bytes - Fixed
Output File will also be the same 80 bytes FB
Sample input file is given below.
Code: |
45213820 ANDERSON 20145248 JAMES 44758321 KALLIS
$£" JUNK 47518932 HARRIS ^%$(%£ JUNK
£$$ JUNK
84215677 PATTERSON ^%$ JUNK
)!" JUNK 21478221 FORREST
82144525 CLARKE $£! JUNK 24805789 STEYN
45213820 BROAD
|
Key field starts at first 8 bytes Numeric value.
Each proper record is 20 bytes length. So another key field can start only at 21st or 41st or 61st in a single row.
Each row may contain more than 1 proper record(20 bytes max) but upto 4 proper records.
Each row in the input file may contain maximum of 4 key fields or 3 or 2 or 1 or nothing.
Key fields start with special characters or anything other than numeric can be excluded from that row.
Here is the sample output file
Code: |
45213820 ANDERSON
20145248 JAMES
44758321 KALLIS
47518932 HARRIS
84215677 PATTERSON
21478221 FORREST
82144525 CLARKE
24805789 STEYN
45213820 BROAD |
|
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Alexis Sebastian,
With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), you can now use the new RESIZE operator of DFSORT's ICETOOL to easily create larger records from smaller records, or smaller records from larger records.
Use the following DFSORT/ICETOOL JCL which will give you the desired results.
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
----+----1----+----2----+----3----+----4----+----5----+----
45213820 ANDERSON 20145248 JAMES 44758321 KALLIS
$£" JUNK 47518932 HARRIS ^%$(%£ JUNK
£$$ JUNK
84215677 PATTERSON ^%$ JUNK
)!" JUNK 21478221 FORREST
82144525 CLARKE $£! JUNK 24805789 STEYN
45213820 BROAD
//OUT DD SYSOUT=*
//TOOLIN DD *
RESIZE FROM(IN) TO(OUT) TOLEN(20) USING(CTL1)
//CTL1CNTL DD *
OPTION COPY
OUTFIL FNAMES=OUT,INCLUDE=(1,8,FS,EQ,NUM),OVERLAY=(80:X)
//* |
The output from this job is
Code: |
45213820 ANDERSON
20145248 JAMES
44758321 KALLIS
47518932 HARRIS
84215677 PATTERSON
21478221 FORREST
82144525 CLARKE
24805789 STEYN
45213820 BROAD
|
For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242 |
|
Back to top |
|
|
Alexis Sebastian
New User
Joined: 04 Mar 2010 Posts: 38 Location: DC
|
|
|
|
Many thanks for your help and its working fine.
Its created multiple shorter records from the larger record input file(fixed length).
I would like to know whether this will work out for the below case as well?
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
DGQ%&"£!20145248 JAMES %$£!44758321 KALLIS (*%^51247620 GILLI
$£" 47518932 HARRIS ^%$(!^£%&$($ 82301575 PUNTER
£$$ JUNK
%$)&**( 84215677 PATTERSON ^%$ $%"F JUNK
)!" 21478221 FORREST ^%"£10587412 RICKY
$£$)$%$*£$%$£% %£*%£)($_$%_ $&"£24805789 STEYN
£)$&$)"_DKD ("&£45213820 BROAD
|
Here every proper record starts at 9th position with length of 20 bytes.
From 29th position (i.e end of first proper record) to 32nd pos (length 4 bytes) are junk values and so next proper record will start 4 bytes later than the previuos proper record.
Next proper record starts at 33 and another one starts at 57.
Each proper record's length is 20 bytes.
Sample output
Code: |
20145248 JAMES
44758321 KALLIS
51247620 GILLI
47518932 HARRIS
82301575 PUNTER
84215677 PATTERSON
21478221 FORREST
10587412 RICKY
24805789 STEYN
45213820 BROAD |
Thanks in advance. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try this
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
DGQ%&"£!20145248 JAMES %$£!44758321 KALLIS (*%^51247620 GILLI
$£" 47518932 HARRIS ^%$(!^£%&$($ 82301575 PUNTER
£$$ JUNK
%$)&**( 84215677 PATTERSON ^%$ $%"F JUNK
)!" 21478221 FORREST ^%"£10587412 RICKY
$£$)$%$*£$%$£% %£*%£)($_$%_ $&"£24805789 STEYN
£)$&$)"_DKD ("&£45213820 BROAD
//OUT DD SYSOUT=*
//TOOLIN DD *
RESIZE FROM(IN) TO(OUT) TOLEN(020) USING(CTL1)
//CTL1CNTL DD *
INREC BUILD=(9,20,33,20,57,20)
OUTFIL FNAMES=OUT,INCLUDE=(1,8,FS,EQ,NUM),OVERLAY=(80:X)
/* |
Gerry |
|
Back to top |
|
|
Alexis Sebastian
New User
Joined: 04 Mar 2010 Posts: 38 Location: DC
|
|
|
|
It works as expected.
Many thanks for your help.
I would like to learn more about data format like FS - Floating Sign, etc.. and its usage. Please guide. |
|
Back to top |
|
|
charanmsrit
New User
Joined: 25 Oct 2007 Posts: 81 Location: Australia
|
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Alexis Sebastian wrote: |
It works as expected.
Many thanks for your help.
I would like to learn more about data format like FS - Floating Sign, etc.. and its usage. Please guide. |
Alexis Sebastian,
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:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080 |
|
Back to top |
|
|
|