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
 

 

OUTFIL and SAVE

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

New User


Joined: 31 Dec 2012
Posts: 31
Location: England

PostPosted: Thu May 30, 2013 12:33 am    Post subject: OUTFIL and SAVE
Reply with quote

I POST THIS BECAUSE I KNOW DFSORT DEVELOPERS MONITOR THIS FORUM.

I think I know how SAVE works - it sweeps up everything all the other OUTFIL statements discard, and is coded in a separate OUTFIL statement. But, it seems to me, that the step of incorporating SAVE into another OUTFIL INCLUDE/OMIT would be beneficial and, surely, not that hard, since DFSORT already does the same with a single OUTFIL INCLUDE/OMIT accompanied by an OUTFIL SAVE. So, I'm advocating multiple OUTFIL INCLUDE/OMIT with their own SAVEs. There is a problem in identifying the multiple SAVE datasets but surely that's a small problem.
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu May 30, 2013 12:47 am    Post subject:
Reply with quote

So the point is?
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 30, 2013 1:32 am    Post subject: Re: OUTFIL and SAVE
Reply with quote

Jim Alton wrote:
I POST THIS BECAUSE I KNOW DFSORT DEVELOPERS MONITOR THIS FORUM.

I think I know how SAVE works - it sweeps up everything all the other OUTFIL statements discard, and is coded in a separate OUTFIL statement. But, it seems to me, that the step of incorporating SAVE into another OUTFIL INCLUDE/OMIT would be beneficial and, surely, not that hard, since DFSORT already does the same with a single OUTFIL INCLUDE/OMIT accompanied by an OUTFIL SAVE. So, I'm advocating multiple OUTFIL INCLUDE/OMIT with their own SAVEs. There is a problem in identifying the multiple SAVE datasets but surely that's a small problem.


Jim Alton,

You need to explain with examples.

Do you mean something like this ?

SORTIN Has
Code:

A                                                 
B                                                 
C                                                 
D                                                 
E                                                 
F                                                 

and you want something like this

Code:

  OPTION COPY                                     
  OUTFIL FNAMES=OUT01,INCLUDE=(1,1,CH,EQ,C'A')   
  OUTFIL FNAMES=OUT01S,SAVE                       
  OUTFIL FNAMES=OUT02,INCLUDE=(1,1,CH,EQ,C'B')   
  OUTFIL FNAMES=OUT02S,SAVE                       


OUT01 will have A
OUT01S SHOULD have B, C, D, E, F
OUT02 will have B
OUT02S SHOULD have A, C, D, E, F

Is that what you want ?

If that is indeed what you want you can simply code the opposite condition on your SAVE datasets. something like this
Code:

//SYSIN    DD *                               
  OPTION COPY                                 
  OUTFIL FNAMES=OUT01,INCLUDE=(1,1,CH,EQ,C'A')
  OUTFIL FNAMES=OUT01S,OMIT=(1,1,CH,EQ,C'A')   
  OUTFIL FNAMES=OUT02,INCLUDE=(1,1,CH,EQ,C'B')
  OUTFIL FNAMES=OUT02S,OMIT=(1,1,CH,EQ,C'B')   
//*
Back to top
View user's profile Send private message
Jim Alton

New User


Joined: 31 Dec 2012
Posts: 31
Location: England

PostPosted: Thu May 30, 2013 8:33 am    Post subject: Reply to: OUTFIL and SAVE
Reply with quote

Skolusu,

Your example is what I'm getting at, though the example code, of course, wouldn't give the example output.
The third image, the actual working code, would satisfy the simple example, but the method wouldn't satisfy more complex examples.
I was thinking of the SAVE being integrated in to the OUTFIL INCLUDE/OMIT statement since working out the obverse of an OUTFIL that includes STARTREC, ENDREC, etc., might be difficult to impossible.
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 30, 2013 11:08 pm    Post subject: Re: Reply to: OUTFIL and SAVE
Reply with quote

Jim Alton wrote:
Skolusu,

Your example is what I'm getting at, though the example code, of course, wouldn't give the example output.
The third image, the actual working code, would satisfy the simple example, but the method wouldn't satisfy more complex examples.
I was thinking of the SAVE being integrated in to the OUTFIL INCLUDE/OMIT statement since working out the obverse of an OUTFIL that includes STARTREC, ENDREC, etc., might be difficult to impossible.


I am not sure if you have read the documentation of SAVE. SAVE indeed takes into account the STARTREC and ENDREC parms.

Quote:

SAVE Specifies that OUTFIL input records not included by STARTREC, ENDREC, ACCEPT , SAMPLE, INCLUDE or OMIT for any other OUTFIL group are to be included in the data sets for this OUTFIL group. SAVE operates in a global fashion over all of the other OUTFIL statements for which SAVE is not specified, enabling you to keep any OUTFIL input records that would not be kept otherwise. SAVE will include the same records for each group for which it is specified.
Back to top
View user's profile Send private message
Jim Alton

New User


Joined: 31 Dec 2012
Posts: 31
Location: England

PostPosted: Fri May 31, 2013 12:23 am    Post subject: Reply to: OUTFIL and SAVE
Reply with quote

Dear Skolusu,

It is possible that I'm misunderstanding the operation of the SAVE, but the Technical Writers sometimes have a difficult job in expressing clearly the precise operation of these things.
The way I understand the operation of the SAVE is that it takes all records discarded by the other OUTFILs, and it need only be coded once within the SYSIN since its input in entirely determined by the other OUTFILs. However, it's not clear whether a record rejected by one OUTFIL statement but accepted by another, will appear in the SAVE dataset. For instance, if you had a data set of 100 records and had:
Code:
OPTION COPY                                     
  OUTFIL FNAMES=OUT01,STARTREC=30,ENDREC=70 
  OUTFIL FNAMES=OUT02,STARTREC=20,ENDREC=80
  OUTFIL FNAMES=OUT03,SAVE                       

then what would the SAVE receive? Would it just receive the first and last 19 records? Then make it more complicated by inserting INCLUE/OMIT statements - what would then appear in the SAVE dataset?
Getting back to the issue of saving the rejects from individual OUTFILs, and referring to the same example, how would you get the records rejected from OUT01 in one dataset and the records rejected from OUT02 in another dataset?
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 31, 2013 2:33 am    Post subject: Re: Reply to: OUTFIL and SAVE
Reply with quote

Jim Alton wrote:
Dear Skolusu,

It is possible that I'm misunderstanding the operation of the SAVE, but the Technical Writers sometimes have a difficult job in expressing clearly the precise operation of these things.


Well Frank Yaeger was the technical writer in this case and he is the one who coded most of the stuff and IMHO the documentation does explain it in detail.

Jim Alton wrote:

The way I understand the operation of the SAVE is that it takes all records discarded by the other OUTFILs, and it need only be coded once within the SYSIN since its input in entirely determined by the other OUTFILs. However, it's not clear whether a record rejected by one OUTFIL statement but accepted by another, will appear in the SAVE dataset. For instance, if you had a data set of 100 records and had:
Code:
OPTION COPY                                     
  OUTFIL FNAMES=OUT01,STARTREC=30,ENDREC=70 
  OUTFIL FNAMES=OUT02,STARTREC=20,ENDREC=80
  OUTFIL FNAMES=OUT03,SAVE                       

then what would the SAVE receive? Would it just receive the first and last 19 records?


OUT03 would indeed receive the first and last 19 records. Run this sample and see it for your self

Step0050 creates a 8 byte file with just seqnum for 100 records.

Code:

//STEP0050 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                           
DUMMY RECORD                                             
//SORTOUT  DD DSN=&&IN,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//SYSIN    DD *                                           
  OPTION COPY                                             
  OUTFIL REPEAT=100,BUILD=(SEQNUM,8,ZD)                   
//*                                                       
//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DISP=SHR,DSN=&&IN                           
//OUT01    DD SYSOUT=*                                   
//OUT02    DD SYSOUT=*                                   
//OUT03    DD SYSOUT=*                                   
//SYSIN    DD *                                           
  OPTION COPY                                             
  OUTFIL FNAMES=OUT01,STARTREC=30,ENDREC=70               
  OUTFIL FNAMES=OUT02,STARTREC=20,ENDREC=80               
  OUTFIL FNAMES=OUT03,SAVE                               
//*


Jim Alton wrote:

Then make it more complicated by inserting INCLUE/OMIT statements - what would then appear in the SAVE dataset?


Play around with the sample job above and see the results.

Jim Alton wrote:

Getting back to the issue of saving the rejects from individual OUTFILs, and referring to the same example, how would you get the records rejected from OUT01 in one dataset and the records rejected from OUT02 in another dataset?


Try these control cards
Code:

//SYSIN    DD *                                                     
  OPTION COPY                                                       
  OUTREC OVERLAY=(10:SEQNUM,3,ZD)                                   
                                                                   
  OUTFIL FNAMES=OUT01,STARTREC=30,ENDREC=70                         
  OUTFIL FNAMES=OUT01S,INCLUDE=(10,3,ZD,LT,30,OR,10,3,ZD,GT,70)     
  OUTFIL FNAMES=OUT02,STARTREC=20,ENDREC=80                         
  OUTFIL FNAMES=OUT02S,INCLUDE=(10,3,ZD,LT,20,OR,10,3,ZD,GT,80)     
  OUTFIL FNAMES=OUT03,SAVE                                         
//*


With the above control cards, OUT03 which is a SAVE dataset will NOT have any records, as every record in the file is accounted for in one of the OUTFIL dataset.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri May 31, 2013 5:22 am    Post subject:
Reply with quote

Hi,

small correction, I believe
Quote:
OUT03 would indeed receive the first and last 19 records. Run this sample and see it for your self



shoud be
Quote:
OUT03 would indeed receive the first 19 and last 20 records. Run this sample and see it for your self




Gerry
Back to top
View user's profile Send private message
Jim Alton

New User


Joined: 31 Dec 2012
Posts: 31
Location: England

PostPosted: Fri May 31, 2013 5:46 am    Post subject: Reply to: OUTFIL and SAVE
Reply with quote

Dear Skolusu,

Thanks for confirming that a record rejected by one OUTFIL statement but accepted by another does not get included in the SAVE dataset.
Regarding your solution to the question I posed about the example:

Code:

//SYSIN    DD *                                                     
  OPTION COPY                                                       
  OUTREC OVERLAY=(10:SEQNUM,3,ZD)                                   
                                                                   
  OUTFIL FNAMES=OUT01,STARTREC=30,ENDREC=70                         
  OUTFIL FNAMES=OUT01S,INCLUDE=(10,3,ZD,LT,30,OR,10,3,ZD,GT,70)     
  OUTFIL FNAMES=OUT02,STARTREC=20,ENDREC=80                         
  OUTFIL FNAMES=OUT02S,INCLUDE=(10,3,ZD,LT,20,OR,10,3,ZD,GT,80)     
  OUTFIL FNAMES=OUT03,SAVE                                         
//*

you have had to alter the records by inserting a sequence of numbers in order that you can pick out the rejected records, but, in general, you would not want to do that. Of course, in general, you don't want to alter any of the records for the purpose of selection and rejection. The way that SAVE works currently is without artificially altering the record contents, and if SAVE were integrated into individual OUTFILs then you wouldn't need to think of altering or augmenting the records for selection purposes.
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 31, 2013 10:47 pm    Post subject:
Reply with quote

gcicchet wrote:
Hi,

small correction, I believe
Quote:
OUT03 would indeed receive the first and last 19 records. Run this sample and see it for your self



shoud be
Quote:
OUT03 would indeed receive the first 19 and last 20 records. Run this sample and see it for your self




Gerry



Apologies. Thanks for the correction Gerry.
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 31, 2013 10:50 pm    Post subject: Re: Reply to: OUTFIL and SAVE
Reply with quote

Jim Alton wrote:
The way that SAVE works currently is without artificially altering the record contents, and if SAVE were integrated into individual OUTFILs then you wouldn't need to think of altering or augmenting the records for selection purposes.


Jim Alton,

I will add your suggestion to the list of candidates for future enhancements to DFSORT, but it's a long list, and all of the items have to be prioritized against each other. Suggestions are always welcome, but I can't discuss specifics or make any promises.
Back to top
View user's profile Send private message
Jim Alton

New User


Joined: 31 Dec 2012
Posts: 31
Location: England

PostPosted: Mon Jun 03, 2013 12:23 am    Post subject: Reply to: OUTFIL and SAVE
Reply with quote

Thanks for the attention, Skolusu, and for the implied judgement that it's an idea worth further consideration.
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 save SAY var loop. italo_pm CLIST & REXX 3 Sun Sep 04, 2016 3:06 am
No new posts EDIT END(SAVE) or CANCEL? Steve Coalbran TSO/ISPF 9 Sat Feb 06, 2016 7:11 pm
No new posts USS Shell script:Convert hex to binar... RSR2015 All Other Mainframe Topics 0 Fri Sep 18, 2015 2:00 am
No new posts OUTREC on OUTFIL error rocky_balboa DFSORT/ICETOOL 4 Thu Aug 27, 2015 10:26 am
No new posts OMIT other unsatisfied records in OUT... tvinodkumar7 DFSORT/ICETOOL 6 Thu Jan 08, 2015 1:33 pm


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