Posted: Tue Feb 17, 2009 5:40 pm Post subject: display the records processed in Syncsort & Culprit
Members,
I have a requirement wherein I have to read a VSAM file record by record and based on my conditons i will process only certain records
and finally i am writing down as below , basically i have to give the count of the records written to an output file / spool.
Code:
TOTAL NUMBER OF RECORDS READ: X
TOTAL NUMBER OF RECORDS WRITTEN: Y
I have done the solution by using a program and it went fine.I am very new to SYNCSORT ,FILE-AID in batch and CULPRIT.
Can anyone help me with the solutions in SYNCSORT and File-AID, always the first record in the file should not be considered for reading i mean we can omit it as it contains only header contents and we should be considering for records from second one till end.It would be great if i can get some help on Culprit.I also guess that we can do this by executing file aid online but not sure how to get the display of count as a file / sent to spool.
We have only Files in our project in our shop and we do not have any databases.I was told that there are VSAM files and they are all
compressed and we have to uncompress them while we read / make use of it.I would like to understand what do we mean by compressing files
and basically what is the purpose of using that kind of architecture.What is happening is my program which is supposed to read the
VSAM file is not reading the file itself , can anyone help me understand in this regard.
Step One -
Create two input files using the OMIT and INCLUDE verbs:
--> OMIT HEADER and write output file that only contains the total number of records minus the header, which is identified by a space in column 16 of the input file.
--> INCLUDE all records based on predefined criteria (in this example each occurence of the word 'NEW VEHICHLE' in position 213 is totaled.
Code:
//STEP01 EXEC PGM=SORT,COND=(0,LT)
//*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT1,NODETAIL,REMOVECC,
OMIT=(016,001,CH,EQ,C' '),
TRAILER1=('TOTAL NUMBER OF RECORDS READ :',COUNT)
OUTFIL FNAMES=SORTOUT2,NODETAIL,REMOVECC,
INCLUDE=(213,011,CH,EQ,C'NEW VEHICLE'),
TRAILER1=('TOTAL NUMBER OF RECORDS WRITTEN :',COUNT)
//*
//SORTIN DD DSN=VSAM.INPUT.FILE,DISP=SHR
//SORTOUT1 DD DSN=TOTAL.READ.OUTFILE,DISP=(NEW,CATLG,DELETE)
//SORTOUT2 DD DSN=TOTAL.WRITTEN.OUTFILE,DISP=(NEW,CATLG,DELETE)
//*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum