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

copying a single file to multiple file using sort/icetool


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

New User


Joined: 10 Feb 2008
Posts: 19
Location: bhuneswar

PostPosted: Wed Dec 11, 2013 6:27 pm
Reply with quote

Hi All

I have a requirement for copying a flat file into multiple files say 20 files with some changes.

For example
File structure/record are

Code:
ORDR  AMT.           DATE
1234 1111111111  01/01/2014
4567 2222222222  01/01/2015
....

9999 4455667777  01/01/2299


Then the result should be any (random ) change in date, order and amount, but there should be chnage

The result can be
Code:
ORDR  AMT.           DATE
1232 1111456121  31/12/1999
5588 2222222222  01/01/2000
....

9001 0000667767  01/01/1875


can it be done by any SORT/ICETOOL utility,

Btw I am thinking of following below approach for order number chnage , not complete JCL ,
But don't know whether it will be efficient and would work properly or not

Code:
//STEP1    EXEC PGM=ICETOOL                                           
//IN       DD  DSN=IFILE1.TEST.INPUT,                           
//             DISP=SHR                                               
//OUT      DD  DSN=FILE2.TEST.OUTPUT,                         
//             DISP=(NEW,CATLG,DELETE),                               
//             UNIT=SYSDA,                                             
//             DSORG=PS,RECFM=FB,LRECL=27,                           
//             BLKSIZE=0                                               
//*                                                                   
//TOOLIN   DD  *                                                       
  COPY FROM(IN) TO(OUT) USING(CTL1)                                   
//TOOLMSG  DD  SYSOUT=*                                               
//DFSMSG   DD  SYSOUT=*                                               
//SYSPRINT DD  SYSOUT=*                                               
//SYSUDUMP DD  SYSOUT=*                                               
//CEEDUMP  DD  SYSOUT=*                                               
//CTL1CNTL DD *                                                       
  SORT FIELDS=COPY                         
OUTREC IFTHEN=(WHEN=(01,1,CH,EQ,C'1'),OVERLAY=(01:C'2')),   
IFTHEN=(WHEN=(01,1,CH,EQ,C'2'),OVERLAY=(01:C'3')),         
IFTHEN=(WHEN=(01,1,CH,EQ,C'3'),OVERLAY=(01:C'4')),         
IFTHEN=(WHEN=(01,1,CH,EQ,C'4'),OVERLAY=(01:C'5')),         
IFTHEN=(WHEN=(01,1,CH,EQ,C'5'),OVERLAY=(01:C'6')),                               
IFTHEN=(WHEN=(01,1,CH,EQ,C'6'),OVERLAY=(01:C'7')),         
IFTHEN=(WHEN=(01,1,CH,EQ,C'7'),OVERLAY=(01:C'8')),         
IFTHEN=(WHEN=(01,1,CH,EQ,C'8'),OVERLAY=(01:C'9')),         
IFTHEN=(WHEN=(01,1,CH,EQ,C'9'),OVERLAY=(01:C'0'))         
/*


Code'd
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Dec 11, 2013 7:33 pm
Reply with quote

Hello,

What are the rules for getting from the input to the output?

You need to explain how the first input record became the first output record. The posted code would not do this . . .

Deep in mind that you know what you mean, but we do not until you clarify.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed Dec 11, 2013 8:08 pm
Reply with quote

Looking at your code and it is definitely not a random change but definitive change

In other words

Do You want to simulate your input file to 20 different output file ?
Back to top
View user's profile Send private message
sumitmalik29
Warnings : 1

New User


Joined: 10 Feb 2008
Posts: 19
Location: bhuneswar

PostPosted: Wed Dec 11, 2013 9:47 pm
Reply with quote

Dear All,

Sorry for confusion,
Please ignore my posted JCL

I need the input record to be copied in other 20 output files , with change in amount, date and order

it can be any change in Order Number ( any different numeric order Number, other than - corresponding input file and other output file's Order Number)

it can be any change in amount ( any numeric Amount, other than - corresponding input file and other output file's amount)

it can be any change in date ( any valid date, other than - corresponding input file and other output file's date )

For example if my input file is like
1234 1111111111 01/01/2014

Then my output for 1st file can be
1239 1111111911 01/01/2009

Output for 2nd file can be
1339 1111111011 01/01/2000

And so on .....

Output for 20th file can be
1833 1568140955 21/11/1965

any change in output file is okay for me
regarding Order Number, Amount and date

Thanks for your time and cooperation
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Dec 11, 2013 10:12 pm
Reply with quote

Hello,

You still haven't explained just what an old value is to be changed to . . . What rule is to be folllowed to create a "changed" output record?

For each record in the input file, Why can there be multiple output file/records written?

Maybe if you explain why there can be multiple output files, it will help.

As of now, we suspect you want do to Something, but i have no idea what this is . . .
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Dec 12, 2013 12:21 am
Reply with quote

I think, perhaps, maybe, trying to be psychic on a non-psychic day, TS wants to copy all the input records to all the output files changing key fields so that they could not be traced back to the original file. Perhaps copying a production file to testing and obfuscating the data in the process. Except it would still be record 1 relates to record 1 in all the other files.
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top