Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Query to populate Count on Trailer record

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

New User


Joined: 11 Dec 2007
Posts: 26
Location: INDIA

PostPosted: Fri Jul 09, 2010 12:12 pm    Post subject: Query to populate Count on Trailer record
Reply with quote

Hi,

I have 2 file say with 10 records each
File 1 :-
Record1
Record2
Record3
Record4
Record5
Record6
Record7
Record8
Record9
Record10

File 2 :-
Record1
Record2
Record3
Record4
Record5
Record6
Record7
Record8
Record9
Trailer record

Trailer Record = 'shop name, product name,account'

I have to concat two file and display total no of counts in 3rd file.

When i Contact /Merge two file using sort i have the O/P as follows :-

Record1
:::
:::
:::
Record19
Trailer record

As my requiremt says to display count also in Trailer record so i will have to modify my trailor record as

'COUNT shop name, product name,account'

when i use the following SORT CARD it will provide me the total no of counts but at the bottom of the O/P file that ie 3rd file

TRAILER1=(COUNT=(M10,LENGTH=10))

so the O/P will be as follows

Record1
:::
:::
:::
Record19
Trailer record
COUNT

But my requirement is to populate Count in trailor record only what i mean to say is that the Trailor Record Should be as follows :-
'COUNT shop name, product name,account'

Please advise how to achieve this situation. It will be highly appreciated.
Thank you in Anticipation of response.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Jul 09, 2010 12:15 pm    Post subject:
Reply with quote

Because the solution for sort related questions may vary from product to product, please ensure that you state clearly which sort product you are using.

If you are not sure, then by running a simple sort step shown below, you will be able to find out for yourself.

If the messages start with ICE then your product is DFSORT and the topic will be moved to the DFSORT forum by one of the moderators. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.

If the messages start with WER or SYT then the product is SYNCSORT and the topic will remain in the JCL forum. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.

Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in your site.

Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY


You also need to provide more detail than you already have.
The RECFM & LRECL of the input and output files.
The position, length and format of the key fields.
Back to top
View user's profile Send private message
harsh singh

New User


Joined: 11 Dec 2007
Posts: 26
Location: INDIA

PostPosted: Fri Jul 09, 2010 12:23 pm    Post subject:
Reply with quote

Hi EXPAT,

I am using DFSORT and DCB of Both I/P and O/P files are same and both the files are already sorted on their key field.

Problem lies in Populating Count in Trailor Field

When i execute the below card
//SYSIN DD *
SORT FIELDS=COPY
TRAILER1=(COUNT=(M10,LENGTH=10))
/*

My Output will be as follows :-

Record1
:::
:::
:::
Record19
Trailer record
COUNT

[ File 1 has 10 records and File 2 has 10 records]

but i want my O/p as :-

Record1
:::
:::
:::
Record19
Count,Trailer record

Hope you get what i want to mean.

Thank You
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Jul 09, 2010 12:41 pm    Post subject:
Reply with quote

expat wrote:
Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.

You also need to provide more detail than you already have.
The RECFM & LRECL of the input and output files.
The position, length and format of the key fields.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Fri Jul 09, 2010 12:49 pm    Post subject:
Reply with quote

deleted by dbz
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 09, 2010 8:21 pm    Post subject:
Reply with quote

Harsh,

It's really not clear what you want to do. It's especially not clear what the original trailer record looks like and what you want the new trailer record to look like, and whether there's something in the trailer record that identifies it (e.g. '9' in position 1).

Please show an example of the actual records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files.
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us