Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

VSAM COUNT
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
abhijit.nayak01

Active User


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

PostPosted: Tue Feb 26, 2013 4:02 am    Post subject: VSAM COUNT
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: 7913
Location: Bellevue, IA

PostPosted: Tue Feb 26, 2013 7:17 am    Post subject:
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: 157
Location: South Africa

PostPosted: Tue Feb 26, 2013 12:23 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue Feb 26, 2013 12:32 pm    Post subject: Reply to: VSAM COUNT
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: 157
Location: South Africa

PostPosted: Tue Feb 26, 2013 1:12 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue Feb 26, 2013 1:22 pm    Post subject: Reply to: VSAM COUNT
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: 157
Location: South Africa

PostPosted: Tue Feb 26, 2013 2:05 pm    Post subject:
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 User


Joined: 31 Dec 2009
Posts: 437
Location: London

PostPosted: Tue Feb 26, 2013 2:25 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Tue Feb 26, 2013 2:35 pm    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Tue Feb 26, 2013 3:27 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Feb 26, 2013 3:35 pm    Post subject: Reply to: VSAM COUNT
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: 157
Location: South Africa

PostPosted: Tue Feb 26, 2013 4:33 pm    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Tue Feb 26, 2013 6:44 pm    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue Feb 26, 2013 10:03 pm    Post subject: Reply to: VSAM COUNT
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    Post subject: Re: Reply to: VSAM COUNT
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Feb 26, 2013 10:41 pm    Post subject: Reply to: VSAM COUNT
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: 157
Location: South Africa

PostPosted: Tue Feb 26, 2013 11:59 pm    Post subject:
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: 157
Location: South Africa

PostPosted: Wed Feb 27, 2013 12:06 am    Post subject:
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: 157
Location: South Africa

PostPosted: Wed Feb 27, 2013 12:30 am    Post subject:
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts VSAM define for large file jerryte JCL & VSAM 9 Wed Oct 05, 2016 1:51 am
No new posts CICS VSAM RLS READ akodakka CICS 3 Tue Oct 04, 2016 3:09 pm
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us