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
 

 

copying a single file to multiple file using sort/icetool

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: copying a single file to multiple file using sort/icetool
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

Site Director


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

PostPosted: Wed Dec 11, 2013 7:33 pm    Post subject:
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

Moderator


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

PostPosted: Wed Dec 11, 2013 8:08 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Dec 11, 2013 10:12 pm    Post subject:
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: 1716
Location: UK

PostPosted: Thu Dec 12, 2013 12:21 am    Post subject:
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    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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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