Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
copy one to many

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
jaytolliver

New User


Joined: 14 Feb 2006
Posts: 2

PostPosted: Sat Sep 21, 2013 9:44 am    Post subject: copy one to many
Reply with quote

Hello, I'm looking for a means of coping one column of data (from input dsn #1) to another column of data (from input dsn #2) to form output dataset.
example
input#1:
a2345
b1234

input#2
DataA1
DataB2
DataB4

output:
co a2345 gro(dataa1) own(dataa1)
co a2345 gro(datab2) own(datab2)
co a2345 gro(datab4) own(datab4)
co b1234 gro(dataa1) own(dataa1)
co b1234 gro(datab2) own(datab2)
co b1234 gro(datab4) own(datab4)

Essentially, I'm copy a list of userID to a string of groups. I'm sure this has been addressed before, but I have not be successful in finding examples on how to address this... any assistance would be appreciated.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7312

PostPosted: Sat Sep 21, 2013 1:25 pm    Post subject: Reply to: copy one to many
Reply with quote

You have SyncSort? Does your version support JNFnCNTL files for JOINKEYS?
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Sat Sep 21, 2013 1:25 pm    Post subject: Reply to: copy one to many
Reply with quote

Check this code --

Code:

//STEP01   EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SORTJNF1 DD *
A2345
B1234
//SORTJNF2 DD *
DATAA1
DATAB2
DATAB4
//SORTOUT  DD SYSOUT=*
//JNF1CNTL DD *
  INREC OVERLAY=(81:C'0000')
//JNF2CNTL DD *
  INREC OVERLAY=(81:C'0000')
//SYSIN    DD *
  JOINKEYS FILES=F1,FIELDS=(81,4,A)
  JOINKEYS FILES=F2,FIELDS=(81,4,A)
  REFORMAT FIELDS=(F1:1,80,F2:1,80)
  SORT FIELDS=COPY
  OUTREC FIELDS=(C'CO ',1,5,X,C'GRO(',81,6,C')',X,C'OWN(',81,6,C')')


Output -

Code:

CO A2345 GRO(DATAA1) OWN(DATAA1)
CO A2345 GRO(DATAB2) OWN(DATAB2)
CO A2345 GRO(DATAB4) OWN(DATAB4)
CO B1234 GRO(DATAA1) OWN(DATAA1)
CO B1234 GRO(DATAB2) OWN(DATAB2)
CO B1234 GRO(DATAB4) OWN(DATAB4)


Thanks,
-3nadh
Back to top
View user's profile Send private message
jaytolliver

New User


Joined: 14 Feb 2006
Posts: 2

PostPosted: Sat Sep 21, 2013 8:13 pm    Post subject: Reply to: copy one to many
Reply with quote

excellent.. thanks to all
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7312

PostPosted: Sat Sep 21, 2013 8:51 pm    Post subject: Reply to: copy one to many
Reply with quote

You only need one byte, with the same value, set in each of the JNFnCNTL files.

Can be INREC BUILD instead of OUTREC FIELDS.

FIELDS is overloaded, and exists in INREC/OUTREC/OUTFIL for backwards-compatibility.
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 IEBGENER to copy from FB to VB and re... Mike.Fulton All Other Mainframe Topics 3 Sat Aug 24, 2019 7:20 am
No new posts Copy physical Tape files to a Mainfra... Dadi Krishna Teja JCL & VSAM 11 Thu May 16, 2019 10:25 pm
No new posts How to copy\replace the members in pr... abdulrafi JCL & VSAM 6 Fri Mar 22, 2019 7:02 pm
This topic is locked: you cannot edit posts or make replies. Copy one file to possible multiple files dibyendumandal11111 SYNCSORT 9 Fri Mar 08, 2019 2:47 am
No new posts how to copy a sequential dataset by u... javen777 JCL & VSAM 3 Thu Feb 21, 2019 11:37 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us