Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

write "sort-in" file name in Trailer record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
shrinivas_3
Warnings : 1

New User


Joined: 05 Sep 2006
Posts: 34

PostPosted: Tue Sep 12, 2006 12:31 pm    Post subject: write "sort-in" file name in Trailer record
Reply with quote

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

Code:

      101


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
View user's profile Send private message

Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Mon Sep 18, 2006 7:15 pm    Post subject: Re: write "sort-in" file name in Trailer record
Reply with quote

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
View user's profile Send private message
shrinivas_3
Warnings : 1

New User


Joined: 05 Sep 2006
Posts: 34

PostPosted: Tue Sep 19, 2006 12:49 pm    Post subject: Re: write "sort-in" file name in Trailer record
Reply with quote

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
View user's profile Send private message
khandagalehh

New User


Joined: 09 Oct 2006
Posts: 1
Location: bangalore

PostPosted: Wed Dec 19, 2007 12:50 pm    Post subject: Reply to: write "sort-in" file name in Trailer r
Reply with quote

Just try out this jcl step.. this will give u the output as you want. icon_biggrin.gif

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
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Wed Dec 19, 2007 7:59 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Dec 19, 2007 9:53 pm    Post subject:
Reply with quote

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
View user's profile Send private message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Tue Jan 15, 2008 4:54 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us