View previous topic :: View next topic
|
Author |
Message |
shyamprasad37
New User
Joined: 17 Nov 2010 Posts: 7 Location: India
|
|
|
|
Hi,
Could you please help me in this.
i have two files
File1
0000000100
File2
0000000107
i need this two files should be joined like
File3
0000000100 0000000107 |
|
Back to top |
|
|
nelson.pandian
Active User
Joined: 09 Apr 2008 Posts: 133 Location: Phoenix, AZ
|
|
|
|
Hi shyam,
Please check this link. Hope this helps you. If you need more help, let us know. |
|
Back to top |
|
|
shyamprasad37
New User
Joined: 17 Nov 2010 Posts: 7 Location: India
|
|
|
|
Hi Nelson,
i have tried the link. but i could not get an idea. i am new to ICETOOL. could you please get me the code for my requirement. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Click HERE to see the DFSORT smart tricks document which shows exactly how this can be achieved. |
|
Back to top |
|
|
shyamprasad37
New User
Joined: 17 Nov 2010 Posts: 7 Location: India
|
|
|
|
The document provides the syntax. but i colud not unsderstand the logic behind the scene. Could you please share me the code and explain the logic.. i was very much confused |
|
Back to top |
|
|
shyamprasad37
New User
Joined: 17 Nov 2010 Posts: 7 Location: India
|
|
|
|
HI,
i have used Merge and i combined the files like
0000000100
0000000107
But i wanted it to be in a single line. No matter if i get spaces or special characters in between also.
Is it poosible to do it. |
|
Back to top |
|
|
nelson.pandian
Active User
Joined: 09 Apr 2008 Posts: 133 Location: Phoenix, AZ
|
|
|
|
Hi shyam,
Do you have the latest Version (V1R12 PTF UK90026 (Oct 2010)) of DFSORT/ICETOOL in your shop?
Will you have only 1 record in both of your input file? or if not, what are the rules to achieve your output?
What is you INPUT/OUTPUT - LRECL & RECFM? |
|
Back to top |
|
|
shyamprasad37
New User
Joined: 17 Nov 2010 Posts: 7 Location: India
|
|
|
|
Hi Nelson,
Z/OS DFSORT V1R10 |
|
Back to top |
|
|
nelson.pandian
Active User
Joined: 09 Apr 2008 Posts: 133 Location: Phoenix, AZ
|
|
|
|
Hi Shyam,
The below DFSORT/ICETOOL job will give you the desired output. Assumed your both Input files of LRECL=10, OUTPUT File LRECL=20 & RECFM=FB. Job attributes can be changed accordingly.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
0000000100
0000000107
//OUT DD SYSOUT=*
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(21,1,CH) -
WITHEACH WITH(11,10) WITH(21,10) USING(CTL1)
/*
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(21:C'A',22:SEQNUM,1,ZD)),
IFTHEN=(WHEN=(22,1,ZD,EQ,+2),OVERLAY=(11:1,10))
OUTFIL FNAMES=OUT,BUILD=(1,10,1X,11,10)
/* |
OUTPUT:
Code: |
0000000100 0000000107 |
Hope this helps you. |
|
Back to top |
|
|
shyamprasad37
New User
Joined: 17 Nov 2010 Posts: 7 Location: India
|
|
|
|
Hi,
Thanks a lot!
I got it |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
shyamprasad37 wrote: |
Z/OS DFSORT V1R10 |
If you have z/OS DFSORT V1R10 PTF UK90025, using RESIZE parameter would be a neat choice, I believe. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Anuj.
Are you sure "RESIZE" will achieve this? |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Arun Raj wrote: |
Anuj.
Are you sure "RESIZE" will achieve this? |
Well assuming there is a header record to differentiate the records from 2 different files then yes , RESIZE can be used to merge records. However Joinkeys would be an apt choice for such requests. Resize works better on single files
Assuming that you want to merge 10 byte lrecl into 20 byte records , the following DFSORT/ICETOOL JCL will give you the desired results
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
HDR
F1-REC# 1
F1-REC# 2
F1-REC# 3
F1-REC# 4
F1-REC# 5
// DD *
HDR
F2-REC# 1
F2-REC# 2
F2-REC# 3
F2-REC# 4
F2-REC# 5
//OUT DD SYSOUT=*
//TOOLIN DD *
RESIZE FROM(IN) TO(OUT) TOLEN(36) USING(CTL1)
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=INIT,BUILD=(1,10)),
IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'HDR'),PUSH=(11:SEQ=8))
SORT FIELDS=(11,8,CH,A),EQUALS
OUTFIL FNAMES=OUT,BUILD=(1,10,19,10)
//* |
The output from this job is
Code: |
HDR HDR
F1-REC# 1 F2-REC# 1
F1-REC# 2 F2-REC# 2
F1-REC# 3 F2-REC# 3
F1-REC# 4 F2-REC# 4
F1-REC# 5 F2-REC# 5
|
|
|
Back to top |
|
|
shyamprasad37
New User
Joined: 17 Nov 2010 Posts: 7 Location: India
|
|
|
|
INREC IFTHEN=(WHEN=INIT,OVERLAY=(21:C'A',22:SEQNUM,1,ZD)),
IFTHEN=(WHEN=(22,1,ZD,EQ,+2),OVERLAY=(11:1,10))
OUTFIL FNAMES=OUT,BUILD=(1,10,1X,11,10)
Hi,
Could you please tell me why we use OVERLAY=(21:C'A',22:SEQNUM,1,ZD)),
I tried in OVERLAY=(22:SEQNUM,1,ZD)),
its working fine. but could you please tell me ,why we need to use 21:C'A' |
|
Back to top |
|
|
nelson.pandian
Active User
Joined: 09 Apr 2008 Posts: 133 Location: Phoenix, AZ
|
|
|
|
Hi Shyam,
Quote: |
i have two files
File1
0000000100
File2
0000000107 |
For combining two files using splice we need a common key in both the file records. So overlayed 21:C'A'. |
|
Back to top |
|
|
|