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

Sysncsort - Justification problem


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
yuvan

New User


Joined: 10 Jan 2006
Posts: 23
Location: India

PostPosted: Tue Jan 05, 2021 2:07 pm
Reply with quote

Hi Team ,

I am having issues in synscsort for below record

My Input record

-0172
-1613
-0161
+1872

My output should be

17.2
-161
-16.1
187.2


I used the below sort card

Sort fields=copy
outrec fields=(1,5,SFF,EDIT=(SIT.T),SIGNS=(,-),LENGTH=5)


but I am getting

-17.2
-61.3
-16.1
87.2

First character in record 2 and record 3 is truncated , Could you please help me to retain the left most characters.

I am not able to copy the code to here , Just typed the code from mainframe.

Please bear with me.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Jan 05, 2021 3:05 pm
Reply with quote

1 - Why post in JCL & VSAM - this is not a JCL or VSAM problem but a Syncsort problem?
2 - Why not post in the Syncsort section of the forum as it is a Syncsort question?
3 - Why - after 14 years as a member, do you not use the code tags for your code?
4 - topic moved.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 395
Location: Bamberg, Germany

PostPosted: Tue Jan 05, 2021 3:11 pm
Reply with quote

Why not just updating the EDIT mask?
Code:
OUTREC BUILD=(1,5,SFF,EDIT=(SIIT.T),SIGNS=(,-),LENGTH=5)

Code:
-17.2
161.3
-16.1
187.2
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 957
Location: Maryland

PostPosted: Tue Jan 05, 2021 6:39 pm
Reply with quote

Joerg.Findeisen wrote:
Why not just updating the EDIT mask?
Code:
OUTREC BUILD=(1,5,SFF,EDIT=(SIIT.T),SIGNS=(,-),LENGTH=5)

Code:
-17.2
161.3
-16.1
187.2

The possible max number of digits in the input value is 5. Only 4 of them will be displayed, the high order digit just silently disappears...
Instead of 12345 you’ll get: 234.5
Back to top
View user's profile Send private message
yuvan

New User


Joined: 10 Jan 2006
Posts: 23
Location: India

PostPosted: Tue Jan 05, 2021 6:39 pm
Reply with quote

Hi Team ,

Apologies for not tagging the question against syncsort .

Used the OUTREC BUILD=(1,5,SFF,EDIT=(SIIT.T),SIGNS=(,-),LENGTH=5)

But ,second record sign is removed ,

Code:
-17.2
161.3
-16.1
187.2

It should be

-161 or -161.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 957
Location: Maryland

PostPosted: Tue Jan 05, 2021 6:46 pm
Reply with quote

yuvan wrote:
Hi Team ,

Apologies for not tagging the question against syncsort .

Used the OUTREC BUILD=(1,5,SFF,EDIT=(SIIT.T),SIGNS=(,-),LENGTH=5)

But ,second record sign is removed ,

Code:
-17.2
161.3
-16.1
187.2

It should be

-161 or -161.

Two solutions are possible:
1) prohibit entering input values which do not fit the output field, or
2) adjust the output field to enough number of possible input digits, plus optional sign.

You can choose any of those options.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2588
Location: NYC,USA

PostPosted: Wed Jan 06, 2021 3:42 am
Reply with quote

change the offsets accordingly.
Code:
//S1     EXEC PGM=SORT                                         
//SORTIN   DD  *                                               
-0172                                                           
-1613                                                           
-0161                                                           
+1872                                                           
//SORTOUT   DD DSN=YOUR DSN                                     
//SYSUDUMP DD  SYSOUT=*                                         
//SYSOUT   DD  SYSOUT=*                                         
//SYSPRINT DD  SYSOUT=*                                         
//SYSIN     DD *                                               
   SORT FIELDS=COPY                                             
   INREC OVERLAY=(10:1,5,SFF,EDIT=(SIIT.T),SIGNS=(,-),LENGTH=6,
                  10:10,6,SQZ=(SHIFT=LEFT))   
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts problem in select max when executing ... IMS DB/DC 6
No new posts Problem getting record length of a re... COBOL Programming 2
No new posts Problem while trying to manipulate re... DFSORT/ICETOOL 3
No new posts TSO IOF problem TSO/ISPF 5
No new posts Need help with this dfsort problem DFSORT/ICETOOL 7
Search our Forums:

Back to Top