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
 

 

Help icetool - modify OUTFIL

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

New User


Joined: 14 Sep 2009
Posts: 60
Location: Milan

PostPosted: Tue Jul 27, 2010 1:51 pm    Post subject: Help icetool - modify OUTFIL
Reply with quote

hi everyone.
i have this sort:
Code:

STEP0100 EXEC PGM=SORT                       
SYSOUT   DD  SYSOUT=*                         
SORTIN   DD *                                 
SORTOUT  DD  DISP=(NEW,PASS),                 
             SPACE=(TRK,(1,0,),RLSE,,),       
 DSN=&&HEADR                                 
SYSIN    DD *                                 
SORT FIELDS=COPY                             
OUTFIL REMOVECC,BUILD=(290X),HEADER1=(3C'$') 
*                                             
STEP0200 EXEC PGM=SORT                       
SYSOUT   DD  SYSOUT=*                         
SORTIN   DD  DISP=SHR,                       
             VOL=(,,,,REF=*.STEP0100.SORTOUT),
 DSN=&&HEADR                                 
         DD DISP=SHR,                         
 DSN=FILEINP1                       
         DD DISP=SHR,                         
             VOL=(,,,,REF=*.STEP0100.SORTOUT),
 DSN=&&HEADR                                 
         DD DISP=SHR,                                             
 DSN=FILEINP2                                         
ONLYF1   DD  DISP=(NEW,CATLG),                                   
             UNIT=(SYSDA,,),                                     
             SPACE=(CYL,(100,500,),,,),                           
             DCB=(LRECL=290,RECFM=FB,DSORG=PS),                   
 DSN=FILEOUT1                             
OTHER    DD  DISP=(NEW,CATLG),                                   
             UNIT=(SYSDA,,),                                     
             SPACE=(CYL,(100,500,),,,),                           
             DCB=(LRECL=290,RECFM=FB,DSORG=PS),                   
 DSN=FILEOUT2
SYSIN    DD *                                                     
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'$$$'),PUSH=(291:ID=1))
SORT FIELDS=(14,08,PD,A,                                         
             38,10,CH,A,                                         
             48,08,CH,A,                                         
             59,10,CH,A),EQUALS                                   
SUM FIELDS=(291,1,ZD)                                             
                                                                 
OUTFIL FNAMES=ONLYF1,BUILD=(1,290),                                   
INCLUDE=(291,1,ZD,EQ,1,AND,59,10,CH,LT,C'2010-03-31')                 
                                                                     
OUTFIL FNAMES=OTHER,BUILD=(1,290),                                   
INCLUDE=(291,1,ZD,GT,2,OR,59,10,CH,GT,C'2010-03-31',                 X
AND,1,3,CH,NE,C'$$$')                                                 


how can I change that sort, so write the file ONLYF1 with everything except what is in OTHER. without writing the conditions:
Code:
INCLUDE=(291,1,ZD,EQ,1,AND,59,10,CH,LT,C'2010-03-31')


i hope it is clear.

thank you
Back to top
View user's profile Send private message

sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Tue Jul 27, 2010 7:21 pm    Post subject:
Reply with quote

Quote:
how can I change that sort, so write the file ONLYF1 with everything except what is in OTHER. without writing the conditions:

Change your OUTFIL for ONLYF1 as below.

Code:

  OUTFIL FNAMES=ONLYF1,BUILD=(1,290),SAVE                                   
 

SAVE selects the records that are not selected for any other OUTFIL group.

Also,please note in your earlier conditions, your 2 OUTFIL were looking for
INCLUDE=(291,1,ZD,EQ,1,.....
and
INCLUDE=(291,1,ZD,GT,2.....

You are likely to miss records where 291 position value is equal to 2. Don't know if that's an issue or not but just wanted to bring this point to your attention.

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

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Tue Jul 27, 2010 8:19 pm    Post subject:
Reply with quote

hi ,

just wanted to know about the header ($$$)
wont that come into ONLYF1 too. the header of 2nd and 3rd file.

didnt test it .... but i had this i my mind when he had posted this querry
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Tue Jul 27, 2010 9:01 pm    Post subject:
Reply with quote

smijoss,

OP Said
Quote:

write the file ONLYF1 with everything except what is in OTHER


Yes, the headers will fall into ONLYF1. That is everything except what is in OTHER file.

I think OP here was trying to debug his process to find out dropped records and that's what I have pointed out in my earlier post about his include conditions. He also said without any INCLUDE Condition. But if he needs to drop the header records then he will have to change his cards.

Quote:
without writing the conditions:
Code:
INCLUDE=(291,1,ZD,EQ,1,AND,59,10,CH,LT,C'2010-03-31')


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

Senior Member


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

PostPosted: Tue Jul 27, 2010 11:56 pm    Post subject: Re: Help icetool - modify OUTFIL
Reply with quote

theone1987 wrote:
how can I change that sort, so write the file ONLYF1 with everything except what is in OTHER. without writing the conditions:
Code:
INCLUDE=(291,1,ZD,EQ,1,AND,59,10,CH,LT,C'2010-03-31')


i hope it is clear.

thank you


Isn't it as sample as this? Cant you just change the INCLUDE to be
Code:
INCLUDE=(291,1,ZD,EQ,1)
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Jul 28, 2010 12:02 am    Post subject:
Reply with quote

smijoss wrote:
hi ,
just wanted to know about the header ($$$)
wont that come into ONLYF1 too. the header of 2nd and 3rd file.


didnt test it .... but i had this i my mind when he had posted this querry


smijoss,

Not really. If you look at the sort card, we are summing on the indicator field at pos 291. So both the header records will be summed together and the total would be a 3 in pos 291 for the header record. The ONLYF1 output file is checking if the indicator value is 1 and hence the header records will NOT be included in the file.


sqlcode1 wrote:


Yes, the headers will fall into ONLYF1. That is everything except what is in OTHER file.


sqlcode1,

See explanation above.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Wed Jul 28, 2010 12:38 am    Post subject:
Reply with quote

Kolusu,
Thanks for the explanation. I missed the part that while summing indicator we are summing header records as well.

Quote:
Isn't it as sample as this? Cant you just change the INCLUDE to be
Code:
INCLUDE=(291,1,ZD,EQ,1)


My 2 cents for this and I could be wrong again, but by doing this, he would miss records where indicator value is equal to 2.
His OTHER file has records where indicator value is greater than 2(3 or above).

My first impression of this question was that it could be a debug process where OP was trying to find missing records using SAVE.

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

Senior Member


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

PostPosted: Wed Jul 28, 2010 12:56 am    Post subject:
Reply with quote

sqlcode1 wrote:
My 2 cents for this and I could be wrong again, but by doing this, he would miss records where indicator value is equal to 2.
His OTHER file has records where indicator value is greater than 2(3 or above).

My first impression of this question was that it could be a debug process where OP was trying to find missing records using SAVE.

Thanks,


oh well OP needs to clarify. I assumed it is a simple file match and OP wants to find out the records which did NOT have a match in the other file. if there are unmatched records from file 2 which OP wants to keep , then he better change the naming conventions of the output file name to something else other than ONLYF1.

If OP wants both unmatched records from file 1 and file 2 then he can use the following control cards and I would retain the indicator at the end so that he can identify the records from which file they came from.

Code:

OUTFIL FNAMES=UNMATCH,INCLUDE=(291,1,ZD,LE,2)
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Wed Jul 28, 2010 1:21 am    Post subject:
Reply with quote

Frank/Kolusu,
I have a question based on the simiar discussion.

Is it possible to use PUSH command with RESTART like SEQNUM? For example, If my input is as shown below and when I am trying to populated field-1 at the end of the record, I would use OVERLAY SEQNUM followed by WHEN=GROUP or in some cases would use temp. file $$$ or HDR.


Code:

Field-1             Field-2
AAAAAA              Y
AAAAAA              Y
BBBBBB              N
CCCCC               Y


Is it possible to do it in a single statement as
Code:
INREC PUSH=((81:1,8),RESTART=(1,8))

Please pardon my syntax creation.

Moderators,I am not sure if I should have opened another thread for this question but if you think I should have, please split the topic.

Thanks,
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Jul 28, 2010 1:39 am    Post subject:
Reply with quote

Quote:
Is it possible to do it in a single statement as Code:
INREC PUSH=((81:1,8),RESTART=(1,8))


No.
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Wed Jul 28, 2010 7:35 am    Post subject:
Reply with quote

Hi sqlcode1 / Skolusu,

I missed the SUM part. thanks for explaing.
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 How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Icetool or Joinkeys example to compar... ishant chauhan DFSORT/ICETOOL 21 Sat Aug 20, 2016 2:40 am
No new posts ICETOOL higher option Anshul Das DFSORT/ICETOOL 14 Thu Apr 14, 2016 8:00 am
No new posts Compare Files and extract matching re... vimalravi83 DFSORT/ICETOOL 3 Wed Jan 06, 2016 2:42 pm


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