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
 

 

write one output file from 2 innput files with the same key

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

New User


Joined: 14 Sep 2009
Posts: 60
Location: Milan

PostPosted: Thu Sep 24, 2009 11:18 pm    Post subject: write one output file from 2 innput files with the same key
Reply with quote

hello everyone...i need help with icetool.
i have two input files with the same keys. In the output file I have to write ONLY the first part of the key (if at least some of the key changes).


ex.

file1
000000000000 2009/08/31 50
000000000001 2009/07/31 20
000000000002 2009/06/30 10
000000000003 2009/05/31 30


file2
000000000000 2009/08/31 50
000000000001 2009/08/31 20 date changed
000000000002 2009/06/30 30 changed the 3 part of the key(10->30)
000000000003 2009/05/31 30


fileout
000000000001
000000000002


i hope you understand!


thank you
icon_biggrin.gif
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 Sep 24, 2009 11:24 pm    Post subject:
Reply with quote

What is the RECFM and LRECL of each input file?

What is the starting position, length and format of each field?

Can input file1 have duplicates within it? Can input file2 have duplicates within it? If either file can have dups within it, show a better example of input and expected output with dups.
Back to top
View user's profile Send private message
theone1987

New User


Joined: 14 Sep 2009
Posts: 60
Location: Milan

PostPosted: Fri Sep 25, 2009 12:17 am    Post subject: Reply to: write one output file from 2 innput files with the
Reply with quote

I need only three fields of the entire records.

input file 1 (LRECL = 290 FB)
field1: from position 10 long 40 (char)
field2: from position 52 long 10 (char)
field3: from position 62 long 10 (zoned)
input file1 can't have duplicates within it

input file 2 (LRECL = 290 FB)
field1: from position 1 long 40 (char)
field2: from position 10 long 10 (char)
field3: from position 32 long 10 (zoned)
input file2 can't have duplicates within it
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 Sep 25, 2009 1:12 am    Post subject:
Reply with quote

Sigh. What does "10 long 40" mean? What is "long"? Does it mean 10-40, or starting position is 10 and length is 40? Or what?

For input file 2, does 10 long 10 overlap 1 long 40?

Please use standard, understandable notation like:

Positions 1-40 (char)

or

starting position 1 and length 40 (char)
Back to top
View user's profile Send private message
theone1987

New User


Joined: 14 Sep 2009
Posts: 60
Location: Milan

PostPosted: Fri Sep 25, 2009 1:17 am    Post subject: Reply to: write one output file from 2 innput files with the
Reply with quote

sorry!

I need only three fields of the entire records.

input file 1 (LRECL = 290 FB)
field1:starting position 10 and length 40 (char)
field2:starting position 52 and length 10 (char)
field3:starting position 62 and length 10 (zoned)
input file1 can't have duplicates within it

input file 2 (LRECL = 290 FB)
field1:starting position 1 and length 40 (char)
field2:starting position 10 and length 10 (char)
field3:starting position 32 and length 10 (zoned)
input file2 can't have duplicates within it

i hope is clear now!
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Sep 25, 2009 1:36 am    Post subject: Reply to: write one output file from 2 innput files with the
Reply with quote

Quote:

I need only three fields of the entire records.

input file 1 (LRECL = 290 FB)
field1:starting position 10 and length 40 (char)
field2:starting position 52 and length 10 (char)
field3:starting position 62 and length 10 (zoned)
input file1 can't have duplicates within it

input file 2 (LRECL = 290 FB)
field1:starting position 1 and length 40 (char)
field2:starting position 10 and length 10 (char)
field3:starting position 32 and length 10 (zoned)
input file2 can't have duplicates within it


theone1987,

Arent the file 2 key values overlapping each other (field 2 and field 3 overlap field 1)? (highlighted in bold) . How can you compare the first file key of 40 bytes with file2 ?
Back to top
View user's profile Send private message
theone1987

New User


Joined: 14 Sep 2009
Posts: 60
Location: Milan

PostPosted: Fri Sep 25, 2009 2:09 am    Post subject: Re: Reply to: write one output file from 2 innput files with
Reply with quote

Skolusu wrote:
Quote:

I need only three fields of the entire records.

input file 1 (LRECL = 290 FB)
field1:starting position 10 and length 40 (char)
field2:starting position 52 and length 10 (char)
field3:starting position 62 and length 10 (zoned)
input file1 can't have duplicates within it

input file 2 (LRECL = 290 FB)
field1:starting position 1 and length 40 (char)
field2:starting position 10 and length 10 (char)
field3:starting position 32 and length 10 (zoned)
input file2 can't have duplicates within it


theone1987,
Arent the file 2 key values overlapping each other (field 2 and field 3 overlap field 1)? (highlighted in bold) . How can you compare the first file key of 40 bytes with file2 ?




sorry again,
input file 2 (LRECL = 290 FB)
field1:starting position 1 and length 40 (char)
field2:starting position 42 and length 10 (char)
field3:starting position 53 and length 10 (zoned)
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 Sep 25, 2009 3:11 am    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//CON DD DSN=...  input file1 (FB/290)
//    DD DSN=...  input file2 (FB/290)
//OUT DD DSN=...  output file (FB/40)
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(1,40,CH) ON(41,10,CH) ON(51,10,ZD) -
  NODUPS USING(CTL1)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=(56,1,CH,EQ,C'/'),
    BUILD=(1:10,40,41:52,10,51:62,10,61:C'1')),
   IFTHEN=(WHEN=NONE,
    BUILD=(1:1,40,41:42,10,51:53,10,61:C'2'))
  OUTFIL FNAMES=OUT,INCLUDE=(61,1,CH,EQ,C'1'),BUILD=(1,40)
/*
Back to top
View user's profile Send private message
theone1987

New User


Joined: 14 Sep 2009
Posts: 60
Location: Milan

PostPosted: Fri Sep 25, 2009 12:41 pm    Post subject:
Reply with quote

THANK YOU VERY MUCH!
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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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