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

POSSIBLE TO HAVE SAME OUTFIL FNAME?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pshongal

New User


Joined: 14 Jun 2012
Posts: 96
Location: India

PostPosted: Wed Nov 29, 2017 3:42 pm
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: 8797
Location: Welsh Wales

PostPosted: Wed Nov 29, 2017 5:23 pm
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: 2455
Location: Hampshire, UK

PostPosted: Wed Nov 29, 2017 5:27 pm
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: 96
Location: India

PostPosted: Wed Nov 29, 2017 5:57 pm
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: 2455
Location: Hampshire, UK

PostPosted: Wed Nov 29, 2017 8:43 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2017
Location: USA

PostPosted: Wed Nov 29, 2017 9:37 pm
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: 96
Location: India

PostPosted: Wed Nov 29, 2017 9:52 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2017
Location: USA

PostPosted: Wed Nov 29, 2017 11:13 pm
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: 96
Location: India

PostPosted: Thu Nov 30, 2017 6:07 am
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: 2481
Location: @my desk

PostPosted: Tue Dec 12, 2017 7:31 pm
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 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 OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts How to append data from PARM in OUTFIL DFSORT/ICETOOL 17
No new posts Joinkeys overlay and unmatched with O... DFSORT/ICETOOL 11
No new posts Duplicate PARM on OUTFIL SYNCSORT 11
Search our Forums:

Back to Top