View previous topic :: View next topic
|
Author |
Message |
shrinivas_3 Warnings : 1 New User
Joined: 05 Sep 2006 Posts: 34
|
|
|
|
Hi
I want some method by which i can write the sort-in file name in the trailer record.
suppose i have the below JCL .
Code: |
//STEP020 EXEC SORTD3
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=input file - > assume input has 101 records
//SORTOUT DD DSN=output file
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT,NODETAIL,REMOVECC,
TRAILER1=(COUNT)
/*
|
the result of this jcl in SORTOUT file is
MY requirement is that i want the sortout displayed as below
Code: |
input file name 101
|
I dont want to hardcode sort-in file name in the sort control card.
What i need is that , that INput file name should be generated based on its DDname (i.e SORTIN) .
I.e any file name Against SORTIN dd name should be Printed before the rec count number.
Thanks. |
|
Back to top |
|
|
Kevin
Active User
Joined: 25 Aug 2005 Posts: 234
|
|
|
|
I'd use the SYMNAMES DD to provide the dataset name:
In a prior step, find the dataset name associated to the DD, then create the SYMNAMES dataset with the contents:
DSN,'THE.DATASET.NAME'
Code: |
//STEP010 EXEC PGM=somepgm
...
//SORTIN DD DSN=input file - > assume input has 101 records
//SYMNAMES DD DSN=&&T1,DISP=(,PASS),UNIT=VIO
...
|
Then, use the symbolic in the SORT step:
Code: |
//STEP020 EXEC SORTD3
//SYMNAMES DD DSN=&&T1,DISP=(OLD,DELETE)
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=input file - > assume input has 101 records
//SORTOUT DD DSN=output file
//SYSIN DD *
OPTION COPY
OUTFIL NODETAIL,REMOVECC,
TRAILER1=(DSN,X,COUNT)
/*
|
|
|
Back to top |
|
|
shrinivas_3 Warnings : 1 New User
Joined: 05 Sep 2006 Posts: 34
|
|
|
|
Thanks Kevin
But when i coded the JCl as per above syntax, it gave me
S013 U0000
I coded the JCL as :
Code: |
//STEP010 EXEC PGM=somepgm - (i used one cobol-db2 proc name here, just to run one cobol-db2 sample program , with all other parameters needed to run it )
//SORTIN DD DSN=input file - > assume input has 101 records
//SYMNAMES DD DSN=&&T1,DISP=(,PASS),UNIT=VIO
...
....
....
...
...
|
In the same JCL next step i coded as :
Code: |
//STEP020 EXEC SORTD3
//SYMNAMES DD DSN=&&T1,DISP=(OLD,DELETE)
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=input file (LRECL = 68) - > assume input has 101 records
//SORTOUT DD DSN=output file (LRECL = 68)
//SYSIN DD *
OPTION COPY
OUTFIL NODETAIL,REMOVECC,
TRAILER1=(DSN,X,COUNT)
/*
|
------------------------------------------------------------
One more thing Kelvin , i could not understand the statement
In a prior step, find the dataset name associated to the DD, then create the SYMNAMES dataset with the contents:
DSN,'THE.DATASET.NAME'
------------------------------------------------------------
Next time instead of temporary Data set "T1" i used one already cataloged data set (lrecl=80) for the dd name SYMNAMES
But then it gave me ABENDU0268
TRAILER1=(DSN,X,COUNT)
*
WER268A OUTFIL STATEMENT : SYNTAX ERROR
Also note that we have SYNCSORT utility.
I want to have my sort out output as below:
INPUT FILE NAME 101
Since trailer gives only the count , i need to write input file name just before the count value.
I dont want to Hardcode 'input file name ' in sort control card.
(I am planning to write a procedure later )
Kindly suggest me the solution.
Thanks
Shrinivas |
|
Back to top |
|
|
khandagalehh
New User
Joined: 09 Oct 2006 Posts: 1 Location: bangalore
|
|
|
|
Just try out this jcl step.. this will give u the output as you want.
Code: |
//STEP10 EXEC PGM=SYNCSORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=input dataset name
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(20:'NUMBER OF RECORDS ON FILE:',COUNT=(M10,LENGTH=8))
/*
|
|
|
Back to top |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
Quote: |
Just try out this jcl step.. this will give u the output as you want.
Code:
//STEP10 EXEC PGM=SYNCSORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=input dataset name
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(20:'NUMBER OF RECORDS ON FILE:',COUNT=(M10,LENGTH=8))
/* |
What output are u trying to achieve thru this piece of code??? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
The Syncsort solution posted does not meet the original requirement (which specifies that the input file name (dsn?) be placed in the trailer).
Also, the topic is over a year old. . . . |
|
Back to top |
|
|
avaneendra_linga
New User
Joined: 13 Dec 2006 Posts: 73 Location: Hyderabad
|
|
|
|
Hi....
The bestway is using symbolic parameters and genrating the control card...dynamically...Through PARM....
IN PROC....
//STEP010 EXEC PGM=K98....,PARM='CNTRL CARD DAT,&DSN'
//SYSINDD DD DSN=&&DYNCARD
===================
//STEP020 EXEC SORTD3
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=&DSN - > assume input has 101 records
//SORTOUT DD DSN=output file
//SYSIN DD dsn=&&dyncard |
|
Back to top |
|
|
|