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
 

 

Reg: Decrement the Sequence number

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Reg: Decrement the Sequence number
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 Moderator


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

PostPosted: Mon Jun 25, 2007 9:34 pm    Post subject:
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    Post subject: Re: Reg: Decrement the Sequence number
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 Moderator


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

PostPosted: Mon Jun 25, 2007 10:42 pm    Post subject:
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

Site Director


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

PostPosted: Tue Jun 26, 2007 12:58 am    Post subject:
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: 686
Location: Earth

PostPosted: Fri Jun 29, 2007 3:34 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts how to mask the phone number kumarinfy DB2 4 Mon Apr 03, 2017 5:23 pm
No new posts what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


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