Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Concatenating multiple files....

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Concatenating multiple files....
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: 2150
Location: At my coffee table

PostPosted: Wed Apr 15, 2009 6:11 am    Post subject:
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    Post subject: No dups....
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: 2150
Location: At my coffee table

PostPosted: Wed Apr 15, 2009 6:28 am    Post subject:
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    Post subject: Right.....
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: 2150
Location: At my coffee table

PostPosted: Wed Apr 15, 2009 7:00 am    Post subject: Re: Right.....
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

Senior Member


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

PostPosted: Wed Apr 15, 2009 12:19 pm    Post subject:
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

Senior Member


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

PostPosted: Wed Apr 15, 2009 12:35 pm    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Wed Apr 15, 2009 6:59 pm    Post subject:
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    Post subject:
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    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Thu Apr 16, 2009 2:57 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Apr 16, 2009 5:13 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm
No new posts Icetool or Joinkeys example to compar... ishant chauhan DFSORT/ICETOOL 21 Sat Aug 20, 2016 2:40 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us