Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Converting Hex to PD Special Condition

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

New User


Joined: 29 Apr 2020
Posts: 14
Location: USA

PostPosted: Fri Oct 09, 2020 11:15 pm    Post subject: Converting Hex to PD Special Condition
Reply with quote

I am reading a table which is used to Create a file. I am converting Hex to PD, and everything works great except for 2 records, which have the zip code filled with spaces. Here is my desired output for this:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7-------+----7----+----8----+----9----+----0----+-
00499|MCCROCKLIN FORD          |683 NORTH EIGHTH    |   |MIDDLETOWN        |IN|    47356|
         
00500|AUTOPORT INC.            |203 PIGEON POINT R                         |           .|


Here is my Code:

Code:
000033  SORT FIELDS=COPY                                         
000034  INREC IFTHEN=(WHEN=(477,1,BI,EQ,X'40'),                 
000035        FINDREP=(INOUT=(X'40',X'F0')))                     
000036  OUTFIL FILES=OUT,                                       
000037         BUILD=(1:1,5, ,                     CUSTOMER     
000038                6:C'|',                                   
000039                7:7,25,                      CUSTOMER NAME
000040               32:C'|',                                   
000041               33:32,20,                     ADDRESS1     
000042               53:C'|',                                   
000043               54:52,20,                     ADDRESS2     
000044               74:C'|',                                   
000045               75:72,20,                     CITY & STATE 
000046               95:C'|',                                   
000047               96:92,5,PD,EDIT=(IIIIIIIIT),  ZIP           
000048              105:C'|',                                   
000049              106:X,                         FILLER       
000050              107:402,20,                    CNAME SHORT   
000051              127:5X,                        FILLER     
000052              132:C'|',                                 
000053              133:422,20,                    CADDRESS1 
000054              153:C'|',                                 
000055              154:442,20,                    CADDRESS2 
000056              174:C'|',                                 
000057              175:462,13,                    CCITY     
000058              188:5X,                        FILLER     
000059              193:C'|',                                 
000060              194:475,2,                     CSTATE     
000061              196:C'|',                                 
000062              197:477,5,PD,EDIT=(IIIIIIIIT), CZIP       
000063              206:C'|',                                 
000064              207:122,10,                    PHONE     
000065              217:C'|',                                 
000066              218:189,10,                    FAX       
000067              228:C'|',                                 
000068              229:163,1,                     CREDITA   
000069              230:C'|',                                 
000070              231:161,2,                     TYPE       


Here is my input data. The problem data is in columns 477 - 481.
Code:
 sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
 BROWSE    AH.AH0004.RTCUSEXT.G9451V00              Line 0000000821 Col 471 550
 Command ===>                                                  Scroll ===> PAGE
----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5
----+----F----+----F----+----F----+----F----+----F----+----F----+----F----+----F
----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+----5
 ------------------------------------------------------------------------------
N   IN..å.%                                                                     
D444CD00436444444444444444444444444444444444444444444444444444444444444444444444
5000950075C000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
                                                                               
44444444444444444444444444444444444444444444444444444444444444444444444444444444
00000000000000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------


Here is my output:
Code:

 
 BROWSE    PAGAT98.CUSTEXT.SLIO.SEP.TXT.SSORT       Line 0000000822 Col 161 240
 Command ===>                                                  Scroll ===> PAGE
----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4
             |                  |  |404040404|          |          |A|  |00| 0|
             |CHEEKTOWAGA       |NY|    14225|7168963938|7168973089|A|01|18|18|
             |JAMESTOWN         |NY|    14701|7164840121|7166640248|A|21|18|18|
             |GOUVERNEUR        |NY|    13642|3152870200|3152870960|A|01|69|69|
             |CENTRAL SQ        |NY|    13036|3156687102|3156683984|A|01|69|69|
             |MORROW            |GA|    30260|8884853029|6783643999|A|21|95|95|


Everything works great except where the Zip code in Cols 477-481 contains spaces (HEX 40). I cannot get an INREC or OUTREC statement to fix it. What am I doing wrong?
Back to top
View user's profile Send private message

Joerg.Findeisen

Active User


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

PostPosted: Fri Oct 09, 2020 11:49 pm    Post subject:
Reply with quote

Please try:
Code:
INREC IFTHEN=(WHEN=(477,5,BI,EQ,X'4040404040'),                 
  OVERLAY=(477:X'000000000C'))

It should print '0' instead.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 865
Location: Maryland

PostPosted: Sat Oct 10, 2020 12:19 am    Post subject:
Reply with quote

A better approach:
Code:
INREC IFTHEN=(WHEN=(477,5,PD,NE,NUM),                 
  OVERLAY=(477:X'000000000C'))

It should print '0' instead of any wrong data in that field.
Back to top
View user's profile Send private message
Rick Ryan

New User


Joined: 29 Apr 2020
Posts: 14
Location: USA

PostPosted: Tue Oct 13, 2020 11:13 pm    Post subject:
Reply with quote

Thank you so much! It works PERFECTLY!!!!!! icon_razz.gif
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 special characters pipes "|"... VINAY PALLELA COBOL Programming 1 Mon Jun 08, 2020 9:19 am
No new posts Print next line strings when a condit... tgmuntor DFSORT/ICETOOL 9 Wed May 20, 2020 9:08 pm
No new posts Using ICETOOL set return code as per ... Bhuvana Narasimhan DFSORT/ICETOOL 4 Fri Jan 24, 2020 12:58 pm
No new posts Usage of external condition Sakthidevi PL/I & Assembler 1 Sat Nov 23, 2019 1:46 pm
No new posts FTP - Special characters are converte... Chinnadu TSO/ISPF 3 Tue Nov 12, 2019 6:01 pm

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us