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
 

 

SYNCSORT Append to the file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT Append to the file
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: 1703
Location: Australia

PostPosted: Mon Oct 13, 2008 3:31 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Oct 13, 2008 3:33 pm    Post subject:
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    Post subject:
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: 500
Location: USA

PostPosted: Mon Oct 13, 2008 8:01 pm    Post subject:
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    Post subject: Reply to: SYNCSORT Append to the file
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: 500
Location: USA

PostPosted: Mon Oct 13, 2008 9:15 pm    Post subject:
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    Post subject: Reply to: SYNCSORT Append to the file
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: 2238
Location: @my desk

PostPosted: Tue Oct 14, 2008 9:45 am    Post subject:
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    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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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