View previous topic :: View next topic
|
Author |
Message |
Elixir
Active User
Joined: 08 Feb 2009 Posts: 116 Location: CHENNAI/NEW JERSEY - INDIA/USA
|
|
|
|
Using ICETOOL is it possible to select first 5 records from every set(using first 3 bytes) of records in the below file,
SET1a
SET1b
SET1c
SET1d
SET1e
SET1f
SET2g
SET3h
SET3i
SET3j
SET3k
SET4l
SET4m |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you want help, you need to provide enough info for someone to use to help. . .
From the "sample input" what should be the output? You mention the first 3 bytes, but they are all the same.
A better explanaton of the "rules" and more representative input/output data may help. Also, mention the recfm and lrecl of the files. |
|
Back to top |
|
|
Elixir
Active User
Joined: 08 Feb 2009 Posts: 116 Location: CHENNAI/NEW JERSEY - INDIA/USA
|
|
|
|
The expected output is as below,
SET1a
SET1b
SET1c
SET1d
SET1e
SET2g
SET3h
SET3i
SET3j
SET3k
SET4l
SET4m
Input and output both have same record length of 4 bytes. |
|
Back to top |
|
|
saiprasadh
Active User
Joined: 20 Sep 2006 Posts: 154 Location: US
|
|
|
|
Hi Elixir,
Use below sort card
Code: |
//STEP010 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INPUT1 DD *
SET1A
SET1B
SET1C
SET1D
SET1E
SET1F
SET2G
SET3H
SET3I
SET3J
SET3K
SET4L
SET4M
/*
//MATCH DD SYSOUT=*
//TOOLIN DD *
COPY FROM(INPUT1) TO(MATCH) USING(CTL1)
//CTL1CNTL DD *
INREC FIELDS=(1:1,10,21:SEQNUM,10,ZD,START=1,INCR=1,RESTART=(1,4))
OUTFIL FNAMES=MATCH,
INCLUDE=(21,10,ZD,LE,5),
OUTREC=(1:1,10)
/*
|
Output:
Code: |
SET1A
SET1B
SET1C
SET1D
SET1E
SET2G
SET3H
SET3I
SET3J
SET3K
SET4L
SET4M |
Sai |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Input and output both have same record length of 4 bytes. |
Ah, Errr, Ummm - there are 5 on my screen. . . (i.e. SET4m).
The solution Sai posted may do what you want, but not because you posted anything worth using to help you. . .
Is it really that difficult to post what you actually have and what you want from it. . .
d |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Elixir,
I don't usually look in this Forum, but I happened to notice it. It would be better to post DFSORT questions in the DFSORT Forum where I hang out.
Here's a DFSORT/ICETOOL job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD DSN=... output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,4,CH) FIRST(5)
/*
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080 |
|
Back to top |
|
|
|