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
 

 

SYNCSORT SEQNUM and FI fields.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
nartcr

New User


Joined: 06 Jun 2007
Posts: 78
Location: anada

PostPosted: Sat Jan 21, 2017 4:02 am    Post subject: SYNCSORT SEQNUM and FI fields.
Reply with quote

I have the following table layout from DSNTIAUL:

Code:
LOAD DATA LOG NO INDDN SYSREC00 INTO TABLE
    TBLNAME
 (
 TEST__ID                               POSITION(       1         )
 INTEGER                       ,
 TEST_SID                               POSITION(       5         )
 SMALLINT                      ,
 TEST_DTE                               POSITION(       7         )
 DATE EXTERNAL(            10) ,
 TEST_TME                               POSITION(      17         )
 TIME EXTERNAL(             8) ,
 TEST_FORM_ID                           POSITION(      25         )
 INTEGER                       ,
 TEST_USR_ID                            POSITION(      29         )
 INTEGER
 )


What I am doing is, to sequence the SID number after unloading the table in a flat file.

Code:
//SYSIN    DD   *
  SORT FIELDS=(1,4,FI,A,5,2,FI,A)
  OUTREC IFTHEN=(WHEN=INIT,
                 OVERLAY=(5:SEQNUM,2,BI,RESTART=(1,4)))
  OUTFIL BUILD=(1,80)
/*


Apparently, this code wouldn't work, because format FI ( equivalent of smallint ) is not supported in SEQNUM field. Do you have any suggestion on how do I get around this problem? We are using SYNCSORT 2.1.0

After I sequence the SID, I would be reloading the data back to the table.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Sat Jan 21, 2017 6:05 am    Post subject: Reply to: SYNCSORT SEQNUM and FI fields.
Reply with quote

What do you mean by "apparently, this code wouldn't work"?

Do you have more than a possible 32767 TEST_SID per TEST__ID? If not, what do you feel would be the difference between FI and BI, and if so, how would a signed "sequence number" help?
Back to top
View user's profile Send private message
nartcr

New User


Joined: 06 Jun 2007
Posts: 78
Location: anada

PostPosted: Sat Jan 21, 2017 6:08 am    Post subject: Re: Reply to: SYNCSORT SEQNUM and FI fields.
Reply with quote

Bill Woodger wrote:
What do you mean by "apparently, this code wouldn't work"?

Do you have more than a possible 32767 TEST_SID per TEST__ID? If not, what do you feel would be the difference between FI and BI, and if so, how would a signed "sequence number" help?


Sorry for the confusion. I am attaching the code,which i submitted. Ignore the code shown in previous post.

Code:

//SYSIN    DD   *
  SORT FIELDS=(1,4,FI,A,5,2,FI,A)
  OUTREC IFTHEN=(WHEN=INIT,
                 OVERLAY=(5:SEQNUM,2,FI,RESTART=(1,4)))
  OUTFIL BUILD=(1,80)
/*


What i mean is, i submitted this job, and it gave "Syntax error". Going through the manual, it said FI is not supported for SEQNUM. Only BI, ZD and PD values are supported.

The problem with BI is that when i reload back to the table, it has to be converted back to FI, if i understand correctly. Is there an easy way to handle this, other than doing through 2 steps.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Sat Jan 21, 2017 7:27 am    Post subject: Reply to: SYNCSORT SEQNUM and FI fields.
Reply with quote

If you needed to "convert" it could be done with another simple WHEN=INIT in the OUTREC.

You've avoided the other questions. If you "smallint" can only be positive, there is no difference between BI and FI. If your sequence can... "go negative", what would that mean?
Back to top
View user's profile Send private message
nartcr

New User


Joined: 06 Jun 2007
Posts: 78
Location: anada

PostPosted: Sat Jan 21, 2017 7:49 am    Post subject: Re: Reply to: SYNCSORT SEQNUM and FI fields.
Reply with quote

Bill Woodger wrote:
If you needed to "convert" it could be done with another simple WHEN=INIT in the OUTREC.

You've avoided the other questions. If you "smallint" can only be positive, there is no difference between BI and FI. If your sequence can... "go negative", what would that mean?


The value in small int is from 1 to 32767.. no negative values in db. Let me try to run the job next Monday and post the results here.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Sat Jan 21, 2017 12:58 pm    Post subject: Reply to: SYNCSORT SEQNUM and FI fields.
Reply with quote

FI is signed. -32,768 to +32,767. BI is unsigned. 0-65,535. If you don't have negative sequence numbers, and if they can't exceed 32,767, for your specific purpose FI and BI are the same, and you will have no problems.
Back to top
View user's profile Send private message
nartcr

New User


Joined: 06 Jun 2007
Posts: 78
Location: anada

PostPosted: Wed Jan 25, 2017 12:19 am    Post subject:
Reply with quote

Thanks Bill. I changed the query from FI to BI and it worked seamlessly. I will take some time to refresh my memory on FI and BI data formats.
Back to top
View user's profile Send private message
sergeyken

New User


Joined: 29 Apr 2008
Posts: 91
Location: Maryland

PostPosted: Thu Feb 02, 2017 10:27 pm    Post subject:
Reply with quote

nartcr wrote:
I will take some time to refresh my memory on FI and BI data formats.

The idea of "unsigned binary" is known mainly among SYNCSORT/Assembler. AFAIK the most of other tools do only consider "signed binary".

The "FI,2" in SYNCSORT is equivalent to "DS H" in Assembler, and SMALLINT in DB2.
The "BI,2" in SYNCSORT is usually equivalent to "DS AL2", or "DS XL2" in Assembler, and nothing in DB2.

Any value between +32,768 to +65,535 appeared as "unsigned binary" is valid as "signed binary", too, but considered as values between -32,768 to -1 (in descending order).

The values between 0 to +32767 are absolutely equivalent in both cases. It's very unlikely that the noted TEST_SID would exceed +32767. Even if it does, I bet it is used for the purposes of uniqueness within the same TEST_ID value, so it should not harm anything.
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am


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