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
 

 

sort out put with passed perameter as first record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: sort out put with passed perameter as first record
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    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Jan 11, 2007 9:59 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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