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

Reg: Decrement the Sequence number


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manikanth_e

New User


Joined: 27 Mar 2007
Posts: 13
Location: chennai

PostPosted: Mon Jun 25, 2007 7:59 pm
Reply with quote

Hi,
I have the input file. My output file should be formatted such a way that it should contain an extra field. This extra field should contain the sequence number (in decremented format).
I have tried with the below sort card:
Code:

  INREC FIELDS=(1:1,120,121:SEQNUM,15,ZD,START=50000000,INCR=-1)
  OPTION COPY

But, I am resulted with syntax error.
Is there any way to do the same.

Thanks,
Mani
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: Mon Jun 25, 2007 9:34 pm
Reply with quote

INCR=-1 is not valid. But you can do what you want by using

50000000-seqnum

where seqnum = 0, 1, ...

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/120)
//SORTOUT DD DSN=...  output file (FB/135)
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=135,
   IFTHEN=(WHEN=INIT,
    BUILD=(1,120,136:C'50000000',144:SEQNUM,8,ZD,START=0)),
   IFTHEN=(WHEN=INIT,
    OVERLAY=(121:136,8,ZD,SUB,144,8,ZD,TO=ZD,LENGTH=15))
/*
Back to top
View user's profile Send private message
manikanth_e

New User


Joined: 27 Mar 2007
Posts: 13
Location: chennai

PostPosted: Mon Jun 25, 2007 10:16 pm
Reply with quote

Frank,
Thanks alot for the reply.
Though you have mentioned ZD in the card, i am getting the output in the below format:
00000005000000{
00000004999999I
00000004999999H
00000004999999G
00000004999999F
00000004999999E
00000004999999D
00000004999999C
00000004999999B
00000004999999A
00000004999999{
00000004999998I
00000004999998H

May i know the reason for the same? How to get in the proper format?


Thanks,
Mani.
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: Mon Jun 25, 2007 10:42 pm
Reply with quote

The DFSORT job I showed gives readable values like 000000050000000. The values you're getting indicates you're using Syncsort (WER messages), not DFSORT (ICE messages). DFSORT uses an F sign for the ZD result to give readable values whereas Syncsort uses a C sign for the ZD result to give unreadable values.

I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jun 26, 2007 12:58 am
Reply with quote

Hello,

What will be the use of these decremented sequence numbers?

If they are to be used in some code or utility, those values are valid numbers. They aren't as easy to read manually, but will work correctly if used as data in a compare or a report. Actually, if they are reported as numbers, the output should look as you'd prefer.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Jun 29, 2007 3:34 pm
Reply with quote

I know this is dirty solution but still- icon_smile.gif

1. Sort the file in reverse order
2. add sequence numbers to its record in normal asending order.
3. sort it back to original order.
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 -> JCL & VSAM

 


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