DFSORT - ICETOOL Question

2010-05-21 Thread George.William
Group

 

It's Friday and my brain is NOT working.  I'm having a heck of a time
putting together an ICETOOL step.

The output is every record in dataset 1 that has a matching key in
dataset 2. 

 

The 2 datasets have different LRECLs and the key is in different
positions.

   DS1:   LRECL=400   KEY=7 for a length of 13  (note: 7 is column
position, not offset)

   DS2:   LRECL=80 KEY=2 for a length of 13

OUTPUT is all records in DS1 that have a matching key in DS2.

 

I've looked at the SELECT and SPLICE examples in the DFSORT guide and
here is what I have but I'm guessing I'm way off base.

I'm getting records from both input datasets into the output where I
require only the records from DS1.

Thanks for any insights!

Bill 

 

//* -- 

//* FIND MATCHING RECORDS  

//* - KEYS IN DIFFERNT POSITIONS   

//* -- 

//FINDREC EXEC  PGM=ICETOOL

//TOOLMSG DD SYSOUT=*  

//DFSMSG  DD SYSOUT=*  

//DS1 DD DSN=,DISP=SHR 

//DS2 DD DSN=,DISP=SHR   

//T1  DD DSN=,

//   DISP=(MOD,CATLG,KEEP),UNIT=SYSDA, 

//   SPACE=(CYL,(100,10),RLSE),

//   DCB=(RECFM=FB,LRECL=400,BLKSIZE=0)

//OUT DD DSN=, 

//   DISP=(MOD,CATLG,KEEP),UNIT=SYSDA, 

//   SPACE=(CYL,(100,10),RLSE),

//   DCB=(RECFM=FB,LRECL=400,BLKSIZE=0)

//TOOLIN  DD * 

  COPY FROM(DS1) TO(T1) USING(CTL1)

  COPY FROM(DS2) TO(T1) USING(CTL2)

  SPLICE FROM(T1) TO(OUT) ON(6,13,CH) WITH(6,13)   

/* 

//CTL1CNTL DD *

  OUTREC BUILD=(1:1,400)   

/* 

//CTL2CNTL DD *

  OUTREC BUILD=(6:1,80)

/* 

 

Bill George  
FTB | Tax Systems and Applications Bureau | BETS Interface Team
Office: 916.845.6459 | ms: L-210 | location: LA2B-B-5-02 
email: william.geo...@ftb.ca.gov  

 

__
CONFIDENTIALITY NOTICE: This email from the State of California is for the sole 
use of the intended recipient and may contain confidential and privileged 
information. Any unauthorized review or use, including disclosure or 
distribution, is prohibited. If you are not the intended recipient, please 
contact the sender and destroy all copies of this email.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


DFSORT/ICETOOL question

2008-06-04 Thread Tim Hare
Really two questions I guess.

1. We have variable length records with the data similar to COBOL 'OCCURS 
DEPENDING ON' clauses - a count of the number of segments to follow, 
followed by those segments.  Is there a way to handle these in 
INREC/OUTREC/OUTFILE ?  I already thought of using IFTHEN  - if the count is 
at least 1, output data from 1st segment, if at least 2, output from first 2 
segments, etc. but I don't see how to do that based on the count that's in 
the record

2.  Is there a way to describe such segments in DFSORT Symbols?

I've been RTFM and PDFs but without enlightenment.  It seems to me that it 
requires being able to specify the position field as a calculation rather than 
a 
constant (i.e. 'p' = base+
(seg_number_starting_from_0*seg_length+offset_to_field_in_segment)?

This would also be of use for some SMF records I'd imagine.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html



Re: DFSORT - ICETOOL Question

2010-05-21 Thread Frank Yaeger
William George wrote on 05/21/2010 10:47:54 AM:
> It's Friday and my brain is NOT working.  I'm having a heck of a time
> putting together an ICETOOL step.
>
> The output is every record in dataset 1 that has a matching key in
> dataset 2.
>
> The 2 datasets have different LRECLs and the key is in different
> positions.
>
>DS1:   LRECL=400   KEY=7 for a length of 13  (note: 7 is column
> position, not offset)
>
>DS2:   LRECL=80 KEY=2 for a length of 13
>
> OUTPUT is all records in DS1 that have a matching key in DS2.
>
>  ...

Bill,

I need some more information.

Please show an example of the records in each input file (relevant fields
only) and what you expect for output.  Explain the "rules" for getting from
input to output.  Give the starting position, length and format of each
relevant field.  Give the RECFM and LRECL of the input files.  If file1 can
have duplicates within it, show that in your example.  If file2 can have
duplicates within it, show that in your example.)

If you have the DFSORT PTF for JOINKEYS, it might be a better choice than
SPLICE.  So please run this job and show the //SYSOUT messages you receive,
so I can see what level you're at:

//S1EXEC  PGM=SORT
//SYSOUTDD  SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSINDD*
OPTION COPY
/*

Frank Yaeger - DFSORT Development Team (IBM) - yae...@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration

 => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: DFSORT - ICETOOL Question

2010-05-21 Thread Schwarz, Barry A
Page 9 of 
http://www-947.ibm.com/systems/support/storage/software/sort/mvs/tricks/pdf/sorttrck.pdf
 has a sample of how to do this.

-Original Message-
From: IBM Mainframe Discussion List [mailto:ibm-m...@bama.ua.edu] On Behalf Of 
George.William
Sent: Friday, May 21, 2010 10:48 AM
To: IBM-MAIN@bama.ua.edu
Subject: DFSORT - ICETOOL Question

Group



It's Friday and my brain is NOT working.  I'm having a heck of a time
putting together an ICETOOL step.

The output is every record in dataset 1 that has a matching key in
dataset 2.



The 2 datasets have different LRECLs and the key is in different
positions.

   DS1:   LRECL=400   KEY=7 for a length of 13  (note: 7 is column
position, not offset)

   DS2:   LRECL=80 KEY=2 for a length of 13

OUTPUT is all records in DS1 that have a matching key in DS2.



I've looked at the SELECT and SPLICE examples in the DFSORT guide and
here is what I have but I'm guessing I'm way off base.

I'm getting records from both input datasets into the output where I
require only the records from DS1.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: DFSORT - ICETOOL Question

2010-05-21 Thread George.William
Thanks Barry!
I used to have this bookmarked but the bookmark I had no longer was
valid.
I've now got it re-bookmarked!

Bill

-Original Message-
From: IBM Mainframe Discussion List [mailto:ibm-m...@bama.ua.edu] On
Behalf Of Schwarz, Barry A
Sent: Friday, May 21, 2010 11:33 AM
To: IBM-MAIN@bama.ua.edu
Subject: Re: DFSORT - ICETOOL Question

Page 9 of
http://www-947.ibm.com/systems/support/storage/software/sort/mvs/tricks/
pdf/sorttrck.pdf has a sample of how to do this.

__
CONFIDENTIALITY NOTICE: This email from the State of California is for the sole 
use of the intended recipient and may contain confidential and privileged 
information. Any unauthorized review or use, including disclosure or 
distribution, is prohibited. If you are not the intended recipient, please 
contact the sender and destroy all copies of this email.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: DFSORT/ICETOOL question

2007-06-15 Thread Frank Yaeger
On Jun 15, 6:19 am, oktg wrote:
> I wonder if anybody could help me out with following question:
>
> i want to use DFSORT/ICETOOL to convert a flat file (eg FB,80) having
> the following layout:
>
> +1+2+3
> **
> FL641 10JAN1993 VOL JFK
> FL642 11JAN1993 JFK VOL
> **
>
> col  1-5: flightnumber
> col  7-15: flightdate
> col 17-19: departure station
> col 21-23: arrival station
>
> to an XML file having the following layout (eg, VB,255)
>
> 
> FL641
> 10JAN1993
> VOL
> JFK
> 
> 
> FL642
> 11JAN1993
> JFK
> VOL
> 
>
> so i need to map 1 input record to n output records
>
> Many thanks in advance

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

//S1EXEC  PGM=ICEMAN
//SYSOUTDD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/23)
//SORTOUT DD LRECL=255,DSN=...  output file (VB/255)
//SYSINDD*
  OPTION COPY
  OUTFIL FTOV,BUILD=(C'',/,
   C'',1,5,C'',/,
   C'',7,9,C'',/,
   C'',17,3,C'',/,
   C'',21,3,C'',/,
   C'')
/*

Frank Yaeger - DFSORT Development Team (IBM) - [EMAIL PROTECTED]
Specialties: PARSE, JFY, SQZ, ICETOOL, IFTHEN, OVERLAY, Symbols, Migration

 => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: DFSORT/ICETOOL question

2008-06-04 Thread Gary Green
I probably already know the answer but does the number of segments/offsets 
change with each record type or would/do they remain the same?  If the later, 
then there is a DFSORT solution.


 On Wed Jun  4 12:59 , Tim Hare <[EMAIL PROTECTED]> sent:

>Really two questions I guess.
>
>1. We have variable length records with the data similar to COBOL 'OCCURS 
>DEPENDING ON' clauses - a count of the number of segments to follow, 
>followed by those segments.  Is there a way to handle these in 
>INREC/OUTREC/OUTFILE ?  I already thought of using IFTHEN  - if the count is 
>at least 1, output data from 1st segment, if at least 2, output from first 2 
>segments, etc. but I don't see how to do that based on the count that's in 
>the record
>
>2.  Is there a way to describe such segments in DFSORT Symbols?
>
>I've been RTFM and PDFs but without enlightenment.  It seems to me that it 
>requires being able to specify the position field as a calculation rather than 
>a 
>constant (i.e. 'p' = base+
>(seg_number_starting_from_0*seg_length+offset_to_field_in_segment)?
>
>This would also be of use for some SMF records I'd imagine.
>
>--
>For IBM-MAIN subscribe / signoff / archive access instructions,
>send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
>Search the archives at http://bama.ua.edu/archives/ibm-main.html
>

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html



Re: DFSORT/ICETOOL question

2008-06-04 Thread Frank Yaeger
Tim Hare wrote on 06/04/2008 10:59:55 AM:
> Really two questions I guess.
>
> 1. We have variable length records with the data similar to COBOL 'OCCURS

> DEPENDING ON' clauses - a count of the number of segments to follow,
> followed by those segments.  Is there a way to handle these in
> INREC/OUTREC/OUTFILE ?  I already thought of using IFTHEN  - if the count
is
> at least 1, output data from 1st segment, if at least 2, output from
first 2
> segments, etc. but I don't see how to do that based on the count that's
in
> the record

I don't know what you mean by "I don't see how to do that based on the
count
that's in the record".  The IFTHEN's WHEN=(logexp) can test the count vs a
constant.  For example, if the count is a 2-byte BI value in positions
21-22,
you could use:


  INREC IFTHEN=(WHEN=(21,2,BI,EQ,1),...)),
IFTHEN=(WHEN=(21,2,BI,EQ,2),...)),
...

All you need to know is the starting position, length and format of the
count.
Maybe if you showed an example of the input records and what you're trying
get
for output, it would clarify things.

> 2.  Is there a way to describe such segments in DFSORT Symbols?
>
> I've been RTFM and PDFs but without enlightenment.  It seems to me that
it
> requires being able to specify the position field as a calculation
> rather than a
> constant (i.e. 'p' = base+
> (seg_number_starting_from_0*seg_length+offset_to_field_in_segment)?
>
> This would also be of use for some SMF records I'd imagine.

You would need to describe the segments in a linear fashion.  You could
use a different (but similar) name for the symbols for each subsequent
segment,  e.g. S01_name1, S01_name2,  , S02_name1, S02_name2, ...

Frank Yaeger - DFSORT Development Team (IBM) - [EMAIL PROTECTED]
Specialties: PARSE, JFY, SQZ, ICETOOL, IFTHEN, OVERLAY, Symbols, Migration

 => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html



Re: DFSORT/ICETOOL question

2008-06-04 Thread Tim Hare
I know the offset and format of the count, and I certainly can compare it to a 
literal. The problem is not knowing the maximum value the count could have in 
any group of records (and each record can have a different value for the 
count).  I could for example, code the IFTHEN statement to handle 9 
segments, but have a record show up with 10.  I could, I suppose, make one 
pass through the file to determine the maximum number of segments, then 
create control statements to process them.  I guess what I was looking for 
would be more of an iterative loop processing of the record segments.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html



Re: DFSORT/ICETOOL question

2008-06-04 Thread Frank Yaeger
Tim Hare wrote on 06/04/2008 01:59:39 PM:
> I know the offset and format of the count, and I certainly can
> compare it to a
> literal. The problem is not knowing the maximum value the count could
have in
> any group of records (and each record can have a different value for the
> count).  I could for example, code the IFTHEN statement to handle 9
> segments, but have a record show up with 10.  I could, I suppose, make
one
> pass through the file to determine the maximum number of segments, then
> create control statements to process them.  I guess what I was looking
for
> would be more of an iterative loop processing of the record segments.

Tim,

There's no concept of an iterative loop.  Yes, you could determine the
maximum
count dynamically and use it to create the control statements dynamically
with
DFSORT.  OUTFIL REPEAT=n and SEQNUM with INCR=n might come in handy for
that.

Alternatively, if you could come up with a reasonable estimate of the max
count
you could ever get, you could add a fudge  factor to it and code up that
number
of IFTHEN clauses.

Frank Yaeger - DFSORT Development Team (IBM) - [EMAIL PROTECTED]
Specialties: PARSE, JFY, SQZ, ICETOOL, IFTHEN, OVERLAY, Symbols, Migration

 => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html