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 

typical one - extract other based on one.

 
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: Thu Jul 17, 2008 9:55 am    Post subject: typical one - extract other based on one. Reply with quote

Hi,

We get huge content in the form of a GDG on daily basis. It's got the below shown type records in it.

Code:

01
02
07
08
11
11
19
99


The customer requests us to extract data based on below conditions.

The 02 type record has a number '111111' in position 55. We need to extract all 8 type records into an output file if the 6 digit number is found in position 55 on type 02 record.

Would you please suggest any File-Aid / Syncsort or any other solution to automize this?

Thank a lot in advance.

Regards.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Fri Sep 12, 2008 9:55 pm    Post subject: Reply with quote

Looks like there is no relation between 02 and 08 record and you want all 08 records if some 02 record has 111111 at position 55.

I would write a jcl with three steps -

step1 - create empty output file

step2 - set a return code 4 based on 111111 at 55 for 02 record. this can be done by cobol, rexx etc

if step2.rc = 4 then

step3 - copy all 08 records

end if
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Sat Sep 13, 2008 12:37 pm    Post subject: Reply with quote

ranga_subham,

You can use DFSORT's new WHEN=GROUP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this to get the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                                         
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD *
01
02                                     111111
07
08
11
11
19
99
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                   
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'02',AND,55,6,CH,EQ,C'111111'),
        PUSH(81:1,2))
  SORT FIELDS=COPY                                                 
  OUTFIL INCLUDE=(1,2,CH,EQ,C'08',AND,81,2,CH,EQ,C'02'),         
  BUILD=(01,80)                                                   
/* 




For complete details on the new WHEN=GROUP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/

Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Sat Sep 13, 2008 8:17 pm    Post subject: Reply with quote

So, if the input is

Code:

01
02                                     111111
07
08  Ranga
08  Kolusu
11
11
19
99
01
02                                     000000
07
08  Diba

Then output will be

Code:

08  Ranga
08  Kolusu


I initially thought the request was for

Code:
08  Ranga
08  Kolusu
08  Diba


But first one makes more sense
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Sat Sep 13, 2008 10:34 pm    Post subject: Reply with quote

Dibakar,

If you wanted all the 08 records then you can use the following control cards

Code:

//SYSIN    DD *                                                   
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'02',AND,55,6,CH,EQ,C'111111'),
        PUSH(81:ID=1))
  SORT FIELDS=COPY                                                 
  OUTFIL INCLUDE=(1,2,CH,EQ,C'08',AND,81,1,ZD,GT,0),         
  BUILD=(01,80)                                                   
/* 


Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Sun Sep 14, 2008 6:38 am    Post subject: Thanks Reply with quote

Thanks Kolusu. I will try it out.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Mon Sep 15, 2008 7:34 am    Post subject: Thanks to Kolusu. Reply with quote

Kolusu, I have been trying to achieve the same using the File-Aid but could not succeed. Another friend of mine will be giving a EZYTRIEVE solution to the same. I will post it here as soon as I get.

I could not use your solution because we use Syncsort. Embarassed
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