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: 995
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: 995
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: 2284
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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm


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