IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

copy one to many


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Sep 21, 2013 1:25 pm
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
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
Reply with quote

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Sep 21, 2013 8:51 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts DB2 Table - Image copy unload IBM Tools 2
No new posts How to copy the -1 version of a membe... TSO/ISPF 4
Search our Forums:

Back to Top