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

HOW CAN I CONVERT SIGND packed decimal TO CHAR USE DFSORT?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
haohao

New User


Joined: 23 May 2008
Posts: 35
Location: beijing China

PostPosted: Wed Apr 08, 2009 6:31 am
Reply with quote

yeah,after I change to use the input positions for the SORT statement,it can work normally.
I am new to SORT,so there are to many concept is ambiguous to me.thanks everybody here give me those valuable information to solve my difficulty! icon_biggrin.gif
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: Wed Apr 08, 2009 7:58 pm
Reply with quote

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
haohao

New User


Joined: 23 May 2008
Posts: 35
Location: beijing China

PostPosted: Thu Apr 09, 2009 7:04 am
Reply with quote

thank you very much! It's very helpful!
Back to top
View user's profile Send private message
Satyendra Tripathi

New User


Joined: 06 Oct 2021
Posts: 1
Location: India

PostPosted: Thu Sep 29, 2022 1:19 pm
Reply with quote

CICS Guy wrote:
First off,
Code:
 =COLS> -+----6
 ****** *******
 000001       4
        FFFFFFF
        FFFFFE4
 --------------
is the binary representation of the negative number.
Second, the format 'BI' is unsigned binary, for proper negative usage, you should use 'FI'.


Hi,

I am facing same sign issue but my Data type is PD(Packed decimal). I am getting all the values as positive even negative values are also changed to Positive. Could any of you please help!
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2019
Location: USA

PostPosted: Thu Sep 29, 2022 6:47 pm
Reply with quote

haohao wrote:
thank you very much! It's very helpful!


It would be nice if you tried to UNDERSTAND at least some of the advices given to you at this forum.

Based on you posts, and used terminology, I guess that you only copy-and-paste the given solutions without a minor understanding what does this mean?

Sometimes you respond with "thank you very much! It's very helpful!". That's it.

* * * * *

Your posts like this
Quote:
the sort doesn't function again. so can I do it with sort?
are extremely senseless.

* * * * *

Quote:
follow the previously message from this forum,I write the JCL as bellow:

Code:
//SYSIN     DD *
   OPTION COPY
   INREC FIELDS=(1:1,33,
                 34:34,4,PD,TO=FS,LENGTH=6,
                 40:38,16,
                 56:54,8,PD,EDIT=(SIIIIIIIIIIIIIT.TTT),SIGNS=(,-),
                 75:62,70)


SORT control statements are NOT JCL, in any manner!!!!!!!!
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2019
Location: USA

PostPosted: Thu Sep 29, 2022 7:21 pm
Reply with quote

haohao wrote:
hello,
I want to convert a file'S signed packed decimal column to displayable and ftp this file from mainframe to unix.
the file's format is:
Code:

01 RECORD
   03  COL-1    PIC X(33).
   03  COL-2    S9(9) COMP.
   03  COL-3    PIC X(16).
   03  COL-4    PIC S9(14)V999 COMP.
   03  COL-5    PIC X(70).


I want to convert that file to this format:
Code:

01 RECORD
   03  COL-1    PIC X(33).
   03  COL-2    +9(6).    (this value always less than 999999)
   03  COL-3    PIC X(16).
   03  COL-4    +9(14).999.
   03  COL-5    PIC X(70).

follow the previously message from this forum,I write the JCL as bellow:
Code:

 //SYSIN     DD *
   OPTION COPY
   INREC FIELDS=(1:1,33,
                 34:34,4,PD,TO=FS,LENGTH=6,
                 40:38,16,
                 56:54,8,PD,EDIT=(SIIIIIIIIIIIIIT.TTT),SIGNS=(,-),
                 75:62,70)

but it abend when executed with S0C7 abend code.


A maintainable in the future solution MUST be like this
Code:
. . . . . .
//SYMNAMES DD  *
COL_1,*,33,CH       PIC X(33).
COL_2,*,4,FI        S9(9) COMP.
COL_3,*,16,CH       PIC X(16).
COL_4,*,17,ZD       PIC S9(14)V999 COMP.
COL_5,*,70,CH       PIC X(70).
//. . . . . .
//SYSIN   DD  *
     SORT FIELDS=COPY       SORT is done BEFORE OUTREC!!!                                   
     OUTREC BUILD=(COL_1,        BUILD= is replacing obsolete FIELDS=                                         
                   COL_2,EDIT=(STTTTTT),SIGNS=(+,-), 
*                          '+' sign is mandatory in your example                     
*                          zero suppression not needed in your example                     
                   COL_3,                                       
                   COL_4,EDIT=(STTTTTTTTTTTTTT.TTT),SIGNS=(+,-),
*                          '+' sign is mandatory in your example                     
*                          zero suppression not needed in your example                     
                   COL_5)                                       
// . . . . .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Sep 29, 2022 7:48 pm
Reply with quote

Do we really need so much on a topic that was started 13 1/2 years ago? The post reviving the topic should have been a new topic, not a continuation of the original.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2019
Location: USA

PostPosted: Thu Sep 29, 2022 7:51 pm
Reply with quote

Yes, needs to be locked.

Why not lock the old topics automatically? People read topics based on the latest update, do not check all previous thread...
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Sep 29, 2022 8:38 pm
Reply with quote

any reason to resurrect a 13 years old topic?
START A NEW ONE from scratch
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Fri Sep 30, 2022 8:25 am
Reply with quote

Locked..
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top