IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Include a trailler in this file, with the total of records


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
beto981

New User


Joined: 06 Oct 2006
Posts: 24

PostPosted: Sat Oct 07, 2006 12:16 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Oct 07, 2006 1:17 am
Reply with quote

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
View user's profile Send private message
rohit jaiswal
Warnings : 2

New User


Joined: 09 Mar 2006
Posts: 36
Location: hyderabad,A.P

PostPosted: Sat Oct 07, 2006 3:52 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Oct 07, 2006 9:35 pm
Reply with quote

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
View user's profile Send private message
beto981

New User


Joined: 06 Oct 2006
Posts: 24

PostPosted: Mon Oct 09, 2006 7:50 pm
Reply with quote

Hi Frank!
I tried what you wrote, but:
Back to top
View user's profile Send private message
beto981

New User


Joined: 06 Oct 2006
Posts: 24

PostPosted: Mon Oct 09, 2006 7:54 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Oct 09, 2006 9:19 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
Search our Forums:

Back to Top