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
 
Select records from file1 based on the log numbers

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

New User


Joined: 15 Sep 2008
Posts: 22
Location: Mumbai

PostPosted: Tue Sep 30, 2008 3:42 pm    Post subject: Select records from file1 based on the log numbers
Reply with quote

I have 2 files, in file1 record length is 81 and has good data(has log numbers too). File2 has record length 8 which only has log numbers. I want to select records from file1 based on the log numbers given in file2 into a third file. How can i do that through ICETOOL. I tried using SPLICE /SORT option of ICETOOL but nothing worked.
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 Sep 30, 2008 9:10 pm    Post subject:
Reply with quote

You haven't given enough information.

Please show an example of the records in each input file (relevant fields only) and what you expect for output. If input file1 can have duplicates within it, show that in your example. If input file2 can have duplicates within it, show that in your example. Give the RECFM and LRECL of each input file. Give the starting position, length and format of each relevant field.
Back to top
View user's profile Send private message
kiov

New User


Joined: 02 Oct 2008
Posts: 3
Location: Uruguay

PostPosted: Thu Oct 02, 2008 10:42 pm    Post subject:
Reply with quote

I have a similar problem and also tried with SPLICE /SORT.
File1: record length 36, RECFM=FB, key is firsts 6 chars, with dups
File2: record length 6, RECFM=FB, the 6 chars are the key. without dups.

Example File1:
Code:
----+----1----+----2----+----3----+----4----+-
771010AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
771010BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
771011CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
801098DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
802222EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
802222FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
803333GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
803333HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
803333IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
804444JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ


Example File2:
Code:
----+-
771010
771011
803333


Expected result:
Code:
----+----1----+----2----+----3----+----4----+-
771010AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
771010BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
771011CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
803333GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
803333HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
803333IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII


Thanks
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: Thu Oct 02, 2008 10:56 pm    Post subject:
Reply with quote

Quote:
File1: record length 36, RECFM=FB, key is firsts 6 chars, with dups


Your example shows a record length of 46, so I assumed 36 was a typo.

Here's a DFSORT/ICETOOL job that will do what you asked for. Note that we copy IN2 (the file without the dups) before IN1 (the file with the dups) so we can use WITHALL.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/46)
//IN2 DD DSN=...  input file2 (FB/6)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/46)
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,6,CH) WITHALL -
  WITH(1,47) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(47:C'BB')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(47:C'VV')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(47,2,CH,EQ,C'VB'),
    BUILD=(1,46)
/*
Back to top
View user's profile Send private message
kiov

New User


Joined: 02 Oct 2008
Posts: 3
Location: Uruguay

PostPosted: Fri Oct 03, 2008 12:59 am    Post subject:
Reply with quote

Thanks a lot icon_smile.gif

Only one thing, we need swap the dd lines for IN1 - IN2 to get the expected result

The code look like:
Code:
//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//* The swap goes here ----------\/
//IN1 DD DSN=...  input file2 (FB/6)
//IN2 DD DSN=...  input file1 (FB/46)
//*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/46)
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,6,CH) WITHALL -
  WITH(1,47) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(47:C'BB')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(47:C'VV')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(47,2,CH,EQ,C'VB'),
    BUILD=(1,46)
/*


Really thanks a loooot.
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: Fri Oct 03, 2008 1:38 am    Post subject:
Reply with quote

No, swapping things like that wouldn't work. The job I gave you works as I coded it given what you told me about your input file. It copies the FB/6 file (no dups) to T1 and then the FB/46 file (dups) to T1. The records must be in that order in T1 for WITHALL to work. Notice I had IN2 as the FB/6 file and IN1 as the FB/46 file and copied IN2 before IN1.

In your job, you have IN1 as the FB/6 file and IN2 as the FB/46 file and you're copying IN2 and then IN1. That would put the FB/46 records before the FB/6 records which wouldn't work. If that did work, then either your input files or your JCL is not what you said it was.
Back to top
View user's profile Send private message
kiov

New User


Joined: 02 Oct 2008
Posts: 3
Location: Uruguay

PostPosted: Fri Oct 03, 2008 2:24 am    Post subject:
Reply with quote

Yes, you are right.

Two files names almost identical + a lot of hours in front the PC = a lot of mistakes

Sorry for the mistake,
Thanks for your time and knowledge.
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 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
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm

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