IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

sort out put with passed perameter as first record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lal_arun_272

New User


Joined: 09 Oct 2006
Posts: 31
Location: Bangalore

PostPosted: Thu Jan 11, 2007 7:02 am
Reply with quote

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

New User


Joined: 11 Jan 2007
Posts: 52
Location: chennai

PostPosted: Thu Jan 11, 2007 11:09 am
Reply with quote

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

New User


Joined: 09 Oct 2006
Posts: 31
Location: Bangalore

PostPosted: Thu Jan 11, 2007 11:18 am
Reply with quote

if possible could you please give me the code. so that i can try.

Regards,
Arun.
Back to top
View user's profile Send private message
manihcl85
Warnings : 1

New User


Joined: 11 Jan 2007
Posts: 52
Location: chennai

PostPosted: Thu Jan 11, 2007 12:28 pm
Reply with quote

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

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jan 11, 2007 9:59 pm
Reply with quote

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:

Code:

insert,'parameter'


where parameter is whatever you need.

Alternatively, you could code the symbol inline like this:

Code:

//SYMNAMES DD *
insert,'parameter'
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top