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
 

 

DFSORT/ICETOOL question

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

New User


Joined: 29 Jan 2014
Posts: 8
Location: USA

PostPosted: Sat May 31, 2014 12:40 am    Post subject: DFSORT/ICETOOL question
Reply with quote

Hi,

I am attempting to:

1. Sort and split 'IN' file into the two output files as shown.
2. Write the existing header to each of the two output files.
3. Plug a fixed value of 'ABC' into the header of OT1.
4. Plug a fixed value of 'XYZ' into the header of OT2.

IN:
HEADER 000
1111111 B06
2222222 B05 006
3333333 B04 006
4444444 B03
5555555 B02 006
6666666 B01

OT1:
HEADER ABC
6666666 B01
4444444 B03
1111111 B06

OT2:
HEADER XYZ
5555555 B02 006
3333333 B04 006
2222222 B05 006


The JCL for my initial attempt is below, but discovered duplicate OUTREC statements are not allowed.

I was able to accomplish my goal - but with two separate steps. Just wondering if there was a way to get it done in one step.


//SPLIT EXEC PGM=ICETOOL
//IN DD DSN=&HLQ..IN,DISP=SHR
//OT1 DD DSN=&HLQ..OT1,
// DISP=(NEW,CATLG),
// SPACE=(TRK,(1,1),RLSE)
//OT2 DD DSN=&HLQ..OT2,
// DISP=(NEW,CATLG),
// SPACE=(TRK,(1,1),RLSE)
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD *
SORT FROM(IN) USING(OUTA)
/*
//OUTACNTL DD *
SORT FIELDS=(9,3,CH,A,1,7,CH,A)
OUTFILE FNAMES=(OT1),
INCLUDE=(1,6,CH,EQ,C'HEADER',OR,13,3,CH,EQ,C' ')
OUTREC IFTHEN=(WHEN=(1,6,CH,EQ,C'HEADER'),
OVERLAY=(17:C'ABC'))
OUTFILE FNAMES=(OT2),
INCLUDE=(1,6,CH,EQ,C'HEADER',OR,13,3,CH,EQ,C'006')
OUTREC IFTHEN=(WHEN=(1,6,CH,EQ,C'HEADER'),
OVERLAY=(17:C'XYZ'))
/*
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Sat May 31, 2014 3:27 am    Post subject: Reply to: DFSORT/ICETOOL question
Reply with quote

You have fallen into the trap of becoming confused by OUTREC and OUTREC on OUTFIL. Two different things.

On OUTFIL, use BUILD instead of OUTREC, and you need a continuation comma as the last of each line before each BUILD.
Back to top
View user's profile Send private message
John W Perry

New User


Joined: 29 Jan 2014
Posts: 8
Location: USA

PostPosted: Sat May 31, 2014 4:40 am    Post subject:
Reply with quote

Thanks for your help Bill,

The use of BUILD worked fine.

I've also added a COPY step to produce two more output files in the original sort order. The process works OK but I was wondering if it could be accomplished with just one pass on the input file.

Code:
//TOOLIN   DD *                                           
  SORT FROM(IN) USING(OUTA)                               
  COPY FROM(IN) USING(OUTB)                               
/*                                                       
//OUTACNTL DD *                                           
 SORT FIELDS=(9,3,CH,A,1,7,CH,A)                         
  OUTFILE FNAMES=(OT1),                                   
    INCLUDE=(1,6,CH,EQ,C'HEADER',OR,13,3,CH,EQ,C'   '),   
     IFTHEN=(WHEN=(1,6,CH,EQ,C'HEADER'),                 
             BUILD=(1,16,C'ABC'))                         
  OUTFILE FNAMES=(OT2),                                   
    INCLUDE=(1,6,CH,EQ,C'HEADER',OR,13,3,CH,EQ,C'006'),   
     IFTHEN=(WHEN=(1,6,CH,EQ,C'HEADER'),                 
             BUILD=(1,16,C'XYZ'))                         
/*                                                       
//OUTBCNTL DD *                                           
  OUTFILE FNAMES=(OT3),                                   
    INCLUDE=(1,6,CH,EQ,C'HEADER',OR,13,3,CH,EQ,C'   '),   
     IFTHEN=(WHEN=(1,6,CH,EQ,C'HEADER'),                   
             BUILD=(1,16,C'ABC'))                         
  OUTFILE FNAMES=(OT4),                                   
    INCLUDE=(1,6,CH,EQ,C'HEADER',OR,13,3,CH,EQ,C'006'),   
     IFTHEN=(WHEN=(1,6,CH,EQ,C'HEADER'),                   
             BUILD=(1,16,C'XYZ'))                         
/*


Code'd
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Jun 05, 2014 4:32 am    Post subject: Reply to: DFSORT/ICETOOL question
Reply with quote

Sorry John, just found this in the HomeWork part of the forum, which isn't somewhere questions appear from (I thought it had been deleted after my answer).

If you want the output sorted and in the original order, you will have to do it in separate operations, as you have done already. OUTFIL (or after OUTREC, if no OUTFIL present) is where data is written, and the input is long gone by that point.

The one thing you could try is to use an E15 exit, which can be written in COBOL. You will be presented with each record from the input, which you can then format and write to new files, from the COBOL program. Whether you data and the number of files you require means that this will use fewer resources is going to be down to experimentation.
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 Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am
No new posts Group elements using ICETOOL Learncoholic DFSORT/ICETOOL 2 Fri Apr 14, 2017 11:01 am
No new posts The Last Two Question For You To Ask ... CaptBill Mainframe Interview Questions 0 Fri Apr 14, 2017 5:42 am
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm


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