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
 

 

how to write record in o\p file in reverse order using sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rahulainchwaribm

New User


Joined: 27 Dec 2005
Posts: 1

PostPosted: Fri Dec 30, 2005 2:37 pm    Post subject: how to write record in o\p file in reverse order using sort
Reply with quote

this is my record input
"_ansingh@sympatico.ca","155613144",0,1

out put in output file
1,0,"155613144","_ansingh@sympatico.ca"

can somebody tell me.
thanks
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Fri Dec 30, 2005 2:57 pm    Post subject: Re: how to write record in o\p file in reverse order using s
Reply with quote

Whats better than a SEARCH....(Ofcourse somebody else do it for you).... icon_lol.gif

http://ibmmainframes.com/viewtopic.php?t=2674
http://ibmmainframes.com/viewtopic.php?t=2015

Regards,

Priyesh.
Back to top
View user's profile Send private message
vinodmaanju

New User


Joined: 10 May 2005
Posts: 28
Location: Pune

PostPosted: Tue Jan 03, 2006 2:44 pm    Post subject: Re: how to write record in o\p file in reverse order using s
Reply with quote

priyesh

BOTH TOPIC ARE DIFFERENT, MR RAHUL WANT TO CANGE ONLY FILEDIN REVERCE ORDER NOT STRING.
Back to top
View user's profile Send private message
venkat_India

New User


Joined: 18 Dec 2005
Posts: 7

PostPosted: Tue Jan 03, 2006 3:56 pm    Post subject: Re: how to write record in o\p file in reverse order using s
Reply with quote

Hi,
You can do this by using the outrec command in sort.
Back to top
View user's profile Send private message
meenasomu

New User


Joined: 15 Sep 2005
Posts: 17

PostPosted: Tue Jan 03, 2006 5:06 pm    Post subject: Re: how to write record in o\p file in reverse order using s
Reply with quote

Hi Raghu,

I think this code should work for you.

Code:

//STEP001 EXEC PGM=ICETOOL                   
//TOOLMSG DD SYSOUT=*                         
//DFSMSG DD SYSOUT=*                         
//TOOLIN DD *                                 
  SORT FROM(INDD) TO(OUTDD) USING(CTR1)       
/*                                           
//INDD DD i/p file goes here   
//OUTDD DD o/p file goes here                         
//CTR1CNTL DD *                               
   INREC FIELDS=(1,80,SEQNUM,8,BI)           
   SORT FIELDS=(81,8,BI,D)                   
/*                                         
 


Venkat - Could you please let me know how to achieve this with OUTREC.

Thanks,
Meena.
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: Tue Jan 03, 2006 9:47 pm    Post subject:
Reply with quote

rahulainchwaribm,

People seem to be confusing your request to rearrange fields with a request to rearrange records.

Do you only have one record, or do you have more than one record? Are the fields in the record (or records) fixed fields (always start in the same position and have the same length), or are they variable fields (can start in different positions and have different lengths)?

Your fields look to me like variable-length comma separated variables (CSV) of the form:

"a","b",c,d

Are they?
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: Tue May 02, 2006 1:09 am    Post subject:
Reply with quote

Here's a DFSORT job that will do what I think was requested. It uses the new PARSE and SQZ functions available with z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006). For complete details on all of the new DFSORT and ICETOOL functions available with these PTFs, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
"_ansingh@sympatico.ca","155613144",0,1
"x@yz.e","123",20,15
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC PARSE=(%00=(ENDBEFR=C',',PAIR=QUOTE,FIXLEN=23),
               %01=(ENDBEFR=C',',PAIR=QUOTE,FIXLEN=11),
               %02=(ENDBEFR=C',',FIXLEN=2),
               %03=(FIXLEN=2)),
        BUILD=(%03,C',',%02,C',',%01,C',',%00)
  OUTREC BUILD=(1,41,SQZ=(SHIFT=LEFT,PAIR=QUOTE),80:X)
/*


SORTOUT has:

Code:

1,0,"155613144","_ansingh@sympatico.ca"     
15,20,"123","x@yz.e"                         
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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 1 Thu Jul 27, 2017 9:16 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm


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