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

Repeat data of file 1 with file 2 data


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
guptae

Moderator


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

PostPosted: Tue Mar 31, 2009 11:46 am
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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Tue Mar 31, 2009 1:17 pm
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: 1208
Location: Bangalore,India

PostPosted: Tue Mar 31, 2009 1:53 pm
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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Tue Mar 31, 2009 2:18 pm
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: 1208
Location: Bangalore,India

PostPosted: Tue Mar 31, 2009 2:51 pm
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: 2481
Location: @my desk

PostPosted: Tue Mar 31, 2009 4:02 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Binary File format getting change whi... All Other Mainframe Topics 5
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
Search our Forums:

Back to Top