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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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