Joined: 11 Jan 2010 Posts: 13 Location: chennai/hyderabad
Hi,
I seek a help in completing this task, If possible could you please help me..
Here is the requirement.
Step 1. I have a daily job which runs and create a file with few/more records daily. I would like to count(count will vary day by day) the number of records are present in that particular input file.
Step 2. Once i get the Count from step 1, I want to write that count in another file which has some description say example
_________________________________________
Welcome,
Today the record process from our System is : Count-value(the actual count from the step 1 should get printed here)
Thank you
_________________________________________
The above description i wrote in an input file so that every day we can just update the actual count in the COUNT-VALUE field
my approach,
I have got the count using FILEAID utility (TALLY), but i am not able to guess how to override a input file which has the description with the count
I believe override can be done using DFSORT, I tried all the possibility but not able to complete my requirement.
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
So you have a count in one file as the only record in the file and you want to overlay it on a specific record in a specific position in a second file?
What is the length of the count field in the first file? Is the count in Packed Decimal or Zoned Decimal format?
You want the count overlaying the 3rd record of the second file at position 47 (I think it is)?
Is this second file going to be read by machine or by human? If the former then you do not need all that verbiage and you do not need a second file - just the count.
If I understand your requirement correctly..
Below one step will give you desired...
Code:
//S1 EXEC PGM=SORT
//SORTIN DD *
THIS IS THE FILE OF
WHICH COUNT IS TO BE
PRINTED ON OUTPUT FILE
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('_________________________________________',/,
'Welcome,',/,
'Today the record process from our System is :',
COUNT=(M11,LENGTH=6),/,
'Thank you',/,
'_________________________________________')
Output will be
Code:
_________________________________________
Welcome,
Today the record process from our System is :000003
Thank you
_________________________________________
The above description i wrote in an input file so that every day we can just update the actual count in the COUNT-VALUE field
Well... I wont go with this way.. But you have STATIC content and exepcted to change often ( ) .... And every time you don't want to touch JCL..
Code:
//S1 EXEC PGM=SORT
//SORTIN DD *
THIS IS THE FILE OF
WHICH COUNT IS TO BE
PRINTED ON OUTPUT FILE
//SORTOUT DD DSN=&&TEMP,DISP=(NEW,PASS)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(C'FCOUNT',C',''',COUNT=(M11,LENGTH=6),'''',80:X)
/*
//S2 EXEC PGM=SORT
//SORTIN DD *
_________________________________________
WELCOME,
TODAY THE RECORD PROCESS FROM OUR SYSTEM IS :XXXXXX
THANK YOU
_________________________________________
//SORTOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&TEMP,DISP=(MOD,PASS)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,45,CH,EQ,
C'TODAY THE RECORD PROCESS FROM OUR SYSTEM IS :'),
OVERLAY=(46:FCOUNT))
/*
Joined: 11 Jan 2010 Posts: 13 Location: chennai/hyderabad
Hi,
Thank you so much for your reply,
I have tried the below but I am not able to complete my requirement
Let me explain the requirement briefly
I create a PS file with the below decription
FILE NAME : TEST.DESCRIPTION --- LRECL - 80 and FB
TEST.DESCRIPTION contains
. Hi,
. PES Job Monitored Date:
. PES Job Monitored Time: 4:30 AM EST (2:00 PM IST)
. Status: File Creation Successful
. Number of Rows in the File : XXXXXX
XXXXXX -> where i want to my input record count daily.
Input file ( LRECL - 80 and FB) will have N number of records daily and it is not the same every day.
Joined: 11 Jan 2010 Posts: 13 Location: chennai/hyderabad
Code:
//SORTIN DD DSN=TEST.DESCRIPTION ,DISP=SHR
are you sure there is space between dataset name and DISP position parameter?
@ Escapa : Yes Escapa I do agree with you.. But i have never given a space btwn them.
@Superk : I apologies for the delay in response... I fixed the s013 abend sorry for not providing the sysout as i deleted all of them.
Now to tell you where i stand with respect to my requirement is,
I have a file which hold the record count
Say example : Test.Count --PS, Fixed and 80 bytes length
Step i used as per Escapa advise,
Code:
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=TESTA.INPUT.FILE(0),DISP=SHR -- GDG always take current generation so we dont need to change the input file
//SORTOUT DD DSN=TESTA.COUNT,
// DISP=(NEW,CATLG,DELETE),SPACE=(80,(10,05),RLSE),
// DCB=(LRECL=80,RECFM=FB,DSORG=PS),AVGREC=K
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(C'FCOUNT',C',''',COUNT=(M11,LENGTH=6),'''',80:X)
/*
Are you providing the matching criteria correctly in your second step, the criteria you provided in the jcl is different from the file contents of your test description file. As this step is tested already it should be an issue with your editing of the step.
I would suggest you post the entire JCL after all your editing, along with the contents of the test description file.