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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 5 Thu Apr 27, 2017 1:15 am
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm


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