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...
navennaik
Posts: 8
Joined: Thu Feb 26, 2009 7:33 pm
Skillset: cobol ,jcl ,IMS,
Referer: communication

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

User avatar
swd
Posts: 109
Joined: Wed Feb 18, 2009 9:18 pm
Skillset: COBOL, DB2, JCL, REXX, ISPF, IBM Utility Programs, Performance Tuning and Benchmarking
Referer: Google Search
Location: UK

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

navennaik
Posts: 8
Joined: Thu Feb 26, 2009 7:33 pm
Skillset: cobol ,jcl ,IMS,
Referer: communication

Re: IDCAMS Utiility

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

Thank you So much ,
Naveen.

sinmani
Posts: 93
Joined: Thu Mar 22, 2012 10:02 am
Skillset: COBOL
CICS
JCL
DB2
VSAM
IMS
Referer: INTERNET

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

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

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.

sinmani
Posts: 93
Joined: Thu Mar 22, 2012 10:02 am
Skillset: COBOL
CICS
JCL
DB2
VSAM
IMS
Referer: INTERNET

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

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

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.

User avatar
dick scherrer
Global moderator
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am

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.

sinmani
Posts: 93
Joined: Thu Mar 22, 2012 10:02 am
Skillset: COBOL
CICS
JCL
DB2
VSAM
IMS
Referer: INTERNET

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

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

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


  • Similar Topics
    Replies
    Views
    Last post