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

add header record to pds members


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mike beckmann

New User


Joined: 21 Apr 2009
Posts: 9
Location: Cedar Rapids Iowa

PostPosted: Sat Feb 06, 2010 12:55 am
Reply with quote

I have the following file and would like to for each row take positions 1-13 and add it to the pds file in positions 15-31.
Code:

RV_AC_RG_COMP 'YA.U.T2(M000001)'
RV_ACC_RATES   'YA.U.T2(M000002)'
RV_ACC_RG       'YA.U.T2(M000003)'


For example, this code will work for row1 but i would like to create something to automatically do it no matter how many rows there are:
Code:
 
//RUNSORT3 EXEC PGM=SYNCSORT
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=YA.U.T2(M000001),DISP=SHR
//SORTOUT  DD DSN=YA.U.RV.TEST,
//         DISP=(MOD,KEEP)
//SYSIN    DD *
    OPTION COPY
    OUTREC BUILD=(1,79,8X)
    OUTFIL REMOVECC,
      HEADER1=('RV_AC_RG_COMP')
/*


Thanks,
Mike Beckmann
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Sat Feb 06, 2010 2:52 am
Reply with quote

I'm not quite sure what approach you're looking for here. But, here's a thought. Use IEBPTPCH to copy the entire PDS to a sequential dataset. Use sort to read your control file and generate a full set of sort IFTHEN statements to match the data. Then, use sort again to read the punched sequential dataset, apply the IFTHEN logic to the header "MEMBER NAME Mnnnnnn" and insert an IEBUPDTE ./ ADD NAME record followed by your header content. End the process by using the IEBUPDTE program to re-build the PDS members that now contains the header record.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Sat Feb 06, 2010 8:59 am
Reply with quote

mike beckmann,

Are you trying to attach only one header row to each of the PDS members? Or say for e.g, you want to attach the text 'RV_AC_RG_COMP' to all the rows present in M000001 ?
Back to top
View user's profile Send private message
mike beckmann

New User


Joined: 21 Apr 2009
Posts: 9
Location: Cedar Rapids Iowa

PostPosted: Sat Feb 06, 2010 9:58 am
Reply with quote

Arun Raj,

I am trying to attach one header to each of the PDS members, the header will be on the same line as the member; so in the example above,
RV_AC_RG_COMP will be the header row for the M000001 pds and
RV_ACC_RATES for M000002, RV_ACC_RG for M000003 and so on...

I could have hundreds of these to match up, I just gave three as an example. I am going to research and attempt SUPERK's suggestion but any others are welcome as well. Thank you.
Back to top
View user's profile Send private message
mike beckmann

New User


Joined: 21 Apr 2009
Posts: 9
Location: Cedar Rapids Iowa

PostPosted: Wed Feb 17, 2010 12:18 am
Reply with quote

I have attempted SUPERK's suggestion and ran into a roadblock at "apply the IFTHEN logic to the header "MEMBER NAME Mnnnnnn" "

YA.U.RV.TEST1 is the sequential dataset created from the pds and i have another file YA.U.QMFJOIN with all the IFTHEN statements. i do not know how to apply all the IFTHEN statements to the sequential dataset...

YA.U.RV.TEST1 example:

BROWSE YA.U.RV.TEST1
Command ===>
----+----1----+----2----+----3----+----4---

MEMBER NAME M000080
SELECT DISTINCT MCINET_DSNO.&RACF.GWAYIDS.*
FROM MCINET_DSNO.&RACF.GWAYIDS
WITH UR
MEMBER NAME M000081

YA.U.QMFJOIN:
********************************* Top of Data ****************************
IFTHEN=(WHEN=(9,7,CH,EQ,C'M000080'),OVERLAY=('RV_GWAY1 '))
IFTHEN=(WHEN=(9,7,CH,EQ,C'M000058'),OVERLAY=('RV_GET_IDS '))

Thanks for any help you can provide.
mbeck
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Feb 17, 2010 3:36 am
Reply with quote

Hi Mike,

Quote:
I have attempted SUPERK's suggestion and ran into a roadblock at "apply the IFTHEN logic to the header "MEMBER NAME Mnnnnnn" "



You need to do a better job at explaining the above.

Can you show the JCL and job output.


Gerry
Back to top
View user's profile Send private message
mike beckmann

New User


Joined: 21 Apr 2009
Posts: 9
Location: Cedar Rapids Iowa

PostPosted: Wed Feb 17, 2010 3:57 am
Reply with quote

Sorry i will try to explain it better - below does what i want however it only replaces one 'member' - in this case it replaces M000080 with RV_GWAY1. I have a file YA.U.QMFJOIN that has 40 different IFTHEN/WHEN/OVERLAY statements that i want to incorporate into this - is there a way to substitute this file into the INREC statement somehow?


//RUNSORT4 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YA.U.RV.TEST1,DISP=SHR
//SORTOUT DD DSN=YA.U.RV.TEST2,
// DISP=(NEW,CATLG,CATLG),
// DCB=(RECFM=FBA,LRECL=130,BLKSIZE=0),
// SPACE=(CYL,(1,1),RLSE)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(15,7,CH,EQ,C'M000080'),OVERLAY=(15:C'RV_GWAY1 '))
/*
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Feb 17, 2010 4:02 am
Reply with quote

Hello,

Possibly i am missing something, but can the entire set of SYSIN statements not simply be put into the YA.U.QMFJOIN file and then name the file in the JCL rather than DD *?

That or concatenate multiple "pieces". . .
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Feb 17, 2010 4:09 am
Reply with quote

Hi,

if I understand you correctly, this is an example of what you need
Code:
 OPTION COPY                                                           
 INREC IFTHEN=(WHEN=(15,7,CH,EQ,C'M000080'),OVERLAY=(15:C'RV_GWAY0 ')),
       IFTHEN=(WHEN=(15,7,CH,EQ,C'M000081'),OVERLAY=(15:C'RV_GWAY1 ')),
       IFTHEN=(WHEN=(15,7,CH,EQ,C'M000082'),OVERLAY=(15:C'RV_GWAY2 '))


Gerry
Back to top
View user's profile Send private message
mike beckmann

New User


Joined: 21 Apr 2009
Posts: 9
Location: Cedar Rapids Iowa

PostPosted: Wed Feb 17, 2010 6:19 am
Reply with quote

dick scherrer/superk - Thank you very much!! That is exactly what i was looking to do.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top