IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To find whether record count are true or not.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 147
Location: India

PostPosted: Tue Dec 19, 2023 5:39 pm
Reply with quote

Hi all,

I have requirement where i have a ps file which contains date part as below.

File 1 contain date part at position 1 to 10

Code:
 Command ===>                                       
 =COLS> ----+----1----+----2----+----3----+----4----
 ****** ***************************** Top of Data **
 000001 2023-12-01                                 
 ****** **************************** Bottom of Data


and another file which is as below.

File2: contains date at position. 11 to 20 and also last record in this file contains the record count excluding the first and last record.

Code:

 Command ===>                                                 
 =COLS> ----+----1----+----2----+----3----+----4----+----5----
 ****** ***************************** Top of Data ************
 000001 10009081492023-12-01N                                 
 000002 5124648490579001     M1362972023-12-01DSLN+0000000634.
 000003 5124648490579701     M1362982023-12-01DSLN+0000000353.
 000004 5345255752581676     M1367282023-12-01DSLN+0000000074.
 000005 5345655752589801     M1367292023-12-01DSLN+0000000045.
 000006 5155228975001276     M1367772023-12-01DSLN+0000000170.
 000007 5945207942191472     M1368952023-12-01DSLN+0000000054.
 000008 5945207942191372     M1368962023-12-01DSLN+0000000062.
 000009 5945207942191272     M1368982023-12-01DSLN+0000000078.
 000010 90009081492023-12-01000001107                         
 ****** **************************** Bottom of Data **********



My requirement is i am doing validation for whether the date in file1 and file 2 are matching or not and the record count in file2 which is mentioned at position 21 to 29 in the last record are correct or not.

This could be possible with two steps.
step1> to identify the whether dates are matching or not.
step2> record count in file2 mentioned in the last record are true or not.

please help me with sort card here or any reference soluion in this forum.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2120
Location: USA

PostPosted: Tue Dec 19, 2023 5:44 pm
Reply with quote

What did you try so far?

Hint: read something about JOIN operation in SORT utility.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2120
Location: USA

PostPosted: Tue Dec 19, 2023 5:49 pm
Reply with quote

Digvijay Singh wrote:

please help me with sort card here or any reference soluion in this forum.

When translated to plain English it sounds like:
Quote:
Please, do my job for myself
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 147
Location: India

PostPosted: Tue Dec 19, 2023 6:20 pm
Reply with quote

Okay,

I was looking for a hint. my bad for that sentence.

The first part of the requirements i have done using sort step.

I extracted the first and last record of the file and compared the date and included step to match the date. I am only stuck at second part which is to verify the record count.

My trailer record has not string to identify it that is why facing problem to find whether the record count is correct or not. Please help me with only second part which is to validate the record count is correct or not i have found way to validate the date part.
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 147
Location: India

PostPosted: Tue Dec 19, 2023 7:22 pm
Reply with quote

I am only looking for the second part of the requirement now.

To validate the record count is true or not. I am trying to write a sort card but not able to find a way to identify the last record of the file2 so that i can add the seq num and validate the record count if "TRAILER or T stirng would have mentioned i could write sort card for that but there is nothing has been mentioned in the trailer record.

a longer way is to remove first and last record and count the actual record in a ps file and then compare that record count value with the last record of the file.

is there any shorter way of doing it in one single step..?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2120
Location: USA

PostPosted: Tue Dec 19, 2023 10:00 pm
Reply with quote

Digvijay Singh wrote:
Okay,

I was looking for a hint. my bad for that sentence.

The first part of the requirements i have done using sort step.

I extracted the first and last record of the file and compared the date and included step to match the date. I am only stuck at second part which is to verify the record count.

My trailer record has not string to identify it that is why facing problem to find whether the record count is correct or not. Please help me with only second part which is to validate the record count is correct or not i have found way to validate the date part.

Please, demonstrate here YOUR ACTUAL CODE: what you have done, how you did that, and demonstrate your copied actual results, too.

Then something can be discussed. Otherwise it is as I mentioned above: "Please, do my job for myself"

P.S.
I cannot find the record count field in your last record. What to compare???
Positions 21-29 contain 000001107, but the number of records is 8 - ???
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2120
Location: USA

PostPosted: Wed Dec 20, 2023 1:43 am
Reply with quote

One more hint, but without real code - to make you think a little bit.
When using SORT utility, create two files in one step.

1. Intermediate file. Use JOINKEYS, JOIN, and REFORMAT statements to create this file.
At the end it is not needed, but may be useful during debugging:
Code:
********************************* TOP OF DATA ******************************************************
*-------------initial data---------------------------|aligned date|     join-->|J|-reccnt-|baddate-|
10009081492023-12-01N                                 2023-12-01                B000000000000000000
5345655752589801     M1367292023-XX-01DSLN+0000000045.2023-XX-01                2000000001000000001
5124648490579001     M1362972023-12-01DSLN+0000000634.2023-12-01                B000000001000000000
5124648490579701     M1362982023-12-01DSLN+0000000353.2023-12-01                B000000001000000000
5345255752581676     M1367282023-12-01DSLN+0000000074.2023-12-01                B000000001000000000
5155228975001276     M1367772023-12-01DSLN+0000000170.2023-12-01                B000000001000000000
5945207942191472     M1368952023-12-01DSLN+0000000054.2023-12-01                B000000001000000000
5945207942191372     M1368962023-12-01DSLN+0000000062.2023-12-01                B000000001000000000
5945207942191272     M1368982023-12-01DSLN+0000000078.2023-12-01                B000000001000000000
90009081492023-12-01000001107                         2023-12-01                B000000000000000000
******************************** BOTTOM OF DATA ****************************************************


2. Final (report) file. The only result you need to produce from SORT. Use TRAILER1= parameter
Code:
********************************* TOP OF DATA *******************************
REPORTED COUNT=000001107   REAL COUNT=000000008   DATE MISMATCH=000000001   
******************************** BOTTOM OF DATA *****************************
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts how to complete the end of a record w... DFSORT/ICETOOL 2
No new posts Sort based on the record type DFSORT/ICETOOL 1
No new posts CA7 count with DATE variable CA Products 0
No new posts Get RECORD LENGTH, allocated space of... CLIST & REXX 7
No new posts sort to find out the char which repea... Mainframe Interview Questions 10
Search our Forums:

Back to Top