Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file

Google
 
Web mainframegurukul.com

many "include" on a same outfil - is it possible?

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
Tarones
Member


Joined: 09 Oct 2015
Posts: 4

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Oct 09, 2015 8:32 pm    Post subject: many "include" on a same outfil - is it possible? Reply with quote

hi there,
i need to reduce the number of outputs of a given sort.
instead of this:
Code:

 OUTFIL FNAMES=SORTOUT1,                               
     INCLUDE=(1,1,CH,EQ,C'A'),OUTREC=(C'1',1,79)   
 OUTFIL FNAMES=SORTOUT2,
     INCLUDE=(1,1,CH,EQ,C'B'),OUTREC=(C'2',1,79)       

i would like something like this:
Code:

 OUTFIL FNAMES=SORTOUT,                               
     INCLUDE=(1,1,CH,EQ,C'A'),OUTREC=(C'1',1,79),     
     INCLUDE=(1,1,CH,EQ,C'B'),OUTREC=(C'2',1,79)       

that is, writing on a same output file the selected records of different "include/outrec" statements.
it seems to me it isn't possible. the code above got a systax error. i tried other ways too, but none gave me the result i need.
could someone help, please?
thanks.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Sat Oct 10, 2015 12:40 am    Post subject: Reply with quote

Code:

 OUTFIL IFTHEN=(WHEN=(1,1,CH,EQ,C'A'),
                BUILD=(C'1',1,79)),     
        IFTHEN=(WHEN=NONE,
                BUILD=(C'2',1,79))     
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Tarones
Member


Joined: 09 Oct 2015
Posts: 4

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Sat Oct 10, 2015 2:02 am    Post subject: Reply with quote

thanks a lot.
now i see my example wasn't right. the real situation is like this:
Code:

OUTFIL FNAMES=SORTOUT1,                               
     INCLUDE=(1,1,CH,EQ,C'A'),OUTREC=(C'1',1,79)   
 OUTFIL FNAMES=SORTOUT2,
     INCLUDE=(1,1,CH,NE,C'B'),OUTREC=(C'2',1,79)       


i mean, a same input record may eventually be written twice, receiving '1' when written in out1 and '2' when written in out2.

i had already tried the ifthen/build statement as you suggested, but it will only give the output record either '1 or '2', depending on the condition that is 1stly satisfied.

thanks.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Sat Oct 10, 2015 11:57 am    Post subject: Reply with quote

Have you got more than two conditions?

Code:

 OUTFIL  OMIT=(1,1,CH,EQ,C'B'),
        IFTHEN=(WHEN=(1,1,CH,EQ,C'A'),
                BUILD=(C'1',1,79,
                       /,
                       C'2',1,79)),     
        IFTHEN=(WHEN=NONE,
                BUILD=(C'2',1,79))


From the example you showed, All A would get one record from the first OUTFIL and a second from the second. No B records would be output. All other values of 1,1 get one record from the second.

If you have multiple conditions, please describe them more fully.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Tarones
Member


Joined: 09 Oct 2015
Posts: 4

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Sat Oct 10, 2015 5:46 pm    Post subject: Reply with quote

thanks.

yes, i have multiple "include" statement with complex conditions on each one. surely way more than 2 "include" statements. i tried to make things simple in my example.

this is a more complex example, but still quite simple compared to the real situation:
Code:
OUTFIL FNAMES=SORTOUT1,                               
     INCLUDE=(1,1,CH,EQ,C'A',AND,2,1,CH,EQ,123,AND,3,1,ZD,EQ,4),OUTREC=(C'1',1,79)   
 OUTFIL FNAMES=SORTOUT2,
     INCLUDE=(9,8,CH,EQ,C'MICHIGAN',AND,2,1,CH,EQ,456,AND,25,5,ZD,EQ,10100),OUTREC=(C'2',1,79)   
 OUTFIL FNAMES=SORTOUT3,
     INCLUDE=(1,1,CH,NE,C'B',AND,46,6,ZD,EQ,112233),OUTREC=(C'3',1,79)   
 OUTFIL FNAMES=SORTOUT4,
     INCLUDE=(134,7,CH,GT,5557788,AND,87,8,LT,98765896,AND,3,2,CH,EQ,C'NY'),OUTREC=(C'4',1,79)   


the number of "include" can be tens or hundreds.

the point is that i'll have input records that match many "include" and, so, are written in many different outputs.

after i write the records in different outputs on step1, i join them all in a single file with an iebgener on step2. what i'd like to do is to eliminate the need of step2, writing the final file directly on step1.

thanks again.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Oct 12, 2015 2:37 pm    Post subject: Reply with quote

I think the only realistic way to avoid the multiple OUTFILs and a second step in this type of situation is for you to write an E35 SORT Exit. This can be in COBOL. It can be very simple, and you should be able to get multiple records from a single record.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Tarones
Member


Joined: 09 Oct 2015
Posts: 4

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Oct 12, 2015 5:40 pm    Post subject: Reply with quote

thanks a lot.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
academyindia4
Guest





Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Jan 15, 2016 8:16 pm    Post subject: Topic deleted by Admin Reply with quote

<< Content deleted By Admin >>
Back to top
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
academyindia4
Guest





Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Jan 19, 2016 7:10 pm    Post subject: Topic deleted by Admin Reply with quote

<< Content deleted By Admin >>
Back to top
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & 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


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-7950.html