IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Concatenating multiple files....


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
CarrieThompson

New User


Joined: 15 Apr 2009
Posts: 7
Location: Birmingham, AL

PostPosted: Wed Apr 15, 2009 5:54 am
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Apr 15, 2009 6:11 am
Reply with quote

FB or VB?
Any DDD in the files?
Any dups?
Any missing?
Back to top
View user's profile Send private message
CarrieThompson

New User


Joined: 15 Apr 2009
Posts: 7
Location: Birmingham, AL

PostPosted: Wed Apr 15, 2009 6:21 am
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Apr 15, 2009 6:28 am
Reply with quote

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
View user's profile Send private message
CarrieThompson

New User


Joined: 15 Apr 2009
Posts: 7
Location: Birmingham, AL

PostPosted: Wed Apr 15, 2009 6:49 am
Reply with quote

They won't have more or less.

Syncsort....not sure as to the release.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Apr 15, 2009 7:00 am
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Apr 15, 2009 12:19 pm
Reply with quote

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? icon_smile.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Apr 15, 2009 12:35 pm
Reply with quote

Just thought to share this: Support for WHEN=GROUP was included in SyncSort for z/OS 1.3.2.0.
Back to top
View user's profile Send private message
CarrieThompson

New User


Joined: 15 Apr 2009
Posts: 7
Location: Birmingham, AL

PostPosted: Wed Apr 15, 2009 6:45 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Apr 15, 2009 6:59 pm
Reply with quote

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
View user's profile Send private message
CarrieThompson

New User


Joined: 15 Apr 2009
Posts: 7
Location: Birmingham, AL

PostPosted: Wed Apr 15, 2009 8:20 pm
Reply with quote

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
View user's profile Send private message
CarrieThompson

New User


Joined: 15 Apr 2009
Posts: 7
Location: Birmingham, AL

PostPosted: Thu Apr 16, 2009 2:38 am
Reply with quote

bump
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Apr 16, 2009 2:57 am
Reply with quote

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
View user's profile Send private message
CarrieThompson

New User


Joined: 15 Apr 2009
Posts: 7
Location: Birmingham, AL

PostPosted: Thu Apr 16, 2009 4:11 am
Reply with quote

What will I need to change to make this work for Syncsort since the example is written in DFSORT?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Apr 16, 2009 5:13 am
Reply with quote

Hello,

If your system has the current release of Syncsort, i believe it will work by changing the lengths and displacements.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top