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

Generate a Sequence Number and its Reverse


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

New User


Joined: 30 Jan 2007
Posts: 1
Location: London

PostPosted: Tue Jan 30, 2007 3:47 pm
Reply with quote

Hi All,

I need to generate a file (FB/LRECL=16) wherein I need a sequence number and its reverse, each of 8 bytes. The file should look something like this

0000000110000000
0000000220000000
.
.
0000123443210000

I can generate the sequence number using the SEQNUM, however is there any function to reverse it.

Thanks
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Jan 30, 2007 3:52 pm
Reply with quote

I would think that if you generated the sequence during input you could reformat each byte backwards during output. Easily done with sort.
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 30, 2007 10:00 pm
Reply with quote

This DFSORT job will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN                                   
//SYSOUT    DD  SYSOUT=*                                   
//SORTIN DD DSN=...  input file                                       
//SORTOUT DD DSN=...  output file                                     
//SYSIN    DD    *                                         
  OPTION COPY                                             
  INREC IFTHEN=(WHEN=INIT,BUILD=(SEQNUM,8,ZD)),           
        IFTHEN=(WHEN=INIT,                                 
           BUILD=(1,8,9:8,1,7,1,6,1,5,1,4,1,3,1,2,1,1,1)) 
/*
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 Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Increase the number of columns in the... IBM Tools 3
No new posts Cobol program with sequence number ra... COBOL Programming 5
Search our Forums:

Back to Top