IDCAMS Utiility



Ask queries about other IBM Tools like Tivoli, COBTEST, Fault Analyzer, z/OS File Manager, Workload Simulator, APA, SCLM, Merge & Migration Tools etc...

IDCAMS Utiility

Postby navennaik » Thu Apr 23, 2009 3:58 pm

Hello,

In my procedure step I have found the sysin ststement as below.

PRINT INFILE(IDCAMI) COUNT(3)

Where IDCAMI is the input files logical name. This utility is used for finding out whether the input file is empty or not , by giving the RC=04 if the file is empty.

How this SYSIN statement works.I mean What is the meaninig of COUNT(3) in the above SYSIN statement and how this works in finding out the file is empty or not.

Please Help me out.

Thanks,
Naveen
navennaik
 
Posts: 8
Joined: Thu Feb 26, 2009 7:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: IDCAMS Utiility

Postby swd » Thu Apr 23, 2009 4:16 pm

The COUNT(3) means print the first 3 records of the dataset. It will give a RC=4 if there are 0,1 or 2 records in the file, so to use this to check if the file is empty is not quite correct as if there are 1 or 2 records in the file it will still give RC=4 because there are not enough records in the file, so it gives you a warning.

Specify COUNT(1) will be better to check if the file is empty, as if there are 1 or more records in the file you get RC=0, if there are no records in the file you get RC=4.

Hope this helps
CHeers
Steve
User avatar
swd
 
Posts: 109
Joined: Wed Feb 18, 2009 9:18 pm
Location: UK
Has thanked: 0 time
Been thanked: 0 time

Re: IDCAMS Utiility

Postby navennaik » Thu Apr 23, 2009 5:24 pm

Thank you So much ,
Naveen.
navennaik
 
Posts: 8
Joined: Thu Feb 26, 2009 7:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: IDCAMS Utiility

Postby sinmani » Mon Jun 04, 2012 4:22 pm

Suppose I have a file with headers and Trailers.

I want that if only 1 trailer is present in the entire file No processing should be done.

How can we achieve this using IDCAMS??
-----------------------------------------
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
sinmani
 
Posts: 93
Joined: Thu Mar 22, 2012 10:02 am
Has thanked: 14 times
Been thanked: 0 time

Re: IDCAMS Utiility

Postby Robert Sample » Mon Jun 04, 2012 4:45 pm

No processing should be done.
What does this mean? If you do NO processing, then you cannot use a computer AT ALL to do this, so it becomes totally and completely IMPOSSIBLE. Further, to do it -- with IDCAMS or any other program -- will require knowing what identifies a header record, what identifies a trailer record, and what identifies detail records.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: IDCAMS Utiility

Postby sinmani » Mon Jun 04, 2012 6:20 pm

It means the software should not be executed and all other steps bypassed. Just check in first step if only one trailer is there and if yes bypass all other steps.

Header and trailer could be like Header = *****Name, account No, Amount Wealth in header
and Trailer ***** continue on next page >>>
-----------------------------------------
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
sinmani
 
Posts: 93
Joined: Thu Mar 22, 2012 10:02 am
Has thanked: 14 times
Been thanked: 0 time

Re: IDCAMS Utiility

Postby Robert Sample » Mon Jun 04, 2012 7:01 pm

Just check in first step if only one trailer is there
This REQUIRES a software program be executed.

What you want to do cannot be done, period.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: IDCAMS Utiility

Postby dick scherrer » Tue Jun 05, 2012 8:04 am

Hello,

Suggest you consider using your sort product or actually writing some code (i.e. COBOL or Easytrieve are quie common).

IDCAMS has some features, but it is not intended to be a programming language.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: IDCAMS Utiility

Postby sinmani » Tue Jun 05, 2012 5:51 pm

Hmm okkk,

I am thinking if I can consider to include how many records I am expecting per page.

Suppose each page has 1 header + 20 records + 1 trailer= 22.

So if I code INFILE(INDAMI) COUNT (22)

So if now records is greater than 22 then I will get RC = 4 or else 0.

So I proceed for RC = 4 and If RC= 0 bypass all furthur steps.
-----------------------------------------
As long as you think you are a student, you are doing well.
The day you consider yourself as the master of the game..........well
sinmani
 
Posts: 93
Joined: Thu Mar 22, 2012 10:02 am
Has thanked: 14 times
Been thanked: 0 time

Re: IDCAMS Utiility

Postby NicC » Tue Jun 05, 2012 6:02 pm

No - if count is greater than 22 you will get a return code of 0. I return code of not zero is returned from utilities when they cannot do what was requested - in your case read 22 records.

I suspect that you have no idea of what you are doing and definitely no idea of the tools available. Why not run through the task with a colleague?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Next

Return to Other IBM Tools