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
 

 

Perhaps a simple question, but here goes

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

New User


Joined: 19 Nov 2008
Posts: 90
Location: Spain

PostPosted: Fri Sep 04, 2009 12:50 pm    Post subject: Perhaps a simple question, but here goes
Reply with quote

Hello There...

I was asked by a co-worker if there is a way to copy a file through Icetool to any of two posible DD DSNAMES based on the value of a field of a third file. The example goes as follows:

We have a File A, which could have one of two possible values, 'YYY' or 'ZZZ', as an example.

We also have, another input file, file B, which has a lot of records. This file has a LRECL of 100.

Now, the problem is, that we need to copy File B to DDNAME Output1 if the valules of file A are YYY. Otherwise, we need to copy the whole File B to DDNAME Ouput2 if the values in file A are ZZZ.

In short:

Code:

IF FILE A = YYY THEN
   COPY FILE B TO OUTPUT 1
ELSE
   IF FILE B = ZZZ THEN
       COPY FILE B TO OUPUT 2
   END IF
END-IF


Is there a way to acomplish this through Icetool or another sort Options?

Thanks a lot

Oliver
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Sep 05, 2009 5:46 am    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for assuming FILEA has RECFM=FB. (If FILEA has RECFM=VB, the job would need to be modified slightly.)

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//FILEA DD DSN=...  input fileA (FB)
//FILEB DD DSN=...  input fileB
//CTL2CNTL DD DSN=&&C2,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//OUTPUT1 DD DSN=...  output file1
//OUTPUT2 DD DSN=...  output file2
//TOOLIN DD *
COPY FROM(FILEA) TO(CTL2CNTL) USING(CTL1)
COPY FROM(FILEB) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC IFOUTLEN=80,
   IFTHEN=(WHEN=(1,3,CH,EQ,C'YYY'),
    BUILD=(C'  OUTFIL FNAMES=OUTPUT1',80:X)),
   IFTHEN=(WHEN=NONE,
    BUILD=(C'  OUTFIL FNAMES=OUTPUT2'))
/*
Back to top
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 90
Location: Spain

PostPosted: Mon Sep 07, 2009 3:12 pm    Post subject:
Reply with quote

Indeed, both files has RECFM=FB

Thanks a lot Frank. It never crossed my mind to create the CTL2 control card in execution time and use it for the copy operation.

With this the request is solved.

Thanks a lot again

Best Regards

Oliver
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 QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 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 Asynchronous CICS Processing Question moezbud CICS 1 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts Fault Analyzer - listings question. egrove IBM Tools 4 Thu Aug 11, 2016 5:31 pm


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