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

SYNCSORT Append to the file


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

New User


Joined: 13 Oct 2008
Posts: 4
Location: Chennai

PostPosted: Mon Oct 13, 2008 3:13 pm
Reply with quote

Hi All,

I have two input file

F1 - VB of Record length = 250

F2 - VB of record length = 1(which will be a character)

I need to append the data in file2 to file1.Can anyone help me out regarding this.

Thanks,
Meena
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Oct 13, 2008 3:31 pm
Reply with quote

Hi,

try this
Code:
//COPYSTEP EXEC PGM=SORT                   
//SORTIN   DD DSN=FILE2,DISP=SHR               
//SORTOUT  DD DSN=FILE1,DISP=MOD               
//SYSOUT   DD SYSOUT=*                         
//SYSIN    DD *                                 
  SORT FIELDS=COPY                             



Gerry
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Oct 13, 2008 3:33 pm
Reply with quote

Or do you mean that you want the data of file 1 to be followed by the data of file 2 in one record.

Please ask your questions in a clear manner.
Back to top
View user's profile Send private message
meena90

New User


Joined: 13 Oct 2008
Posts: 4
Location: Chennai

PostPosted: Mon Oct 13, 2008 3:44 pm
Reply with quote

Hi Expat,

Ya,I need the data of file1 to be followed by the data of file2.

Thanks,
Meena
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Mon Oct 13, 2008 8:01 pm
Reply with quote

OK, still not quite clear. Which scenario below is what you want:

#1
Code:

File1-Record1
File1-Record2
.
.
.
File2-Record1
File2-Record2
.
.
.


#2
Code:

File1-Record1 File2-Record1
File1-Record2 File2-Record2
.
.
.
Back to top
View user's profile Send private message
meena90

New User


Joined: 13 Oct 2008
Posts: 4
Location: Chennai

PostPosted: Mon Oct 13, 2008 8:53 pm
Reply with quote

I need for the second one.

Thanks,
Meena
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Mon Oct 13, 2008 9:15 pm
Reply with quote

Are there the same number of records in File 1 and File 2?

Are they both already in sorted order?
Back to top
View user's profile Send private message
meena90

New User


Joined: 13 Oct 2008
Posts: 4
Location: Chennai

PostPosted: Tue Oct 14, 2008 8:45 am
Reply with quote

There are equal no of records in it(say File1 and file2 both have 5 records). And they are not sorted.

Input in File1:

ID# Department Class
----- -------------- -------
10 4 2
12 2 1


Input in File2:

Flag
-----

Y
Y

Expected output:


ID# Department Class Flag
----- -------------- ------- -----
10 4 2 Y
12 2 1 Y
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Oct 14, 2008 9:45 am
Reply with quote

Quote:
F2 - VB of record length = 1(which will be a character)

Just curious how could somebody alloacte a VB file of LRECL=1. VB files have a 4 byte RDW and AFAIK, you'll not be able to have LRECL less than or equal to 4. I believe it's better to have an FB file of same length rather than having a 5 byte file.

Also since file-1 is a VB file, how will you handle this scenario? Where do you want to append the file-2 character in the below case?
Code:
file-1,record-1
file-1,record---------2
file-1,record---------------3
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top