Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Copying two files into one using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
tspr52

New User


Joined: 12 Sep 2006
Posts: 30
Location: Madrid, Spain

PostPosted: Fri Mar 09, 2007 12:04 am    Post subject: Copying two files into one using SORT
Reply with quote

Hello,

i have two files:

File A:

aa
bb
cc

File B

aaaaaaaaaaaa
bbbbbbbbbbbb
cccccccccccccc

And I need that:

File C

aa aaaaaaaaaaaa
bb bbbbbbbbbb
cc ccccccccccc

What can I do for do this concatenation?

Thanks for your help,

Jose Luis
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: Fri Mar 09, 2007 12:33 am    Post subject:
Reply with quote

Hello,

Please look in the DFSORT forum. You will see examples of what you want.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Mar 09, 2007 1:53 am    Post subject:
Reply with quote

If you want to join the records one-by-one, you can use the technique discussed in the "Join fields from two files record-by-record" Smart DFSORT Trick. If you want to join the records on a key, you can use the technique discussed in the "Join fields from two files on a key" Smart DFSORT Trick. You can find all of the Smart DFSORT Tricks at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
tspr52

New User


Joined: 12 Sep 2006
Posts: 30
Location: Madrid, Spain

PostPosted: Fri Mar 09, 2007 1:00 pm    Post subject:
Reply with quote

Thanks at all

Well, is the first thing i done, but i dont get any satisfactory result.


Is for that i need to obtein your help...with an example more especificative...

Thank you very much
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Mar 09, 2007 9:19 pm    Post subject:
Reply with quote

Then you need to be more specific about what you want to do. Do you want to join the records one-by-one (record 1 from fileA with record 1 from fileB, record 2 from fileA with record 2 from fileB, etc), or do you want to join the records on a key (what is the starting position, length and format of the key in each file?)
Back to top
View user's profile Send private message
tspr52

New User


Joined: 12 Sep 2006
Posts: 30
Location: Madrid, Spain

PostPosted: Mon Mar 12, 2007 3:15 pm    Post subject:
Reply with quote

First of all, thanks very much for your help. Sometimes you feel very stupid when you waste a lot of time trying to resolve something that seems very easy and you cant make it run ok.

Well, i started for a file that give me two lines, one with the name of the member and another one with the compilation date.

I used the sort tricks book and now i have two files, one with the name of the program and another with the compilation date.

I did that for put those two strings in one line.

The strings are, for example:

File A (8 bytes)

QA2C7400
MD3C6790


File B
22/03/2006
22/06/2007

An need to put in one line:

FILE C

QA2C7400 22/03/2006
MD3C6790 22/06/2007


I try used the examples of the tricks book, but i just obtein an empty file.

Thanks you very very much.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Mar 12, 2007 3:21 pm    Post subject:
Reply with quote

tspr52 wrote:
I try used the examples of the tricks book, but i just obtein an empty file.
Please post your JCL and control information.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Mar 12, 2007 8:34 pm    Post subject:
Reply with quote

tspr52,

I guess you want to join line-by-line. 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/8)
//IN2 DD DSN=...  input file2 (FB/10)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/19)
//TOOLIN   DD    *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(20,8,ZD) -
  WITH(10,10) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(20:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
  INREC BUILD=(10:1,10,20:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,BUILD=(1,19)
/*
Back to top
View user's profile Send private message
tspr52

New User


Joined: 12 Sep 2006
Posts: 30
Location: Madrid, Spain

PostPosted: Tue Mar 13, 2007 3:20 pm    Post subject:
Reply with quote

Thanks very much Frank, god bless you :-)

I had a lot of jcls trying to do the same.

Ok, i get the "logical funtion" to use this tool.

Thanks again.

Jose Luis
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us