MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Get details from particular GDG generation only !

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Tue Jun 29, 2010 7:34 am    Post subject: Get details from particular GDG generation only ! Reply with quote

Hi,

A GDG base with limit of 20 files (LRECL=58, RECFM=FB) contains GDG generation number at 55th column in each file. Let us assume this is File-A.

Code:

----+----1----+----2----+----3----+----4----+----5----+----6
    NAPLOB7G6ZJ57T894176821MAHAKU218910...k.<...BREAKS0104


I have another set of GDG base with limit of 180 files (resides on tape - LRECL=410, RECFM=FB) that contain several entries for the key value at 5th position. Let us assume this as File-B. If I have to pull these entries from File-B depending on key value of File-A, I would go to File-B.G0104 file and given an INCLUDE COND.

Suppose, somebody asks for 'ABXZ12' to be searched in 20 files of File-A and find its corresponding entries from File-B. How to automate this process like after knowing the particular generation from File-A and use that generation number to search from File-B generation to write records to output.

Please help.

Thanks.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
jim haire
Beginner


Joined: 30 Dec 2002
Posts: 140
Topics: 40

PostPosted: Tue Jun 29, 2010 8:34 am    Post subject: Reply with quote

One way it could be done is as follows:

1. First step is a sort which finds all record containing "ABXZ12" and writes an output file containing these records. Sort these records by positions 55-58.

2. Second step reads the file written in step 1 as input and writes JCL to the internal reader using the value in 55-58 to build the GDG names. I would include logic so that if the same GDG number is encountered twice, you would only write out one record.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Tue Jun 29, 2010 10:26 am    Post subject: Reply with quote

ranga_subham,

Please answer the following questions

1. Where is the search key in File-A located? ex Where do you find 'ABXZ12' in FILE-A?

2. The GDG number in pos 55 is a 3 byte field?

3. What happens if the search key is NOT found in FILE-A?

4. Also what happens if the search key is found in more than generation? Do you need to pick all of them or only the latest?

5. Do you have authority to submit a job via INTRDR?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Wed Jun 30, 2010 2:28 pm    Post subject: Reply with quote

Hi,

Ans-1: The search key is located in 4th position in File-A. Its length is 6.
Ans-2: It is a 4 byte filed (Ex.: G9999V00 - only 9999 appears at 55th pos)
Ans-3: If the search key is not found in any of the 20 generations then search on File-B should not happen
Ans-4: It is not possible because system is written that way.
Ans-5: I tried it once and was successful.

Thanks.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Wed Jun 30, 2010 5:20 pm    Post subject: Reply with quote

ranga_subham,

1.Create a member "RSUB" in any pds with the following contents

Code:

/* REXX */                                                             
"ALLOC FI(OUTDD) DA('RSUBHAM.GDGCARD') SHR REUSE"                           
PULL ARG                                                               
QUEUE ' OPTION COPY '                                                   
QUEUE ' INCLUDE COND=(4,6,CH,EQ,C'''||ARG(1)||''''||')'                 
QUEUE ' OUTFIL ENDREC=1,'                                               
QUEUE ' BUILD=(C'''||'//COPYJOBA JOB '''||',C'||''''||''''||'''',       
                   ||''''||',C'''||'COPY JOB'''||',C''',               
                   ||''''||''''||''''||',C'''||','||''''||',/,'         
QUEUE '        C'''||'//             CLASS=A,'''||',/,'                 
QUEUE '        C'''||'//             MSGCLASS=Y,'''||',/,'             
QUEUE '        C'''||'//             MSGLEVEL=(1,1),'''||',/,'         
QUEUE '        C'''||'//             NOTIFY=RSUBHAM'''||',/,'           
QUEUE '        C'''||'//*'''||',/,'                                     
QUEUE '        C'''||'//STEP0100 EXEC PGM=SORT'''||',/,'               
QUEUE '        C'''||'//SYSOUT   DD SYSOUT=*'''||',/,'                 
QUEUE '        C'''||'//SORTIN   DD DISP=SHR,'''||','                   
QUEUE '        C'''||'DSN=RSUBHAM.FILEB.BASE.G'''||',55,4,C',           
                   ||''''||'V00'''||',/,'                               
QUEUE '        C'''||'//SORTOUT  DD SYSOUT=*'''||',/,'                 
QUEUE '        C'''||'//SYSIN    DD *'''||',/,'                         
QUEUE '        C'''||'  OPTION COPY  '''||',/,'                         
QUEUE '        C'''||'  INCLUDE COND=(5,6,CH,EQ,C'''||',C'||'''',       
                   ||''''||''''||''''||',C'''||ARG(1)||'''',           
                   ||',C'||''''||''''||''''||''''||',C'''||')'''||',/,'
QUEUE '        C'''||'//*'''||',80:X)'                                 
"EXECIO 19 DISKW OUTDD (FINIS"                                         
"FREE FI(OUTDD)"                                                       



Now create a job with the contents shown below

Code:

//GDGSRCHJ JOB 'GDG SEARCH JOB',       
//             CLASS=A,         
//             MSGCLASS=Y,       
//             MSGLEVEL=(1,1),   
//             NOTIFY=USERID     
//*                             
//GDGPROC  PROC SRCHKEY=' '                               
//STEP0100 EXEC PGM=IKJEFT01,PARM='%RSUB &SRCHKEY'         
//SYSEXEC  DD DSN=Your pds name which has rexx member RSUB,DISP=SHR
//OUTDD    DD DSN=RSUBHAM.GDGCARD,DISP=(,PASS),                 
//            SPACE=(TRK,(1,0),RLSE),                     
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920)       
//SYSTSPRT DD SYSOUT=*                                     
//SYSPRINT DD SYSOUT=*                                     
//SYSTSIN  DD DUMMY                                       
//*                                                       
//STEP0200 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=your searchable file A gdg base,DISP=SHR                 
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD DSN=RSUBHAM.GDGCARD,DISP=(OLD,DELETE,DELETE)       
//  PEND                                                   
//GO       EXEC GDGPROC,SRCHKEY='ABXZ12'                   
//*


Now look at the output from SORTOUT. It should have generated the JCL need to copy the records from the main GDG file. If the generated JCL looks good then change the following statement

Code:

//SORTOUT  DD SYSOUT=*


to
Code:

//SORTOUT  DD SYSOUT=(*,INTRDR)


You can pass the SRCHKEY anything you want as a parm via JCL
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Thu Jul 01, 2010 11:31 am    Post subject: Reply with quote

Hi,

I will give it a try and come back.

Thanks.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group