Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums 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: 7315

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: 7315

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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts XMITIP sends it out. Can it copy on l... Rommel Dayon Rustia IBM Tools 0 Tue Sep 05, 2017 10:16 am
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 7 Thu Apr 27, 2017 1:15 am
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am

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