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
 

 

How to Copy Records from FileA to a new FileC based on Recor

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

New User


Joined: 10 Mar 2005
Posts: 16

PostPosted: Tue Apr 10, 2007 4:02 pm    Post subject: How to Copy Records from FileA to a new FileC based on Recor
Reply with quote

I have two files FILEA and FILEB. FILEA has LRECL = 120 while FILEB has LRECL = 20. Position 1-20 of both files refer to ID number. I need to copy
only those records from FILEA which exists in FILEB into a new file FILEC using ICEMAN. How do I do this?

e.g.:

FILEA :

11111111111111111111NAME1.........................
22222222222222222222NAME1.........................
33333333333333333333NAME1.........................
44444444444444444444NAME1.........................
55555555555555555555NAME1.........................

FILEB :

22222222222222222222
55555555555555555555

The output should be:

22222222222222222222NAME1.........................
55555555555555555555NAME1.........................



Thanks,
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Apr 10, 2007 4:13 pm    Post subject:
Reply with quote

http://www-304.ibm.com/jct01004c/systems/support/storage/software/sort/mvs/icetool/pdf/sorttool.pdf
Take a look at the SELECT function.
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: Tue Apr 10, 2007 9:18 pm    Post subject:
Reply with quote

mikayag,

Here's a DFSORT/ICETOOL job that will do what you asked for. Note that ICEMAN is an alias for your sort product. If you have DFSORT, then you have DFSORT's ICETOOL and this job will work. Try it.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN2 DD DSN=... input file2 (FB/20)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=...  input file1 (FB/120)
//    DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//OUT DD DSN=...  output file (FB/120)
//TOOLIN   DD    *
COPY FROM(IN2) TO(T1) USING(CTL1)
SELECT FROM(CON) TO(OUT) ON(1,20,CH) FIRSTDUP
/*
//CTL1CNTL DD *
  INREC OVERLAY=(120:X)
/*
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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