Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
POSSIBLE TO HAVE SAME OUTFIL FNAME?

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

New User


Joined: 14 Jun 2012
Posts: 78
Location: India

PostPosted: Wed Nov 29, 2017 3:42 pm    Post subject: POSSIBLE TO HAVE SAME OUTFIL FNAME?
Reply with quote

Hi,

Can I write the O/P in the same O/P file with different condition?

Below is my SORT card, but it is failing.

Code:

  JOINKEYS FILE=F1,FIELDS=(35,23,A),SORTED,NOSEQCK           
  JOINKEYS FILE=F2,FIELDS=(31,23,A)                           
  JOIN UNPAIRED,F1,F2                                         
  REFORMAT FIELDS=(F1:5,1450,F2:1,1451,?)                     
  OPTION COPY                                                 
    OUTFIL FNAMES=OUT1,INCLUDE=((2902,1,CH,EQ,C'B',AND,   
                                     2901,1,CH,EQ,C'U),OR,   
                                    (2902,1,CH,EQ,C'2'))     
      BUILD=(1451,1450)   
                                   
    OUTFIL FNAMES=OUT1,INCLUDE=(2902,1,CH,EQ,C'1'),       
      BUILD=(1,1450)                                         
/*                                                           



Error:
Code:
ICE219I 0 DUPLICATE DDNAME OUT1 IGNORED


I tried with same O/P file name but different DD name, that also did not work.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8619
Location: Back in jolly old England

PostPosted: Wed Nov 29, 2017 5:23 pm    Post subject:
Reply with quote

Quick fix ................

Possibly using two executions of the sort step and using DISP=MOD for the second step,

or

Create two datasets in one iteration of sort and then append one to the other

or possibly pre creating the dataset and using DISP=MOD in the sort pgm
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1932
Location: UK

PostPosted: Wed Nov 29, 2017 5:27 pm    Post subject:
Reply with quote

Each OUTFIL defines a new DDname so you cannot have duplicate names.

You did not show the error message(s) for the when you uded different FNAMES. Perhaps you forgot to update the JCL to take into acount the second DDname and data set.
Back to top
View user's profile Send private message
pshongal

New User


Joined: 14 Jun 2012
Posts: 78
Location: India

PostPosted: Wed Nov 29, 2017 5:57 pm    Post subject:
Reply with quote

Hi Expat, Actually I wanted to avoid 2 sort steps, so was trying this way.

Hi Nic,
When I used same dataset with different DD name I got message as:
File cannot be allocated as duplicate name exists.

I used MOD,CATALOG,DELETE as Disp parameter
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1932
Location: UK

PostPosted: Wed Nov 29, 2017 8:43 pm    Post subject:
Reply with quote

Do not use the same data set name on both DD statements.
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 232
Location: Maryland

PostPosted: Wed Nov 29, 2017 9:37 pm    Post subject: Re: POSSIBLE TO HAVE SAME OUTFIL FNAME?
Reply with quote

pshongal wrote:
I tried with same O/P file name but different DD name, that also did not work.

It definitely cannot work, if you ever tried to read about some fundamentals of zOS file system organization.

SORT opens all specified FNAMES (=DDNAMES) simultaneously, to be able to write all of them in parallel. The same dataset (=DSNAME) with DSORG=PS cannot be open for output more than once at the same time; only sequential OPEN-CLOSE-OPEN-CLOSE-... is allowed.

Try to use ICETOOL to perform two SORT steps as one job step.
Back to top
View user's profile Send private message
pshongal

New User


Joined: 14 Jun 2012
Posts: 78
Location: India

PostPosted: Wed Nov 29, 2017 9:52 pm    Post subject:
Reply with quote

Thanks Sergeyken. Could you pls tell me how Icetool can be used...?
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 232
Location: Maryland

PostPosted: Wed Nov 29, 2017 11:13 pm    Post subject:
Reply with quote

Question #1: is ICETOOL available in your environment?

Question #2: did you read something about ICETOOL? For instance - One of available DFSORT/ICETOOL manuals

General approach to run more than one SORT step in a single job step, is as follows
Code:
 COPY FROM(INPUT1) TO(OUTPUT) USING(SEL1)
 COPY FROM(INPUT2) TO(OUTPUT) USING(SEL2)

If //OUTPUT DD is defined with DISP=NEW, or DISP=MOD, then the result of the second COPY is appended to the result of the first COPY.

For details I recommend to read one of ICETOOL manuals.
Back to top
View user's profile Send private message
pshongal

New User


Joined: 14 Jun 2012
Posts: 78
Location: India

PostPosted: Thu Nov 30, 2017 6:07 am    Post subject:
Reply with quote

Thank you. Yes, ICETOOL is available in our environment. I will try this approach
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2287
Location: @my desk

PostPosted: Tue Dec 12, 2017 7:31 pm    Post subject:
Reply with quote

pshongal wrote:
Thank you. Yes, ICETOOL is available in our environment. I will try this approach
OR you could also try modifying your control statements to conditionally reformat the output records using something like this:
Code:
 JOINKEYS FILE=F1,FIELDS=(35,23,A),SORTED,NOSEQCK
 JOINKEYS FILE=F2,FIELDS=(31,23,A)               
 JOIN UNPAIRED,F1,F2                             
 REFORMAT FIELDS=(F1:5,1450,F2:1,1451,?)         
 OPTION COPY                                     
 INCLUDE COND=((2902,1,CH,EQ,C'B',AND,           
                2901,1,CH,EQ,C'U'),OR,           
                2902,1,CH,EQ,C'1',OR,             
                2902,1,CH,EQ,C'2')               
 OUTFIL FNAMES=OUT1,                             
        IFTHEN=(WHEN=(2902,1,SS,EQ,C'B,2'),       
         BUILD=(1451,1450)),                     
        IFTHEN=(WHEN=(2902,1,CH,EQ,C'1'),         
         BUILD=(1,1450)),IFOUTLEN=1450           
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 BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
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
No new posts OUTFIL with multiple output files wit... garunmj DFSORT/ICETOOL 4 Thu Nov 06, 2014 7:08 pm
No new posts DFSORT OUTFIL, ICETOOL DISPLAY selvaganesan DFSORT/ICETOOL 2 Fri Oct 03, 2014 3:10 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us