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

Checking the total counts inside a record file.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sam07Sam
Currently Banned

New User


Joined: 16 Dec 2020
Posts: 1
Location: India

PostPosted: Wed Dec 16, 2020 8:36 pm
Reply with quote

Hi,
I have one control file in the below layout format.The record length is 100 and one Flat Date parm file(layout of timestamp 20201211055202)

Basically, my requirement is to compare the GRAND total of control file-1 with the sum of individual .dat file record counts(total 5 files given below with record count) and make sure it is same. if not some RC should pop.

2nd Req: Once the above step runs fine, I have to make sure the Flat file timestamp is the same as the previous session run timestamp and less than incremental Load timestamp else return code.

3rd req: Once the 2nd step runs fine,I have to replace the Flat file timestamp with the Incremental Load timestamp of Control file-1.and for subsequent next day run with Control file-2 and so on...

Control file1 layout:

Code:
GRAND TOTAL=00000000000042669177
Previous session run timestamp=11110101000000
Incremental load timestamp=20201211055202
SPS_OB_IND_PROV_FULL_FILE_V1.0_20201130071138_001.dat  00008533835   [u] (Pos will start from 81 col to 91 col in same line)[/u]                     
SPS_OB_IND_PROV_FULL_FILE_V1.0_20201130071138_002.dat                           00008533836
SPS_OB_IND_PROV_FULL_FILE_V1.0_20201130071138_003.dat                           00008533836
SPS_OB_IND_PROV_FULL_FILE_V1.0_20201130071138_004.dat                           00008533836
SPS_OB_IND_PROV_FULL_FILE_V1.0_20201130071138_005.dat                           00008533834

Coded for you
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1245
Location: Bamberg, Germany

PostPosted: Wed Dec 16, 2020 9:44 pm
Reply with quote

And you have tried what by yourself? Samples/Attempts/Anything?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Dec 17, 2020 2:38 am
Reply with quote

JCL cannot do this and you have not mentioned VSAM so why post in this section of the forum? I suggest that you decide how this requirement is to be achieved (COBOL/PL/1/Rexx/some other programming language/standard utility) and let us know so that this topic can be moved to a more appropriate part of the forum.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Thu Dec 17, 2020 4:10 am
Reply with quote

Welcome!!
You have to provide relevant input data and expected output data based on your description. Please do that.
Second for each of these simple requirements its very simple to search similar post on this forum or on internet to get clue how it can be done.
Third , try something from your research and let us know where you get struck and we will help you.
You can start from here- MAke your header total sum as trailer by assigning highest sequence number
Abend JCL if header count does not match total no of records
Comparing record counts in a file with trailer record count
Syncsort Check for header, trailer & count
Validating the Trailer in DFSORT
or write a COBOL or any choice of program and you will be done in couple of hours. Its simple.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Thu Dec 17, 2020 7:19 pm
Reply with quote

Sam07Sam wrote:
Hi,
I have one control file in the below layout format.The record length is 100 and one Flat Date parm file(layout of timestamp 20201211055202)

Basically, my requirement is to compare the GRAND total of control file-1 with the sum of individual .dat file record counts(total 5 files given below with record count) and make sure it is same. if not some RC should pop.

2nd Req: Once the above step runs fine, I have to make sure the Flat file timestamp is the same as the previous session run timestamp and less than incremental Load timestamp else return code.

3rd req: Once the 2nd step runs fine,I have to replace the Flat file timestamp with the Incremental Load timestamp of Control file-1.and for subsequent next day run with Control file-2 and so on...

Control file1 layout:

Code:
GRAND TOTAL=00000000000042669177
Previous session run timestamp=11110101000000
Incremental load timestamp=20201211055202
SPS_OB_IND_PROV_FULL_FILE_V1.0_20201130071138_001.dat  00008533835   [u] (Pos will start from 81 col to 91 col in same line)[/u]                     
SPS_OB_IND_PROV_FULL_FILE_V1.0_20201130071138_002.dat                           00008533836
SPS_OB_IND_PROV_FULL_FILE_V1.0_20201130071138_003.dat                           00008533836
SPS_OB_IND_PROV_FULL_FILE_V1.0_20201130071138_004.dat                           00008533836
SPS_OB_IND_PROV_FULL_FILE_V1.0_20201130071138_005.dat                           00008533834

Coded for you


This post sounds like a Statement Of Work given by yourself to the members of this forum? As if you had been assigned a manager to control our activity, isn’t it?
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Dec 18, 2020 3:38 pm
Reply with quote

Quote:
if not some RC should pop.


... and how to make a return code "pop" ??

Garry.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top