MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Counting number of records and writing it out on a file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
eskaysem
Beginner


Joined: 31 Mar 2003
Posts: 29
Topics: 13

PostPosted: Fri Oct 05, 2007 4:06 pm    Post subject: Counting number of records and writing it out on a file Reply with quote

Hello,
I have been searching the past posts for this issue, but haven't got onto one which really pin points it.
I want to read a file, and write out how many records(9 byte wide and should have leading zeros) are there in another file. I as well want the current date in the output file.

so, my output file should look like

MM/DD/YYYY000004534

Any help on the issue is greatly appreciated.

Thank you,
Santosh
_________________
Thanks!,
Santosh Kulkarni
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Oct 05, 2007 4:51 pm    Post subject: Reply with quote

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

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB)
//SORTOUT DD DSN=...  output file (FB/19)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    BUILD=(19X),
    TRAILER1=(DATE=(MD4/),COUNT=(M11,LENGTH=9))
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
eskaysem
Beginner


Joined: 31 Mar 2003
Posts: 29
Topics: 13

PostPosted: Mon Oct 08, 2007 9:07 am    Post subject: Reply with quote

Amazing DFSORT. Worked perfectly fine!! Thank you Frank for the help.

Santosh
_________________
Thanks!,
Santosh Kulkarni
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group