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

VSAM COUNT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Tue Feb 26, 2013 4:02 am
Reply with quote

Hi,

I have a VSAM online file whose record gets cleared each moment but sometime it is not cleared. So, now I have kept the threshold limit of the record count as 100. If it reaches 100 then I will get an email that the file has more than 100 records. So basically what I am doing is mentioned as below:

My Main file is ABHIJIT.VSAM.MAIN file which has
Code:
DEFINE CLUSTER-                           
       (NAME(ABHIJIT.VSAM.MAIN)-           
       FREESPACE(25,25)-                 
       OWNER(ATM)-                       
       UNIQUE-                           
       RECORDSIZE(1000,2500)-             
       SHR(2,3)-                         
       KEYS(25,0))-                       
       DATA-                             
       (NAME(ABHIJIT.VSAM.MAIN.DATA)-     
       CYL(1000,1000))-                   
       INDEX-                             
       (NAME(ABHIJIT.VSAM.MAIN.INDEX)-     
       CYL(20,10))


Steps:
1) Copy the ABHIJIT.VSAM.MAIN file to the temporary file ABHIJIT.VSAM.TEMP with the same above mentioned definition using the below card
Code:
REPRO INFILE(INPUT1) OUTFILE(OUTPUT1) SKIP(1) COUNT(100)

2) Wait for 1 minute
Code:
//HALT0002 EXEC PGM=HALT,PARM='1M'

3) Again perform the step 1
4) If the RC of step 3 is 12 then send the email mentioning "Threshold limit reached".

But now there is a change in a requirement Not only the threshold email is needed but also the total number of records in the main VSAM file is needed.
Now I am wondering how I can get the number of records present in the main VSAM file without closing the file.
Kindly suggest.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 26, 2013 7:17 am
Reply with quote

If you do not close the file to the online system, you CANNOT get an accurate count of the records in the VSAM file. CICS may cache data, for hours potentially, and complete updates when the file is closed or the online system comes down.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Tue Feb 26, 2013 12:23 pm
Reply with quote

Hi Robert,
Thanks for your update. But I need the count when the file is not getting cleared.Is it possible to get the count by using REPRO.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Feb 26, 2013 12:32 pm
Reply with quote

Please explain the operation more clearly. What is the purpose of the file? How does it get "cleared"? Why does it sometimes not get cleared? When running your batch jobs is it open/closed to CICS? All of the time? Some of the time? Etc.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Tue Feb 26, 2013 1:12 pm
Reply with quote

Hi Bill,
The file is always open in the CICS and sometime due to socket down the file records are not cleared and in that case the CICS team bounces the region. So, to automate the process the batch job runs in every one hour and based on the alert email the CICS team will bounce the socket.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Feb 26, 2013 1:22 pm
Reply with quote

Well, as Robert has said, you're not going to get a reliable count of records from a simple batch job if the file is still open to CICS.

Is there no way that the "socket" can be monitored for availability? The must be some message or other symptom that the socket is "down".

What do you mean "bounce" the region and "bounce" the socket?
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Tue Feb 26, 2013 2:05 pm
Reply with quote

Hi Bill,
The file is always open in the CICS and sometime due to socket down the file records are not cleared and in that case the CICS team bounces the region. So, to automate the process the batch job runs in every one hour and based on the alert email the CICS team will bounce the socket.
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 590
Location: London

PostPosted: Tue Feb 26, 2013 2:25 pm
Reply with quote

This seems like a bizarre process. What is it supposed to achieve? Is the purpose to create an almost up to date copy of the source MAIN file in your TEMP version for some batch process to use? How are the records in the MAIN file 'cleared'?

Suggest you read 'VSAM Demystified' manual to understand what you and cannot do with online CICS files.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Feb 26, 2013 2:35 pm
Reply with quote

CICS socket errors are accompanied by CICS messages. So the way to automate error handling is trapping the relevant messages and act accordingly. This can be done in NETVIEW, Tivoli CICS monitoring or SA/390. Ask your CICS support if thats possible. Im not sure they will understand cause you are using a procedure they are content with and maybe supplied by them.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 26, 2013 3:27 pm
Reply with quote

Quote:
Is it possible to get the count by using REPRO.
Yes, you can get the count using REPRO. However, as long as the file is open in CICS, the count you get using REPRO (OR ANY OTHER BATCH TOOL) will not be an accurate count, period. There is nothing you can do to change this, except close the file in CICS then get your count then open the file to CICS.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Feb 26, 2013 3:35 pm
Reply with quote

in IT using the proper terminology is essential for good communication ...

Your usage of the term socket is pretty puzzling ...

<socket> has a very exact meaning...

wiser to explain what You mean an probably use a different term

also it is very odd to use an email to signal an <abnormal> situation
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Tue Feb 26, 2013 4:33 pm
Reply with quote

Hi,
Apology for the late response. The transaction gets the messages from frontend and then the CICS program processes the messages and sents the response/notification back to the frontend and the other system. Those response are stored in the file and they get cleared once they are sent. So, sometime the sockets from the frontend or CICS region are down but dont know who is down as blame game between the fronend and CICS is going on and the messages don't get cleared. Meanwhile the CICS team is also looking into this issue.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 26, 2013 6:44 pm
Reply with quote

Quote:
So, sometime the sockets from the frontend or CICS region are down but dont know who is down as blame game between the fronend and CICS is going on
You make no sense at all. From the z/OS V1R7.0 Comm Svr: IP Sockets Application Programming Interface Guide and Reference manual:
Quote:
1.1.2 Understanding sockets concepts A socket uniquely identifies the endpoint of a communication link between two application ports. | A port represents an application process on a TCP/IP host, but the port | number itself does not indicate the protocol being used: TCP, UDP, or IP. | The application process might use the same port number for TCP or UDP | protocols. To uniquely identify the destination of an IP packet arriving | over the network, you have to extend the port principle with information | about the protocol used and the IP address of the network interface; this | information is called a socket. A socket has three parts: protocol, | local-address, local-port. Figure 2 illustrates the concept of a socket.


PICTURE 2



Figure 2. Socket concept



The term association is used to specify completely the two processes that comprise a connection: (protocol,local-address,local-port,foreign-address,foreign-port). The terms socket and port are sometimes used as synonyms, but note that the terms port number and socket address are not like one another. A port number is one of the three parts of a socket address, and can be represented by a single number (for example, 1028) while a socket address can be represented by (tcp,myhostname,1028). | A socket descriptor (sometimes referred to as a socket number) is a binary | integer that acts as an index to a table of sockets; the sockets are | currently allocated to a given process. A socket descriptor represents the | socket, but is not the socket itself.
A "socket" is very specifically defined in z/OS, and the way you are using the term does NOT correspond to that definition. I suspect you mean the PORT between the front end and CICS is not connected;since sockets are designed to be dynamic (used only while needed), if your system design depends upon the connection being permanently available then part of the issue may well be that your design goes contrary to the way the system is suppsoed to work.

Furthermore, if a connection is made to a CICS port, a mesage is generated in the log. If the connection later dies (for whatever reason) there is also a message generated in the log. If there is controvery over the connection closing then it is because someone is not reviewing the logs.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Tue Feb 26, 2013 9:57 pm
Reply with quote

To the experts...
I am checking the manuals now but I am not able to find anything... So I am not entirely confident... but if I remember correctly, wasn't there a file attribute which says the file update in CICS need not be cached and the CICS file can be immediately updated...
If there is an attribute as such, wouldn't that help the TS in this case ?


abhijit,
You could do a quick CICS file CLOSE and OPEN in the Batch before the REPRO step. I dont think this is an ideal solution but it would work in your case I guess...
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Feb 26, 2013 10:03 pm
Reply with quote

It will be much better to find a way to monitor the existence of the problem "socket", whatever that be.

Closing the file to CICS will probably cause the "upstream" transaction to fail even when the socket is operating tickety-boo.

If a record is "added" then "deleted" (so that there is only intended to be one record on the file, as I understand it) then forcing a physical write (and perhaps read, I don't know) may impact performance.
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Tue Feb 26, 2013 10:38 pm
Reply with quote

enrico-sorichetti wrote:

also it is very odd to use an email to signal an <abnormal> situation

Why?

Our team does this process for all major daily testing cycle jobs that have successors. We sure as heck do NOT want all emails when a job runs to successful completion! My inbox would be full every day. If a major job fails (not successful completion) our team gets an Outlook email and optional iPhone message.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Feb 26, 2013 10:41 pm
Reply with quote

most probably I used the wrong term I should have used emergency rather than abnormal

because an email does not guarantee the appropriate response/reaction time
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Tue Feb 26, 2013 11:59 pm
Reply with quote

Hi,
It seems we went more into socket issue. But I can't close and open the file in every three hours as my job runs in every 2 hours. But the funny thing I am doing after the day cut off I am closing the file and taking the backup of the file, disabling the CICS transaction ABC* involved with the program, purging the tasks related (CEMT I TASK TRA(ABC*) and then deleting and defining the file, opening and enabling the file, starting the CICS transaction. As after the cut off the batch system runs and updates the whole system. So, if the file records are not cleared before cutoff then there are chances of duplicate update.

I have the batch job ready for the above process but dont know how purge CICS task in batch. So, performing the above process manually.
Anyway i have made them agreed that giving the count of records is not wise so now they are agreed that they dont need the count.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Wed Feb 27, 2013 12:06 am
Reply with quote

Using email because we dont want to abend the job when the RC is 12 for the last copy step. As everybody is working on this issue and once the system gets stable we will abend the job when RC is 12 as a permanent fix instead of sending email.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Wed Feb 27, 2013 12:30 am
Reply with quote

there is a typo error with the hours. My job runs in every three hours.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Wed Feb 27, 2013 1:04 am
Reply with quote

Hi,
Is it possible to purge CICS task in batch.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Feb 27, 2013 1:23 am
Reply with quote

abhijit.nayak01 wrote:
Hi,
Is it possible to purge CICS task in batch.
If you are looking for a detailed answer for this I would suggest you to start a new topic... Anyway... There are lot of tools which can be used to communicate to CICS in batch ... EXCI is one that I know of .. MTPBATCH is a utility from MacKinney... and there are many other third party tools .. there are lot of discussions already available about that in this forum... You can check with your site people and they should be able to provide you the best way of communicating to CICS in batch...
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Wed Feb 27, 2013 1:29 am
Reply with quote

abhijit.nayak01 wrote:
disabling the CICS transaction ABC* involved with the program, purging the tasks related (CEMT I TASK TRA(ABC*)
icon_rolleyes.gif ... Hmm... So you just go and purge a active task while its running in production... I would have to say that it is not a good process...
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Feb 27, 2013 4:54 am
Reply with quote

Quote:
Is it possible to purge CICS task in batch.

I think you need to go back to square one and redesign this entire process....
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Wed Feb 27, 2013 11:26 am
Reply with quote

Good Morning,
Thanks for your suggestions. I know purging the task in prod is not a good practice but this is only for some days.
I will look into the EXCI for purging the tasks in batch.
Thanks for your valuable inputs.
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 CA7 count with DATE variable CA Products 0
No new posts VSAM LISTCAT INFORMATION JCL & VSAM 2
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top