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
 

 

How to write record count in header??

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sandy_mcs

New User


Joined: 01 Apr 2006
Posts: 17
Location: Pune

PostPosted: Wed Jul 18, 2007 5:30 pm    Post subject: How to write record count in header??
Reply with quote

I have a sequential file sorted on key 40,9 of record length 118 and now i want to take the record count in header part.
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: Wed Jul 18, 2007 7:56 pm    Post subject:
Reply with quote

It's not clear what exactly you want to do. You need to give more detailed information.

Show an example of the records in your input file (relevant fields only) and what you expect for output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of the relevant input fields.
Back to top
View user's profile Send private message
sandy_mcs

New User


Joined: 01 Apr 2006
Posts: 17
Location: Pune

PostPosted: Thu Jul 19, 2007 9:56 am    Post subject: It's as below..
Reply with quote

I am fetching data from tables in my JCL and writing in file, but as per the requirement output file should have a header which is of a fixed structure and in that header record count is also there, previously merge was enough because header was not containing record count,
Record Format : FB
LRECL : 120

Record format is as shown below:
LAST_NAME DATE_BRTH CARD_NO HOUSE NUMBER
------------------------------------------------------------------------------------
MCSPARRON 05.10.1977 000136704 1 GREYSTONE PARK
FERRAR 30.12.1975 000183090 BULL LANE
SINCLAIR 29.05.1965 000203204 62 LEABANK ROAD
BEAL 23.07.1920 000226180 15 ST LEONARDS CLOSE

PSTL_CODE LAST_NAME TIME_ADD
-------------------------------------------------------------------
BT49 0EG OWEN 2006-03-07-22.48.57.311301
SL9 8RU WARREN 2005-01-06-11.17.01.704948
DY2 0BB MARK 2002-02-11-14.30.49.255965
YO17 7EW I 2005-05-26-22.49.50.217817


The header should be as below :

TRI/ Current_Date/ Record Count

where, TRI is fixed, current date i will take from a file, but the record count along with these two is what i want to know!
Back to top
View user's profile Send private message
sandy_mcs

New User


Joined: 01 Apr 2006
Posts: 17
Location: Pune

PostPosted: Thu Jul 19, 2007 3:07 pm    Post subject: Solution is here!
Reply with quote

Thank's Frank, your "smart DFSORT tricks" helped me out and i got the solution to my query
The JCL i used to get count of records present in SORTIN in to SORTOUT.

//BOYSG414 JOB (1,SANDEEP),'TESTING',
// USER=BOYSG4,LINES=9999,NOTIFY=&SYSUID,
// CLASS=R,MSGCLASS=T,REGION=40M
//PGM1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=SMOM.SORT3.OUT,DISP=SHR
//SORTOUT DD DSN=SMOM.SORT.ICEOUT,DISP=SHR
//*DFSMSG DD SYSOUT=*
//*SYSPRINT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL NODETAIL,REMOVECC,
TRAILER1=(COUNT=(M11,LENGTH=4))
/*
//
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Jul 19, 2007 3:15 pm    Post subject:
Reply with quote

Sandy_mcs,

Quote:
The header should be as below :

TRI/ Current_Date/ Record Count


Quote:
OUTFIL NODETAIL,REMOVECC,
TRAILER1=(COUNT=(M11,LENGTH=4))


How did you get records count in Header when you had used TRAILER1 in the JCL?

Its good to read you had achieved your requirement. But still want to know.
Back to top
View user's profile Send private message
sandy_mcs

New User


Joined: 01 Apr 2006
Posts: 17
Location: Pune

PostPosted: Thu Jul 19, 2007 4:31 pm    Post subject: Re: How to write record count in header??
Reply with quote

Murali,
In my case it was mandetory to write record count in header part and technical stuff doesnot support to write record counter in header, so i found it better to take the counter in separate file and then merge it with header using outrec field.
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: Thu Jul 19, 2007 8:19 pm    Post subject:
Reply with quote

I would have created a DFSORT symbol for the counter and then used that DFSORT symbol to put the counter into the header.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Jul 20, 2007 11:52 am    Post subject:
Reply with quote

Frank,

Quote:
I would have created a DFSORT symbol for the counter and then used that DFSORT symbol to put the counter into the header.


You mean to say using SYMNAMES statement. But perfomance wise which is best since sandy's approach as well as your approach require two steps for writing the record count in the header.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Jul 20, 2007 12:44 pm    Post subject:
Reply with quote

murmohk1
Quote:
since sandy's approach as well as your approach require two steps

sandy_mcs is half way through!
However Sandy has extracted the COUNT, further dont know how to write it as a header icon_confused.gif
So, here after Sandy needs franks help in writing the header.

Hence, u find no 2 approches here. Just the thing is if you are using SYMNAMES approach, u will be using the o/p extracted from sandy_mcs, as the i/p to SYNAMES in next step.
u can see an example here http://ibmmainframes.com/viewtopic.php?t=21562&postdays=0&postorder=asc&start=15
But my idea was if the DATE field in the header was CURRENT(RUN) date then no need of SYMNAMES, U can build the whole HEADER in the same step where you are extracting the count, and concatenate it with the set of detail records in the next step.
However this also takes 2 steps icon_eek.gif , but avoids over head in building the header by reading the DATE field from some other file.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Jul 20, 2007 1:54 pm    Post subject:
Reply with quote

Krisprems,

Quote:
However Sandy has extracted the COUNT, further dont know how to write it as a header


Using TRAILER1 option, Sandy created a record (only one record) with record count. Say this as FILE1. In the next step, he concatenated FILE1 with the actual data.

Quote:
But my idea was if the DATE field in the header was CURRENT(RUN) date then no need of SYMNAMES

You are right. But Sandy requires record count in the Header which cannot be achieved through HEADER1 option. So he followed the above mehtod.

Quote:
However this also takes 2 steps , but avoids over head in building the header by reading the DATE field from some other file.

Both Frank and Sandy approach require 2 steps (as I said before). Just wanted to know which is efficient.
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: Fri Jul 20, 2007 8:28 pm    Post subject:
Reply with quote

Quote:
You mean to say using SYMNAMES statement


You create the DFSORT symbol in the first step and use it via the SYMNAMES data set in the second step.

Quote:
But perfomance wise which is best


The only way to know that for a particular case is to try both ways and compare.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Write R1 and R2 to OP1 and R1 to OP2 bhaskar_kanteti DFSORT/ICETOOL 10 Fri Mar 03, 2017 11:18 am
No new posts Can you write 2 recs on SORTOUT when ... Sysaron DFSORT/ICETOOL 6 Thu Feb 23, 2017 12:07 am
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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