Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : All available storage is assigned to the job or jobstep, If REGION is coded 0K or 0M

Google
 
Web mainframegurukul.com

Problem with signs

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
ShivanoTE
Member


Joined: 18 Dec 2014
Posts: 7

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Dec 18, 2014 9:04 pm    Post subject: Problem with signs Reply with quote

Hi guys, I try to convert a number (ZD without sign) to PD, but the sign is unpacked at the end.

My SORTIN:
Code:
----+----1----+----2----+----3----+----4--
CONV0000089800000002346768+00000000000000+
CONV0000095000000022186672-00000000000000+
CONV0000102600000023887500+00000000000000+
DEPO0017991200000229391190+00000000000000+
DEPO0392080100000131250000-00000000000000+
DEPO0850124300000000000000+00000000000000+
DEPO0899368800000003266668+00000000000000+
DEPO2940102000000000000000+00000000000000+
I0012360002700000000000000+00000000000000+
I0012370004100000000255509+00000000060238+


The first 12 chars I keepit in the same place. The next 15 chars are the number to convert and the last one is the sign '+' or '-' to do that possible. The same with the other number (28 to 42).
I need to keep this 12 chars right there and put, next to that, a length=8 PD, positive o negative (it depends in the sign (last position)).
I try it with a IFTHEN but I have troubles with the 2nd number.

Can you giveme a hand?
Thanks to read!
_________________
"No hay fé sin sangre."
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

dbzTHEdinosauer
Moderator


Joined: 02 Oct 2006
Posts: 975

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Dec 18, 2014 10:00 pm    Post subject: Reply with quote

why not show us your sort cards, so that they maybe corrected?
_________________
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
ShivanoTE
Member


Joined: 18 Dec 2014
Posts: 7

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Dec 18, 2014 11:02 pm    Post subject: Reply with quote

OK. I got this:

Code:
//STEP0040 EXEC PGM=SORT                                 
//SYSPRINT DD SYSOUT=*                                   
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=INFILE,DISP=SHR               
//SORTOUT  DD DSN=OUTFILE,                   
//            DISP=(NEW,CATLG),                         
//            SPACE=(TRK,(10,10),RLSE),                 
//            DCB=(RECFM=FB,DSORG=PS,LRECL=250,BLKSIZE=0)
//SYSIN    DD *                                         
  SORT   FIELDS=COPY                                     
  OUTREC IFTHEN=(WHEN=INIT,BUILD=(1,250)),               
            IFTHEN=(WHEN=(027,1,CH,EQ,C'-'),             
           OVERLAY=(013:13,14,FS,MUL,-1,TO=PD,LENGTH=8)),
            IFTHEN=(WHEN=(027,1,CH,EQ,C'+'),             
           OVERLAY=(013:13,14,FS,TO=PD,LENGTH=8)),       
            IFTHEN=(WHEN=(042,1,CH,EQ,C'-'),             
           OVERLAY=(021:28,14,FS,MUL,-1,TO=PD,LENGTH=8)),
            IFTHEN=(WHEN=(042,1,CH,EQ,C'+'),             
           OVERLAY=(021:28,14,FS,TO=PD,LENGTH=8))       


But it doesn't work correctly. If the signs are distinct between the two 'columns' the signs in the PD number will be wrong.
I'm stuck, maybe I need to use CHANGE or another function, I don't know...
_________________
"No hay fé sin sangre."
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
ShivanoTE
Member


Joined: 18 Dec 2014
Posts: 7

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Feb 20, 2015 12:13 am    Post subject: Reply with quote

Finally I made the sort to convert those numeric fields...

Code:
//********************************************************************
//STEP0040 EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//SHOWDEF  DD SYSOUT=*                                                 
//ENT1     DD DSN=ENTRADA1
//SAL1     DD DSN=SALIDA1,DISP=(NEW,CATLG),           
//            SPACE=(CYL,(5,5),RLSE),                                 
//            DCB=(RECFM=FB,DSORG=PS,LRECL=250,BLKSIZE=0)             
//ENT2     DD DSN=ENTRADA2,DISP=SHR                         
//SAL2     DD DSN=SALIDA2,DISP=(NEW,CATLG),           
//            SPACE=(CYL,(5,5),RLSE),                                 
//            DCB=(RECFM=FB,DSORG=PS,LRECL=250,BLKSIZE=0)             
//TOOLIN   DD *                                                       
  SUBSET FROM(ENT1) TO(SAL1) REMOVE OUTPUT HEADER TRAILER USING(FOR1)
  SUBSET FROM(ENT2) TO(SAL2) REMOVE OUTPUT HEADER TRAILER USING(FOR2)
//FOR1CNTL DD *                                                       
  OUTFIL FNAMES=SAL1,REMOVECC,                                         
          BUILD=(001,12,                                               
                 013,15,SFF,TO=PD,LENGTH=8,                           
                 028,15,SFF,TO=PD,LENGTH=8,                           
                 043,15,SFF,TO=PD,LENGTH=8,                             
                 058,15,SFF,TO=PD,LENGTH=8,                             
                 073,15,SFF,TO=PD,LENGTH=8,                             
                 088,15,SFF,TO=PD,LENGTH=8,                             
                 103,15,SFF,TO=PD,LENGTH=8,                             
                 118,15,SFF,TO=PD,LENGTH=8,                             
                 133,15,SFF,TO=PD,LENGTH=8,                             
                 148,15,SFF,TO=PD,LENGTH=8,                             
                 163,15,SFF,TO=PD,LENGTH=8,                             
                 250:C'*')                                             
//FOR2CNTL DD *                                                         
  OUTFIL FNAMES=SAL2,REMOVECC,                                         
          BUILD=(001,12,                                               
                 013,15,SFF,TO=PD,LENGTH=8,                             
                 028,15,SFF,TO=PD,LENGTH=8,                             
                 043,15,SFF,TO=PD,LENGTH=8,                             
                 058,15,SFF,TO=PD,LENGTH=8,                             
                 073,15,SFF,TO=PD,LENGTH=8,                             
                 088,15,SFF,TO=PD,LENGTH=8,                             
                 103,15,SFF,TO=PD,LENGTH=8,                             
                 118,15,SFF,TO=PD,LENGTH=8,                             
                 133,15,SFF,TO=PD,LENGTH=8,                             
                 148,15,SFF,TO=PD,LENGTH=8,                             
                 163,15,SFF,TO=PD,LENGTH=8,                             
                 250:C'*')                                             


The problem is the inverse (PD to SFF). The problem is the sign, I managed to put it at the start of the field instead in the end. The function "EDIT(TTT....),SIGNS(+,-)" does not work in that case. Any body know why?
This is what I got:

Code:
//********************************************************************
//STEP0040 EXEC PGM=SORT                                               
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=ENTRADA
//SORTOUT  DD DSN=SALIDA,
//            SPACE=(CYL,(5,5),RLSE),                                 
//            DCB=(RECFM=FB,DSORG=PS,LRECL=500,BLKSIZE=0)             
//SYSIN    DD *                                                       
  OPTION COPY                                                         
  OUTFIL FNAMES=SORTOUT,REMOVECC,                                     
        HEADER1=(C'HDR - ',             
                 DATENS=(4MD),           
                 500:C'*'),                 
          BUILD=(001,12,                                               
                 013,08,PD,M26,                                       
                 021,08,PD,M26,                                         
                 029,08,PD,M26,                                         
                 037,08,PD,M26,                                         
                 045,08,PD,M26,                                         
                 053,08,PD,M26,                                         
                 061,08,PD,M26,                                         
                 069,08,PD,M26,                                         
                 077,08,PD,M26,                                         
                 085,08,PD,M26,                                         
                 093,08,PD,M26,                                         
                 101,08,PD,M26,                                         
                 109,08,PD,M26,                                         
                 117,08,PD,M26,                                         
                 125,08,PD,M26,                                         
                 133,08,PD,M26,                                         
                 141,08,PD,M26,                                         
                 149,08,PD,M26,                                         
                 157,08,PD,M26,                                         
                 165,08,PD,M26,                                         
                 173,08,PD,M26,                                         
                 181,08,PD,M26,                                         
                 189,03,                                               
                 500:C'*'),                                             
       TRAILER1=(C'TRL - ',             
                 C'CANT. REG = ',         
                 COUNT(M11,LENGTH=10), 
                 500:C'*')                 
//                                                                     

_________________
"No hay fé sin sangre."
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts To copy a load module mem from one pds to another thru rexx 6 meena_cts 12569 Mon Feb 01, 2016 10:55 pm
academyindia4 View latest post
No new posts Control flow from one STEP to another 9 pkaushi 29496 Mon Feb 01, 2016 10:55 pm
academyindia4 View latest post
No new posts Copy GDG to GDG (one to one). 6 arrbee 20212 Mon Feb 01, 2016 10:54 pm
academyindia4 View latest post
No new posts CICs 7 vidhya 22155 Mon Feb 01, 2016 10:47 pm
academyindia4 View latest post
No new posts A Really Nice One. Don't Miss the Moral. 0 arrbee 8147 Thu Mar 09, 2006 7:51 pm
arrbee View latest post
 


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-7794.html