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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Include a trailler in this file, with the total of records
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 Moderator


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

PostPosted: Sat Oct 07, 2006 1:17 am    Post subject:
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    Post subject: Re: Include a trailler in this file, with the total of recor
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 Moderator


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

PostPosted: Sat Oct 07, 2006 9:35 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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    Post subject: Re: Include a trailler in this file, with the total of recor
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    Post subject:
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 Moderator


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

PostPosted: Mon Oct 09, 2006 9:19 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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