View previous topic :: View next topic
|
Author |
Message |
mkumarshashi
New User
Joined: 04 Oct 2005 Posts: 3
|
|
|
|
Requirement is:
I have to use three files and copy them to one output file.
This I am doing successfully using ICEMAN utility,
but there should be an check on file. Suppose one of the file is not present then in that job should not abend instead it should use other two files and copy them to fourth file. |
|
Back to top |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
If you know the DCBs for your files then you could try this
Code: |
//S01 EXEC PGM=IEFBR14
//DD1 DD DSN=YOUR.FIRST.FILE,DISP=(MOD,PASS),
// SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=24000)
//DD2 DD DSN=YOUR.SECOND.FILE,DISP=(MOD,PASS),
// SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=24000)
//DD3 DD DSN=YOUR.THIRD.FILE,DISP=(MOD,PASS),
// SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=24000)
//*
//S02 EXEC PGM=SORT
//SORTIN DD DSN=YOUR.FIRST.FILE,DISP=SHR
// DD DSN=YOUR.SECOND.FILE,DISP=SHR
// DD DSN=YOUR.THIRD.FILE,DISP=SHR
|
the first step will open but do nothing for any existing datasets
it will create a temporary dataset if there is none to begin with so there will be no JCL errors/abends when you run your sort step.
Does that satisfy your requirement? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
While this solution prevents the "file not found" error, it will cause problems in many organizations.
If the MOD causes a new file to be created the sort step may abend with a wrong length record or will process with incorrect data (whatever was last on that space on the dasd). If all of your dasd is sms-managed, you may be ok, but it is better to ensure the files exist and have a valid e-o-f.
Please search the forum for other topics with the same situation. It has been discussed recently. |
|
Back to top |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
Thanks Dick
our shop is all SMS managed and it works fine for us, I should have qualified that. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi IQ,
Yes, it was an excellent additon to sms that when merely cataloging a dataset (i.e. with IEFBR14) it automatically writes a "real" end-of-file
Now, if everything was sms-managed everywhere . . . . |
|
Back to top |
|
|
mshashio
New User
Joined: 24 Apr 2006 Posts: 4
|
|
|
|
Thanx for the quick response.
I have done as per suggestion, but I am getting following error whilr running it.
PRODUCT LICENSED FOR CPU SERIAL NUMBER 2A61A, MODEL 2084 305
SYSIN :
SORT FIELDS=COPY
WER164B 6,896K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 1,004K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER400A SORTIN IS AN UNINITIALIZED SEQUENTIAL DISK DATA SET
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
******************************* BOTTOM OF DATA *********************
Please advise |
|
Back to top |
|
|
mshashio
New User
Joined: 24 Apr 2006 Posts: 4
|
|
|
|
This runs fine when all the files are present in DASD, but when file is not present then SORT step gives error. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
That is the error i cautioned about. It sounds like your dataset(s) are not sms-managed.
You must mske sure the file has a valid end-of-file. You can do this with IEBGENER or even another SORT step. |
|
Back to top |
|
|
|