IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Help icetool - modify OUTFIL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 577
Location: USA

PostPosted: Tue Jul 27, 2010 7:21 pm
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
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: 577
Location: USA

PostPosted: Tue Jul 27, 2010 9:01 pm
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
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
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: 577
Location: USA

PostPosted: Wed Jul 28, 2010 12:38 am
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
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: 577
Location: USA

PostPosted: Wed Jul 28, 2010 1:21 am
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 Developer


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

PostPosted: Wed Jul 28, 2010 1:39 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
Search our Forums:

Back to Top