How to find out the number of records in a file using JCL

Answers were Sorted based on User's Feedback



How to find out the number of records in a file using JCL..

Answer / logeshwaran

//COUNT EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=INPUT DATASET,
// DISP=SHR
//TOOLIN DD *
COUNT FROM(IN)
/*

Is This Answer Correct ?    18 Yes 0 No

How to find out the number of records in a file using JCL..

Answer / mohanasundaram

step1 exec pgm=idcams
sysprint dd sysout=*
sysout dd sysout=*
infile dd dsn=filename,disp=shr
sysin dd *
print(filename)-
count(3)
/*
//

In input file 3 records is there means it will be show maxcc=0 else it will show maxcc=4

Is This Answer Correct ?    6 Yes 0 No

How to find out the number of records in a file using JCL..

Answer / srinivasa gudla

Using Syncsort,

//SORT1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Input.File,DISP=SHR
//SORTOUT DD DSN=Output.File,...
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=OUT,TRAILER1=
(1:COUNT),REMOVECC,NODETAIL
/*

This job creates a report with a single trailer record
containing the record count.

The COUNT subparameter of TRAILER1 provides the number of
records for the entire report (all the records) starting at
position 1.

REMOVECC omits the ANSI carriage control character from all
of the report records.

NODETAIL generates a report with no data records, only
header and trailer records, as specified.

Is This Answer Correct ?    4 Yes 3 No

How to find out the number of records in a file using JCL..

Answer / ravi

Logesh,

I'm not sure where the output (record count) is written to.

Can you let me know how to write it to spool & dataset.

My output should be:

Record count is: <count>

Is This Answer Correct ?    2 Yes 2 No

How to find out the number of records in a file using JCL..

Answer / anilkumar

//COUNT EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=INPUT DATASET,
// DISP=SHR
//TOOLIN DD *
*option1
COUNT FROM(IN)
*Instead of count u can aslo use stats operator
*option2
stats from(IN) on(20,5,ZD)
*output will be available in spool ie.in toolmsg
/*

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More JCL Interview Questions

What does a disposition of (new,catlg,keep) for a dsn mean?

0 Answers  


Is it possiable to use a gdg in the INCLUDE statement in a SORT jcl? I am using this because I want to change the condition with out changing the jcl. Please provide with a sample code.

1 Answers  


What is the error code SOC01 indicate ?

5 Answers   Microsoft,


There is a procedure in A.B.PROCS(PROC1) (member name is PROC1) //PROCA... There is a call to a procedure PROCA from a JOB. //STEP01 EXEC PROCA ... Here "PROCA" in JOB refers to the actual PROC name or the member name of the PDS where this PROCA is stored.

2 Answers   Merrill Lynch,


Hi, can we call catalog( say myproc } proc n times in jcl if so how please explain Thanks in advance

2 Answers   Cap Gemini,






I am getting the file from Unix to Mainframes for every 15 minutes. The mainframe job get abended with bad records coming from unix. I recovered that by deleting the bad data. I need permenant solution how to fix the issue? The record is getting characters in in first 9 positions which it should not. Please provide me the solution how to skip the records if it finds the charcters in the first 9 positions. K

3 Answers  


how to put a dependency on job in jcl using opc scheduler?

1 Answers   CTC,


How to code these statements in JCL: CLEANUP INITIAL(NO) RESTART(NO) DYNALLOC(NO) job definition..?

0 Answers  


What is the format of comment statement?

0 Answers  


A. Job Abended in STEP03. Now run job again to execute STEP03, STEP04 (STEP01,STEP02 should not execute again)

3 Answers   Cap Gemini, CSC, Xchanging,


01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP VALUE 50 05 AMOUNT-2 PIC 9(4)V99 USAGE COMP MOVE ZERO TO GROUP-ITEM ADD 50 TO AMOUNT-1 what will be the content of AMOUNT-1? a.50 b.100 c.0 d.unpredictable

1 Answers  


how can u understand ps and pds from their names ?

1 Answers   TCS,


Categories