|
View previous topic :: View next topic
|
| Author |
Message |
beto981
New User

Joined: 06 Oct 2006 Posts: 24
|
|
|
|
Hi!
I'm trying to learn jcl and i have some doubts:
1 - I have 15 files with the same layout for input and I want 1 file in output. But I just need the first 10 positions of each file in output.
2 - I want to include a trailler in this file, with the total of records.
Can I do that? How?
Tks! |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT job like this to do what you asked for:
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file1
// DD DSN=... input file2
// DD DSN=... input file3
// DD DSN=... input file4
// DD DSN=... input file5
// DD DSN=... input file6
// DD DSN=... input file7
// DD DSN=... input file8
// DD DSN=... input file9
// DD DSN=... input file10
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,
OUTREC=(1,10),
TRAILER1=(COUNT=(M11,LENGTH=8))
/*
|
|
|
| Back to top |
|
 |
rohit jaiswal Warnings : 2 New User

Joined: 09 Mar 2006 Posts: 36 Location: hyderabad,A.P
|
|
|
|
hi Frank
can u please eloborate on the following mentioned statement in the jcl
OPTION COPY
OUTFIL REMOVECC,
OUTREC=(1,10),
TRAILER1=(COUNT=(M11,LENGTH=8)) |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
REMOVECC suppresses the ANSI carriage control character so you don't get '1' as the first byte of the trailer.
OUTREC=(1,10) copies only the first 10 bytes of each input record to the output record.
TRAILER1=(COUNT=(M11,LENGTH=8) adds a trailer record as the last record with a count of the input records in positions 1-8.
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:
Use [URL] BBCode for External Links |
|
| Back to top |
|
 |
beto981
New User

Joined: 06 Oct 2006 Posts: 24
|
|
|
|
Hi Frank!
I tried what you wrote, but: |
|
| Back to top |
|
 |
beto981
New User

Joined: 06 Oct 2006 Posts: 24
|
|
|
|
My code:
//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//ENTRADA DD DSN=FILE.P01,DISP=SHR
// DD DSN=FILE.P02,DISP=SHR
// DD DSN=FILE.P03,DISP=SHR
// DD DSN=FILE.P04,DISP=SHR
// DD DSN=FILE.P05,DISP=SHR
// DD DSN=FILE.P06,DISP=SHR
// DD DSN=FILE.P07,DISP=SHR
// DD DSN=FILE.P08,DISP=SHR
// DD DSN=FILE.P09,DISP=SHR
// DD DSN=FILE.P10,DISP=SHR
// DD DSN=FILE.P11,DISP=SHR
// DD DSN=FILE.P12,DISP=SHR
// DD DSN=FILE.P13,DISP=SHR
// DD DSN=FILE.P14,DISP=SHR
// DD DSN=FILE.P15,DISP=SHR
//SALIDA DD DSN=FILE.OUT,
// UNIT=SYSDA,DISP=(,CATLG,DELETE),
// DCB=(BLKSIZE=0,LRECL=579,RECFM=FB),
// SPACE=(CYL,(500,5000),RLSE)
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,
OUTREC=(1,10),
TRAILLER1=(COUNT=(M11,LENGHT=8))
There's something wrong? |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| I tried what you wrote |
No, you didn't.
| Quote: |
| There's something wrong? |
Yes. I'm using DFSORT (PGM=ICEMAN). You're using IDCAMS (PGM=IDCAMS). These are two different programs. DFSORT recognizes the DFSORT control statements in SYSIN. IDCAMS doesn't. You can't just slap DFSORT control statements into an IDCAMS job and expect it to work. Go back and compare the job you're using to the job I'm using and you'll see they are completely different. The job I gave you works fine. The "mess" you put together doesn't. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|