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
 

 

add header record to pds members

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: add header record to pds members
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

Moderator Team Head


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

PostPosted: Sat Feb 06, 2010 2:52 am    Post subject: Reply to: add header record to pds members
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: 2239
Location: @my desk

PostPosted: Sat Feb 06, 2010 8:59 am    Post subject:
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    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Feb 17, 2010 3:36 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Feb 17, 2010 4:02 am    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Feb 17, 2010 4:09 am    Post subject:
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    Post subject:
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    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 Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Copying Panvalet members to PDS LOGESHWARAN K CA Products 4 Mon Mar 06, 2017 10:45 am
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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