View previous topic :: View next topic
|
Author |
Message |
lal_arun_272
New User
Joined: 09 Oct 2006 Posts: 31 Location: Bangalore
|
|
|
|
Hi,
i have one more question.
i have a file which is coming out of sort which will lool like
abc
abcdef
abcdefgh
but i want to pass a perameter to sort so that the out put should come with the passed perameter as the first record
perameter
abc
abcdef
abcdefgh
Regards,
Naga |
|
Back to top |
|
|
manihcl85 Warnings : 1 New User
Joined: 11 Jan 2007 Posts: 52 Location: chennai
|
|
|
|
Hi,
one way is u can insert the parameter in a dataset and specify that dataset as output dataset of sort step with disp parameter as mod.
or if u want to do that in single step means u can use header option for reporting using dfsort and write the output to an dataset.
Regards,
Manikandan. |
|
Back to top |
|
|
lal_arun_272
New User
Joined: 09 Oct 2006 Posts: 31 Location: Bangalore
|
|
|
|
if possible could you please give me the code. so that i can try.
Regards,
Arun. |
|
Back to top |
|
|
manihcl85 Warnings : 1 New User
Joined: 11 Jan 2007 Posts: 52 Location: chennai
|
|
|
|
Hi,
Try this
SORT FIELDS=(1,10,CH,A)
OUTFIL FNAMES=OUTDD,
HEADER1=(1:C'PARAMETER')
WHERE OUTDD IS THE DDNAME OF UR OUTPUT FILE
Regards,
manikandan. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If you want to pass the parameter in a data set rather than hardcoding it in SYSIN, you can use a DFSORT symbol like this:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=... file with insert symbol
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,HEADER1=(insert)
/*
|
Notice I used REMOVECC to eliminate the ANSI carriage control character.
The SYMNAMES file or PDS member would be RECFM=FB and LRECL=80 and would have one record like this:
where parameter is whatever you need.
Alternatively, you could code the symbol inline like this:
Code: |
//SYMNAMES DD *
insert,'parameter'
/*
|
|
|
Back to top |
|
|
|