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
 

 

Generate a Sequence Number and its Reverse

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Generate a Sequence Number and its Reverse
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: 3158
Location: Tucson AZ

PostPosted: Tue Jan 30, 2007 3:52 pm    Post subject:
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 Moderator


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

PostPosted: Tue Jan 30, 2007 10:00 pm    Post subject:
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    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 Sequence number add in SORT pshongal SYNCSORT 3 Fri Sep 02, 2016 3:32 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm
No new posts RFE: Additional compound operators fo... prino PL/I & Assembler 1 Wed Jun 08, 2016 3:31 pm
No new posts Generate Cohort report using SORT Indrajit_57 SYNCSORT 6 Wed Jun 01, 2016 9:41 am
No new posts GDG vsersion number change Raghu navaikulam JCL & VSAM 5 Fri May 27, 2016 4:49 pm


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