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: 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 Format Last Record differently from r... Learncoholic DFSORT/ICETOOL 0 Tue Oct 24, 2017 12:01 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am

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