MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SYNCSORT -appending data from 2 files

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
rasprasads
Beginner


Joined: 10 Dec 2002
Posts: 59
Topics: 20
Location: Chennai

PostPosted: Wed Dec 11, 2002 9:52 am    Post subject: SYNCSORT -appending data from 2 files Reply with quote

I have 2 input files with following descriptions:

1.First file
LRECL=300
No of records=5000(may vary for each run)

2.Second file
LRECL=5(Packed decimal)
No of record=1(The content may vary for each run)

I need to get an output file with LRECL=305 with the data in second file being appended at the end to all the records in the first file.(So it would have 5000 records)

I do not want to use COBOL program.
I want to do it through JCL SYNCSORT.
How can this output be produced with SYNCSORT(i do not have DFSORT)...


Thanks
Rasprasad S
_________________
Rasprasad S
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12368
Topics: 75
Location: San Jose

PostPosted: Wed Dec 11, 2002 11:08 am    Post subject: Reply with quote

Rasprasad,

The following JCl will give you the desired results.

Code:

//STEP0100 EXEC PGM=SYNCTOOL
//*
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN1      DD DSN=YOUR 300 LRECL FILE,
//            DISP=SHR
//IN2      DD DSN=YOUR 5 LRECL FILE,
//            DISP=SHR
//OUT      DD DSN=OUTPUT FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//TOOLIN   DD *
  COPY   FROM(IN2) TO(CTL2CNTL) USING(CTL1)
  COPY   FROM(IN1) TO(OUT)      USING(CTL2)
//CTL1CNTL DD *
  OUTREC FIELDS=(C' OUTREC FIELDS=(1,300,C''',1,5,C''')',80:X) 
//CTL2CNTL DD DSN=&T1,DISP=(,PASS),UNIT=SYSDA,SPACE=(TRK,(1,1),RLSE)
/*


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CaptBill
Beginner


Joined: 02 Dec 2002
Posts: 100
Topics: 2
Location: Pasadena, California, USA

PostPosted: Wed Dec 11, 2002 12:46 pm    Post subject: Reply with quote

Rasprasad,

I believe you asked this in old help board too. Rolling Eyes
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rajvasan
Beginner


Joined: 10 Dec 2002
Posts: 14
Topics: 4

PostPosted: Wed Dec 18, 2002 3:06 am    Post subject: Reply with quote

Kolusu,
I have a doubt. When the first Copy statement is encountered, the temporary dataset T1 is created and contains the dynamic control card. When the subsequent Copy statement is encountered, it refers to CTL2
(which is CTL2CNTL), would it not try to create a dataset that has already been created during the first COPY statement, and hence throw a JCL error. Can you please explain this...
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12368
Topics: 75
Location: San Jose

PostPosted: Wed Dec 18, 2002 4:12 am    Post subject: Reply with quote

Rajvasan,

Take a close look at the control statements

Code:

  COPY   FROM(IN2) TO(CTL2CNTL) USING(CTL1)
  COPY   FROM(IN1) TO(OUT)      USING(CTL2)


The first copy statement is creating the CTL2CNTL dataset ( as you can see from the clause TO)

The second copy statement is USING the CTL2 control card created in the first copy statement and creating OUT dataset( as you can see from the clause TO)

Basically the second copy statement is USING the control card created , so there is no question of creating the CTL2 dataset again in the second copy step.

Hope this helps....

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group