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 

Insert values into records while using syncsort

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


Joined: 14 Dec 2002
Posts: 2
Topics: 2

PostPosted: Sat Dec 14, 2002 3:51 am    Post subject: Insert values into records while using syncsort Reply with quote

I want to append file information to every record to identify which sortin file this record belongs to. There are around 50 files which will be used as Sortin

For ex:
If Sortin DD has 2 files

File 1 : T.JOB001PP.SORTIN01
Code:

Records :                     Record 11
                              Record 12

File 2 : T.JOB002PP.SORTIN02
Code:

Records :                      Record 21
                               Record 22

I want a Sort out file with file number appended to it.

Code:

                01    Record 11
                01    Record 12
                02    Record 21
                02    Record 22

Is there a way to do it in Syncsort
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Sat Dec 14, 2002 8:48 am    Post subject: Reply with quote

Cvidhya,
The following Jcl will give you the desired results. I assumed that all your input files are of 80 bytes LRECL.we copy each file individually and append the data. DiSP=mod on the output file lets you append the data at the end.Make sure that the output file is empty for every run.

Code:

//STEP0100 EXEC PGM=SYNCTOOL
//*
//TOOLMSG  DD  SYSOUT=*
//DFSMSG   DD  SYSOUT=*
//IN01     DD  DSN=YOUR INPUT FILE01,
//             DISP=SHR
//IN02     DD  DSN=YOUR INPUT FILE02,
//             DISP=SHR
..... ALL YOUR FILES HERE
//IN50     DD  DSN=YOUR INPUT FILE50,
//             DISP=SHR
//OUT      DD  DSN=YOUR OUTPUT FILE,
//             DISP=(MOD,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(X,Y),RLSE)
//TOOLIN   DD  *
  COPY FROM(IN01) TO(OUT) USING(CT01)   
  COPY FROM(IN02) TO(OUT) USING(CT02)   
  .....ALL OTHER COPY  STATEMENTS
  COPY FROM(IN50) TO(OUT) USING(CT50)   
//CT01CNTL  DD  *
  OUTREC FIELDS=(C'01',1,80)
//CT02CNTL  DD  *
  OUTREC FIELDS=(C'02',1,80)
...ALL OTHER CARD STATEMENTS
//CT50CNTL  DD  *
  OUTREC FIELDS=(C'50',1,80)
/*


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