Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8657
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 Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Query to compare 2 values of 1 column... Poha Eater DB2 13 Fri Mar 09, 2018 10:45 am
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us