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
 

 

Remove unwanted records based on parm card

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vishal_a

New User


Joined: 24 May 2005
Posts: 45
Location: Noida

PostPosted: Wed May 06, 2009 7:14 pm    Post subject: Remove unwanted records based on parm card
Reply with quote

Hi ,

My requirement is to delete some records from an input file based on the parm card through sort.
For ex :

I am having a input card wherein there are records pertaining to master id's

such as :

97515384
97514564
98763524

This list could be any number and dynamically built.

The requirement is to remove the records pertaining to above mentioned master ids from an input file .

I had seen earlier post wherein Frank has posted a sort for such type of requirment but there it was limited to one input rec . The following is the Sort

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file1 (one record with parameter)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
* Create DFSORT Symbol as:
* TARG,+nnn
  OUTREC BUILD=(C'TARG,+',1,3,80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file2
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
* Use TARG symbol in INCLUDE condition.
  INCLUDE COND=(1,3,ZD,GT,TARG)
/*


Frank: Can it be modified for my requirement , if yes then how .
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed May 06, 2009 8:45 pm    Post subject:
Reply with quote

If your first step generated the INCLUDE and ORs for each record in your input you should be able to do it.
Header for the "INCLUDE COND=(" and TRAILER for the closing ")" and output detail of "1,3,ZD,EQ,nnnnn,OR," for each input....
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed May 06, 2009 8:59 pm    Post subject:
Reply with quote

Vishal_a,

The idea of generating the Include conditions wouldn't be an ideal solution in this case as the no: of records may vary.

There are couple of ways to get the desired results. In order to help you with the optimal solution, I need the following details.

1. What is the LRECL and RECFM of the parm dataset and the input file
2. What is the postion and format of the master ids in both files.
3. Can the input file can have duplicates?
Back to top
View user's profile Send private message
vishal_a

New User


Joined: 24 May 2005
Posts: 45
Location: Noida

PostPosted: Thu May 07, 2009 7:31 pm    Post subject:
Reply with quote

Vishal_a,

The idea of generating the Include conditions wouldn't be an ideal solution in this case as the no: of records may vary.

There are couple of ways to get the desired results. In order to help you with the optimal solution, I need the following details.
Skolusu wrote:

1. What is the LRECL and RECFM of the parm dataset and the input file
2. What is the postion and format of the master ids in both files.
3. Can the input file can have duplicates?



Skolusu
1. The Lrecl of the parm dataset is 80 byte and recfm of FB dsorg=PS
2. Position of Master id in parm dataset is starting from 1st byte upto 8 byte long and in the input file is starting from 12 th byte upto 8 byte long and ZD format.
3. Chances are very low that there will be duplicates but still we can incoporate the functionlaity.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu May 07, 2009 9:40 pm    Post subject: Reply to: Remove unwanted records based on parm card
Reply with quote

Vishal_a,

You did not tell me what is the LRECL and RECFM of the input file. I assumed it to be FB recfm and 80 bytes in length. The following DFSORT/ICETOOL JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=ICETOOL                                         
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//PARM     DD *                                                     
97515384                                                             
97514564                                                             
98763524                                                             
//INPT     DD *                                                     
           11111111                                                 
           22222222                                                 
           33333333                                                 
           97515384                                                 
           97515384                                                 
           97514564                                                 
           98763524                                                 
           99999999                                                 
//TEMP     DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)       
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                                     
  COPY FROM(PARM) USING(CTL1)                                       
  COPY FROM(INPT) USING(CTL2)                                       
  SORT FROM(TEMP) USING(CTL3)                                       
//CTL1CNTL DD *                                                     
  OUTFIL FNAMES=TEMP,BUILD=(12:1,8,81:C'1')                         
//CTL2CNTL DD *                                                     
  OUTFIL FNAMES=TEMP,OVERLAY=(81:X)                                 
//CTL3CNTL DD *                                                     
  SORT FIELDS=(12,8,CH,A),EQUALS                                     
  OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(81,1,ZD,EQ,1),PUSH=(81:81,1,12,8))
  OUTFIL FNAMES=OUT,BUILD=(1,80),                                   
  OMIT=(81,1,ZD,EQ,1,AND,82,8,CH,EQ,12,8,CH)                         
/*
Back to top
View user's profile Send private message
vishal_a

New User


Joined: 24 May 2005
Posts: 45
Location: Noida

PostPosted: Fri May 08, 2009 10:52 am    Post subject: Reply to: Remove unwanted records based on parm card
Reply with quote

Thanks a ton Skolusu for your precious time and effort for my problem.

The input file is FB format and 105 bytes in length.

Can you modify it as per this requirement and if dont mind can explain this Sort a little bit this would help in increasing my knowledge about the versatility of the Sort.

Thanks
Back to top
View user's profile Send private message
vishal_a

New User


Joined: 24 May 2005
Posts: 45
Location: Noida

PostPosted: Fri May 08, 2009 12:05 pm    Post subject: Reply to: Remove unwanted records based on parm card
Reply with quote

Skolusu ,

I tried using your sort provided, but i am facing a return code of 16 for CTL3 from DFSORT.

I believe the issue is with the PTF UK90013 where in WHEN=GROUP and PUSH was introduced and at our shop this might not be present.

We are having a DFSORT version Z/OS DFSORT V1R5 .

The following is the message recieved
Code:

 ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES A
 ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 02:22 ON FRI MA
0           SORT FIELDS=(12,8,CH,A),EQUALS                                     
            OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(106,1,ZD,EQ,1),PUSH=(106:106,1,12,8
                                $                                               
 ICE007A 0 SYNTAX ERROR                                                         
            OUTFIL FNAMES=OUT,BUILD=(1,105),                                   
            OMIT=(106,1,ZD,EQ,1,AND,107,8,CH,EQ,12,8,CH)                       
 ICE146I 0 END OF STATEMENTS FROM CTL3CNTL - PARAMETER LIST STATEMENTS FOLLOW   
           DEBUG NOABEND,ESTAE                                                 
           OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL3,SORTIN=TEMP
                          YNALLOC                                               
 ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E7-K24705                   
 ICE052I 3 END OF DFSORT                                                       


Could you please modify it to the version we can support.
Back to top
View user's profile Send private message
vishal_a

New User


Joined: 24 May 2005
Posts: 45
Location: Noida

PostPosted: Fri May 08, 2009 12:10 pm    Post subject: Reply to: Remove unwanted records based on parm card
Reply with quote

Skolusu ,

This is the message ICE201I E RECORD TYPE ......

That means we have the PTF UK90017 so could you please modify as per the PTF we have.

Your help is appreciable . Thanks in advance
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri May 08, 2009 9:10 pm    Post subject:
Reply with quote

vishal_a,

Looks like you don't have the PTF installed which supports the WHEN=Group function. Here is an alternative way of getting the desired results.

The first copy takes the 80 parm file and create a 106 byte file while moving the key to pos 12 and we add an indicator 'y' at pos 106.

The second copy takes the 105 input file and pad a space a pos 106.

Since I used disp=mod, the contents of both files will be appended together and using splice we will push the indicator 'y' to all the matching records in file 2. And using a OMIT condition we remove these records and using a build we remove the indicator we created at pos 106.


Code:


//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*     
//DFSMSG   DD SYSOUT=*     
//PARM     DD DSN=your 80 byte parm file,
//            DISP=SHR
//INPT     DD DSN=your 105 byte Input file,
//            DISP=SHR
//TEMP     DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(X,Y),RLSE)
//OUT      DD SYSOUT=*                                       
//TOOLIN   DD *                                             
  COPY FROM(PARM) USING(CTL1)                               
  COPY FROM(INPT) USING(CTL2)                               
  SPLICE FROM(TEMP) ON(12,8,CH) TO(OUT) WITH(1,105) -       
  WITHALL KEEPBASE KEEPNODUPS USING(CTL3)                   
//CTL1CNTL DD *                                             
  OUTFIL FNAMES=TEMP,BUILD=(12:1,8,106:C'Y')                 
//CTL2CNTL DD *                                             
  OUTFIL FNAMES=TEMP,OVERLAY=(106:X)                         
//CTL3CNTL DD *                                             
  OUTFIL FNAMES=OUT,BUILD=(1,105),OMIT=(106,1,CH,EQ,C'Y')   
/*
Back to top
View user's profile Send private message
vishal_a

New User


Joined: 24 May 2005
Posts: 45
Location: Noida

PostPosted: Mon May 11, 2009 11:55 am    Post subject: Reply to: Remove unwanted records based on parm card
Reply with quote

Thank you very much Skolusu .... for your efforts and time.

The solution is working fine and fulfilling my requirements.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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