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

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


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1448
Location: Chicago, IL

PostPosted: Fri Dec 30, 2005 2:57 pm
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
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
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
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 Developer


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

PostPosted: Tue Jan 03, 2006 9:47 pm
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 Developer


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

PostPosted: Tue May 02, 2006 1:09 am
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:

Use [URL] BBCode for External Links

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top