View previous topic :: View next topic
|
Author |
Message |
CarrieThompson
New User
Joined: 15 Apr 2009 Posts: 7 Location: Birmingham, AL
|
|
|
|
Please help.
This is what I am trying to do:
File 1: AAA
File 2: BBB
File 3: CCC
Output: AAABBBCCC
The files are different formats with different lengths. Any help would be appreciated.
Carrie |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
FB or VB?
Any DDD in the files?
Any dups?
Any missing? |
|
Back to top |
|
|
CarrieThompson
New User
Joined: 15 Apr 2009 Posts: 7 Location: Birmingham, AL
|
|
|
|
Nothing missing.
I think all the input files are FB.
There are, I think, 9 input files, but I just need some sample code to start from. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
CarrieThompson wrote: |
There are, I think, 9 input files, but I just need some sample code to start from. |
Just guessing, but 9 inputs, and rec number 1 from each should be concatenated to the other rec number 1 of the other files? And then rec 2 and so on....?
What happens if one file has more or less records than the others?
BTW, what sort and what release/version? |
|
Back to top |
|
|
CarrieThompson
New User
Joined: 15 Apr 2009 Posts: 7 Location: Birmingham, AL
|
|
|
|
They won't have more or less.
Syncsort....not sure as to the release. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
CarrieThompson wrote: |
Syncsort....not sure as to the release. |
Find and look at one of the top lines of the jes message, the release and version is always displayed...
Start with something like Making horizontal rows and let us know..... |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
Quote: |
not sure as to the release. |
If you have the "latest" then try this:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN1 DD DSN=AAA.file
//SORTIN2 DD DSN=BBB.file
//SORTIN3 DD DSN=CCC.file
//*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(4:1,3)),
IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(1:1,3))
OUTFIL STARTREC=2
/* |
PS.
Quote: |
I think all the input files are FB. |
They are "your" files, right? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Just thought to share this: Support for WHEN=GROUP was included in SyncSort for z/OS 1.3.2.0. |
|
Back to top |
|
|
CarrieThompson
New User
Joined: 15 Apr 2009 Posts: 7 Location: Birmingham, AL
|
|
|
|
This is the version I have: SYNCSORT FOR Z/OS 1.3.2.0
So I should be able to use the above solution. And all the files ARE FB.... |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi Carrie,
Quote: |
So I should be able to use the above solution |
Best bet would be, you try that JCL - if that does not workout post the complete diagnostic information here . . . |
|
Back to top |
|
|
CarrieThompson
New User
Joined: 15 Apr 2009 Posts: 7 Location: Birmingham, AL
|
|
|
|
I think something like this will get me what I need. However, I use SYNCSORT and my file lengths are:
File 1: 713
File 2: 495
File 3: 819
File 4: 297
File 5: 156
File 6: 408
File 7: 270
File 8: 396
File 9: 225
Any ideas?
--------------------------------------------------------------------------------
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 (FB/80)
//IN2 DD DSN=... input file2 (FB/80)
//IN3 DD DSN=... input file3 (FB/80)
//IN4 DD DSN=... input file4 (FB/80)
//IN5 DD DSN=... input file5 (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file (FB/400)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
COPY FROM(IN3) TO(T1) USING(CTL3)
COPY FROM(IN4) TO(T1) USING(CTL4)
COPY FROM(IN5) TO(T1) USING(CTL5)
SPLICE FROM(T1) TO(OUT) ON(401,8,ZD) -
WITHEACH WITH(81,80) WITH(161,80) WITH(241,80) WITH(321,80) -
USING(CTL6)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1,80,401:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
OUTREC FIELDS=(81:1,80,401:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
OUTREC FIELDS=(161:1,80,401:SEQNUM,8,ZD)
/*
//CTL4CNTL DD *
OUTREC FIELDS=(241:1,80,401:SEQNUM,8,ZD)
/*
//CTL5CNTL DD *
OUTREC FIELDS=(321:1,80,401:SEQNUM,8,ZD)
/*
//CTL6CNTL DD *
OUTFIL FNAMES=OUT,OUTREC=(1,400)
/* |
|
Back to top |
|
|
CarrieThompson
New User
Joined: 15 Apr 2009 Posts: 7 Location: Birmingham, AL
|
|
|
|
bump |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Have you tried the suggestion that has somehow been appended to your earlier reply (i have no idea how it got there - unless you copied it in)?
If you change the lengths and displacements from 80 and multiples of 80+1, you should be close with that suggestion.
Suggest you try with only the first 2 files to make sure you are on the right track.
If there are any questions or problems, post back here. |
|
Back to top |
|
|
CarrieThompson
New User
Joined: 15 Apr 2009 Posts: 7 Location: Birmingham, AL
|
|
|
|
What will I need to change to make this work for Syncsort since the example is written in DFSORT? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If your system has the current release of Syncsort, i believe it will work by changing the lengths and displacements. |
|
Back to top |
|
|
|