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: 2180
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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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