View previous topic :: View next topic
|
Author |
Message |
sandy_mcs
New User
Joined: 01 Apr 2006 Posts: 17 Location: Pune
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
sandy_mcs
New User
Joined: 01 Apr 2006 Posts: 17 Location: Pune
|
|
|
|
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 |
|
|
sandy_mcs
New User
Joined: 01 Apr 2006 Posts: 17 Location: Pune
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
|
sandy_mcs
New User
Joined: 01 Apr 2006 Posts: 17 Location: Pune
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
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
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 , but avoids over head in building the header by reading the DATE field from some other file. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|