Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Repeat data of file 1 with file 2 data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Mar 31, 2009 11:46 am    Post subject: Repeat data of file 1 with file 2 data
Reply with quote

Hello All,

I want to generate acl for retrieveing 500 elements
file1 :
RETRIEVE ELEMENT 'aaaaaaaa'
FROM ENVIRONMENT 'HOMEI'
SYSTEM 'HOME'
SUBSYSTEM 'AT'
TYPE 'CPYCOB'
STAGE 'I'
TO DSNAME 'A40661.£MENDV.SRC'
MEMBER 'aaaaaaaa'

File2:
KBOLME07
KBOLM022

I want outfile as
RETRIEVE ELEMENT 'KBOLME07'
FROM ENVIRONMENT 'HOMEI'
SYSTEM 'HOME'
SUBSYSTEM 'AT'
TYPE 'CPYCOB'
STAGE 'I'
TO DSNAME 'A40661.£MENDV.SRC'
MEMBER 'KBOLME07'
RETRIEVE ELEMENT 'KBOLM022'
FROM ENVIRONMENT 'HOMEI'
SYSTEM 'HOME'
SUBSYSTEM 'AT'
TYPE 'CPYCOB'
STAGE 'I'
TO DSNAME 'A40661.£MENDV.SRC'
MEMBER 'KBOLM022'
Please provide me the sort card to acheive this
Back to top
View user's profile Send private message

Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 992
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Mar 31, 2009 1:17 pm    Post subject:
Reply with quote

Why use sort for this?

This looks more like something you'd achieve with recursive edit macro.

First, clear workspace, fetch and append member & edit for first entry in file 2, then repeat the fetch/append/edit until all entries in file 2 are done.

Garry.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Mar 31, 2009 1:53 pm    Post subject:
Reply with quote

Garry,

I need to repeat it for thousands of element so want some quick way rather than manually doing it
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 992
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Mar 31, 2009 2:18 pm    Post subject:
Reply with quote

I'm not suggesting doing it manually. I'd write a REXX/ISPF program to loop through file 2 reading in, from dataset,

Code:
RETRIEVE ELEMENT 'aaaaaaaa'
FROM ENVIRONMENT 'HOMEI'
SYSTEM 'HOME'
SUBSYSTEM 'AT'
TYPE 'CPYCOB'
STAGE 'I'
TO DSNAME 'A40661.£MENDV.SRC'
MEMBER 'aaaaaaaa'


Write this to a work dataset and invoke an edit macro which will

Code:
 CHANGE ALL 'aaaaaaaa' parm


Now, for each remaining item in file 2, append
Code:
RETRIEVE ELEMENT 'aaaaaaaa'
FROM ENVIRONMENT 'HOMEI'
SYSTEM 'HOME'
SUBSYSTEM 'AT'
TYPE 'CPYCOB'
STAGE 'I'
TO DSNAME 'A40661.£MENDV.SRC'
MEMBER 'aaaaaaaa'


The EDIT MACRO will leave any existing changes in the work dataset as they are and just update the one just appended. At the end you have control cards for all the items in file2, regardless of how many.

Garry.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Mar 31, 2009 2:51 pm    Post subject:
Reply with quote

Hello Garry,

I am new to rexx tahts why request for sort card
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2239
Location: @my desk

PostPosted: Tue Mar 31, 2009 4:02 pm    Post subject:
Reply with quote

Ekta,

You can use a DFSORT job like this:
Code:

//STEP01   EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD DSN= your.input.file2                                   
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                     
  OPTION COPY                                     
  OUTFIL BUILD=(C'RETRIEVE ELEMENT ''',1,8,C'''',/,
  C'FROM ENVIRONMENT ''HOMEI''',/,                 
  C'SYSTEM ''HOME''',/,                           
  C'SUBSYSTEM ''AT''',/,                           
  C'TYPE ''CPYCOB''',/,                           
  C'STAGE ''I''',/,                               
  C'TO DSNAME ''A40661.£MENDV.SRC''',/,           
  C'MEMBER ''',1,8,C'''')                         
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us