Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
REFORMATTING WITH JFY CLOBBERING OUTPUT DATA

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
speermb

New User


Joined: 27 Aug 2008
Posts: 21
Location: USA

PostPosted: Thu Nov 08, 2018 7:20 pm    Post subject: REFORMATTING WITH JFY CLOBBERING OUTPUT DATA
Reply with quote

Please help what am I doing wrong. The data is correct for 90% but it is messing up on some. Why is the GB record getting what it is. GB,"UNITED KINGDOM (ENGLAND WALES SCOTLAND NO. IRELAND) UN"TED,KINGDOM

I am just not seeing the issue. I'm going crazy it works on most the input. What am I missing?? icon_confused.gif

Code:

 //TOOLIN   DD *                                                               
  COPY FROM(INDD01)  TO(TMPDD01) USING(FMT1)                                   
  //FMT1CNTL DD *                                                               
   INREC FINDREP=(IN=C',',OUT=C'')                                             
   OUTFIL FNAMES=TMPDD01,                                                       
      IFTHEN=(WHEN=INIT,                                                       
         OVERLAY=(1:1,2,                                                       
                    3,55,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'),                 
                    58,40,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'),               
                    98,100,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'),               
                    198,100,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'),             
                    298,100,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'),             
                    398,100,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'),             
                    498,1,C',')),                                               
        IFTHEN=(WHEN=INIT,                                                     
         BUILD=(1,2,C',',3,499,                                                 
                SQZ=(SHIFT=LEFT,PAIR=QUOTE,PREBLANK=C'"',MID=C',')))           

iNPUT:
Code:

 =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----
 000082 GBUNITED KINGDOM (ENGLAND, WALES, SCOTLAND, NO. IRELAND) UNITED KINGDOM                          UNITED KINGDOM             
        CCEDCECC4DCDCCDD44CDCDCDC64ECDCE64ECDEDCDC64DD44CDCDCDC54EDCECC4DCDCCDD44444444444444444444444444EDCECC4DCDCCDD4444444444444
        72459354029574640D5573154B061352B023633154B056B09953154D04593540295746400000000000000000000000000459354029574640000000000000
 ----------------------------------------------------------------------------------------------------------------------------------
 000083 GDGRENADA                                                GRENADA                                 GRENADA                   
        CCCDCDCCC444444444444444444444444444444444444444444444444CDCDCCC444444444444444444444444444444444CDCDCCC44444444444444444444
        7479551410000000000000000000000000000000000000000000000007955141000000000000000000000000000000000795514100000000000000000000
 ----------------------------------------------------------------------------------------------------------------------------------
 000084 GEGEORGIA                                                GEORGIA                                 GEORGIA                   
        CCCCDDCCC444444444444444444444444444444444444444444444444CCDDCCC444444444444444444444444444444444CCDDCCC44444444444444444444
        7575697910000000000000000000000000000000000000000000000007569791000000000000000000000000000000000756979100000000000000000000
 ----------------------------------------------------------------------------------------------------------------------------------
 000085 GFFRENCH GUIANA                                          FRENCH GUIANA                           FRENCH GUIANA             
        CCCDCDCC4CECCDC444444444444444444444444444444444444444444CDCDCC4CECCDC444444444444444444444444444CDCDCC4CECCDC44444444444444
        7669553807491510000000000000000000000000000000000000000006955380749151000000000000000000000000000695538074915100000000000000
 ----------------------------------------------------------------------------------------------------------------------------------
 000086 GGGUERNSEY                                               GUERNSEY                                GUERNSEY                   
        CCCECDDECE44444444444444444444444444444444444444444444444CECDDECE44444444444444444444444444444444CECDDECE4444444444444444444
        7774595258000000000000000000000000000000000000000000000007459525800000000000000000000000000000000745952580000000000000000000
 ----------------------------------------------------------------------------------------------------------------------------------
 000087 GHGHANA                                                  GHANA                                   GHANA                     
        CCCCCDC44444444444444444444444444444444444444444444444444CCCDC44444444444444444444444444444444444CCCDC4444444444444444444444
        7878151000000000000000000000000000000000000000000000000007815100000000000000000000000000000000000781510000000000000000000000


OUTPUT
Code:

GB,"UNITED KINGDOM (ENGLAND WALES SCOTLAND NO. IRELAND) UN"TED,KINGDOM
GD,"GRENADA","GRENADA","GRENADA","GRENADA","","",N,                   
GE,"GEORGIA","GEORGIA","GEORGIA","GEORGIA","","",N,                   
GG,"GUERNSEY","GUERNSEY","GUERNSEY","","","UNITED KINGDOM",N,         
GI,"GIBRALTAR","GIBRALTAR","GIBRALTAR","","","UNITED KINGDOM",N,   



Desired output
Code:

GB,"UNITED KINGDOM (ENGLAND WALES SCOTLAND NO. IRELAND)","UNTED KINGDOM","UNTED KINGDOM","",N,
GD,"GRENADA","GRENADA","GRENADA","GRENADA","","",N,                   
GE,"GEORGIA","GEORGIA","GEORGIA","GEORGIA","","",N,                   
GG,"GUERNSEY","GUERNSEY","GUERNSEY","","","UNITED KINGDOM",N,         
GI,"GIBRALTAR","GIBRALTAR","GIBRALTAR","","","UNITED KINGDOM",N,   
Back to top
View user's profile Send private message

sergeyken

Active User


Joined: 29 Apr 2008
Posts: 377
Location: Maryland

PostPosted: Thu Nov 08, 2018 8:16 pm    Post subject:
Reply with quote

Try to run without JFY parameters, then add them one by one until this issue occurred again.

Then you can narrow the suspicious area.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2423
Location: @my desk

PostPosted: Thu Nov 08, 2018 8:40 pm    Post subject:
Reply with quote

speermb,

You might want to change this
Code:
INREC FINDREP=(IN=C',',OUT=C'')
to

Code:
INREC FINDREP=(IN=C',',OUT=C' ')
to replace with a blank instead of 'nothing' coz that messes up the positions in your OVERLAY. With your FINDREP, the data shifts to the left for each comma replaced.
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 377
Location: Maryland

PostPosted: Thu Nov 08, 2018 9:50 pm    Post subject:
Reply with quote

Arun Raj wrote:
speermb,

You might want to change this
Code:
INREC FINDREP=(IN=C',',OUT=C'')
to

Code:
INREC FINDREP=(IN=C',',OUT=C' ')
to replace with a blank instead of 'nothing' coz that messes up the positions in your OVERLAY. With your FINDREP, the data shifts to the left for each comma replaced.

On my tablet screen, I was not able to distiguish between commas and dots in the input records.
There are really two commas in the input record, causing the rest of data to sheet two positions left (after FINDREP). So, the 'UN' from the last field moved to previous field becoming last two characters of it.

Really, replacement all commas with explicit space characters should help.

Even better solution might be using parameter PREBLANK=C',' in JFY, instead of FINDREP.

I'd like to note that I prefer giving some hints to TS, as in my first reply, just to make the TS to find his problem by himself. It' not good idea to give ready solutions on user's own errors.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2423
Location: @my desk

PostPosted: Thu Nov 08, 2018 10:16 pm    Post subject:
Reply with quote

sergeyken wrote:
There are really two commas in the input record, causing the rest of data to sheet two positions left (after FINDREP). So, the 'UN' from the last field moved to previous field becoming last two characters of it.
There are 3 commas in the input, so the 'UNI' is pushed to the previous field.

After FINDREP:
Code:
----+----1----+----2----+----3----+----4----+----5----+
UNITED KINGDOM (ENGLAND WALES SCOTLAND NO. IRELAND) UNI

After JFY :
Code:
----+----1----+----2----+----3----+----4----+----5----+
"UNITED KINGDOM (ENGLAND WALES SCOTLAND NO. IRELAND) UN
Back to top
View user's profile Send private message
speermb

New User


Joined: 27 Aug 2008
Posts: 21
Location: USA

PostPosted: Fri Nov 09, 2018 8:31 am    Post subject:
Reply with quote

Thanks for the response.
I had actually figured out this INREC FINDREP=(IN=C',',OUT=C'') was bad and changed to INREC FINDREP=(IN=C',',OUT=C' '. That was still causing field length error where I got:

Code:


GB,"UNITED KINGDOM (ENGLAND  WALES  SCOTLAND  NO  IRELAND)"UNITED,KINGDO



So I updated the code to PREBLANK=C',' on each field expecting it to make all commas in field 3,55 a space.

Code:

IFTHEN=(WHEN=INIT,                                               
   BUILD=(1:1,2,C',',                                             
             003,055,JFY=(SHIFT=LEFT,PREBLANK=C',',               
                          LEAD=C'"',TRAIL=C'"',LENGTH=57),       
             058,040,JFY=(SHIFT=LEFT,PREBLANK=C',',               
                          LEAD=C'"',TRAIL=C'"',LENGTH=42),       
             098,100,JFY=(SHIFT=LEFT,PREBLANK=C',',               
                          LEAD=C'"',TRAIL=C'"',LENGTH=102),       
             198,100,JFY=(SHIFT=LEFT,PREBLANK=C',',               
                          LEAD=C'"',TRAIL=C'"',LENGTH=102),       
             298,100,JFY=(SHIFT=LEFT,PREBLANK=C',',               
                          LEAD=C'"',TRAIL=C'"',LENGTH=102),       
             398,100,JFY=(SHIFT=LEFT,PREBLANK=C',',               
                          LEAD=C'"',TRAIL=C'"',LENGTH=102),       
             498,1,C','))                                         


but the data is still not replacing the ',' in the fields

Code:

FM,"MICRONESIA, FEDERATED STATES OF"                        "MICRONESIA,
FO,"FAROE ISLANDS"                                          "FAROE ISLAN
FR,"FRANCE"                                                 "FRANCE"   
GA,"GABON"                                                  "GABON"     
GB,"UNITED KINGDOM (ENGLAND, WALES, SCOTLAND, NO. IRELAND)" "UNITED KING


how do I get

Code:

FM,"MICRONESIA FEDERATED STATES OF"                         "MICRONESIA,
FO,"FAROE ISLANDS"                                          "FAROE ISLAN
FR,"FRANCE"                                                 "FRANCE"   
GA,"GABON"                                                  "GABON"     
GB,"UNITED KINGDOM (ENGLAND WALES SCOTLAND NO. IRELAND)" "UNITED KING
[/code]
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2423
Location: @my desk

PostPosted: Fri Nov 09, 2018 6:57 pm    Post subject:
Reply with quote

sergeyken wrote:
Even better solution might be using parameter PREBLANK=C',' in JFY, instead of FINDREP.
PREBLANK in JFY can replace only specific leading or trailing characters to blanks before justify processing, not the ones embedded in a field. So it does not apply here.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1027
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Nov 09, 2018 7:12 pm    Post subject:
Reply with quote

Quote:
PREBLANK can replace only specific leading or trailing characters to blanks before justify processing, not the ones embedded in a field. So it does not apply here.


Incorrect, it will preblank all instances. I've just checked on my system.

Garry
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 377
Location: Maryland

PostPosted: Fri Nov 09, 2018 8:05 pm    Post subject:
Reply with quote

Quote:
- How do I create a working product?
- Just take a piece of shit, and remove unneeded parts of it.


Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
GBUNITED KINGDOM (ENGLAND, WALES, SCOTLAND, NO. IRELAND) UNITED KINGDOM
GDGRENADA                                                GRENADA       
GEGEORGIA                                                GEORGIA       
GFFRENCH GUIANA                                          FRENCH GUIANA 
GGGUERNSEY                                               GUERNSEY       
GHGHANA                                                  GHANA         


Code:
 INREC FINDREP=(INOUT=(C',',C' '))                           
 SORT FIELDS=COPY                                             
 OUTREC FIELDS=(1:1,2,C',',                                   
               003,055,SQZ=(SHIFT=LEFT,MID=C' ',             
                            LEAD=C'"',TRAIL=C'"',LENGTH=57), 
               058,015,SQZ=(SHIFT=LEFT,MID=C' ',             
                            LEAD=C'"',TRAIL=C'"',LENGTH=17), 
               C',')                                         
 END                                                         


Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
GB,"UNITED KINGDOM (ENGLAND WALES SCOTLAND NO. IRELAND)"    "UNITED KINGDOM" ,
GD,"GRENADA"                                                "GRENADA"        ,
GE,"GEORGIA"                                                "GEORGIA"        ,
GF,"FRENCH GUIANA"                                          "FRENCH GUIANA"  ,
GG,"GUERNSEY"                                               "GUERNSEY"       ,
GH,"GHANA"                                                  "GHANA"          ,
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2423
Location: @my desk

PostPosted: Fri Nov 09, 2018 8:07 pm    Post subject:
Reply with quote

Garry Carroll wrote:
Incorrect, it will preblank all instances. I've just checked on my system.
Garry, my comment (and the usage discussed here) was about JFY not SQZ.

DFSORT Application Programming Guide wrote:
PREBLANK=list
specifies a list of one or more characters to be changed to blanks before justify processing begins. Only leading and trailing characters are changed to blanks.
speermb,

You're on the right track with your latest card, just that you don't need the PREBLANK in JFY. Here is what I got when tried on 2 input fields and an input of LRECL=200. You can modify it to include all the input fields as per your data set attributes. Good luck.
SORTIN
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
GBUNITED KINGDOM (ENGLAND, WALES, SCOTLAND, NO. IRELAND  UNITED KINGDOM         
GDGRENADA                                                GRENADA               
GEGEORGIA                                                GEORGIA               
GFFRENCH GUIANA                                          FRENCH GUIANA         
GGGUERNSEY                                               GUERNSEY               
GHGHANA                                                  GHANA 
SORTOUT
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
GB,"UNITED KINGDOM (ENGLAND  WALES  SCOTLAND  NO. IRELAND","UNITED KINGDOM",
GD,"GRENADA","GRENADA",                                                     
GE,"GEORGIA","GEORGIA",                                                     
GF,"FRENCH GUIANA","FRENCH GUIANA",                                         
GG,"GUERNSEY","GUERNSEY",                                                   
GH,"GHANA","GHANA",                                                                 
Code:
  OPTION COPY                                                         
  INREC FINDREP=(IN=C',',OUT=C' ')                                     
  OUTFIL IFTHEN=(WHEN=INIT,                                           
          BUILD=(1:1,2,C',',                                           
          03,55,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=57),C',', 
          58,40,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=42),C',')),
         IFTHEN=(WHEN=INIT,                                           
          BUILD=(1,200,SQZ=(SHIFT=LEFT,PAIR=QUOTE)))                   
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1027
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Nov 12, 2018 3:35 pm    Post subject:
Reply with quote

Quote:
Garry, my comment (and the usage discussed here) was about JFY not SQZ.


icon_redface.gif icon_redface.gif

Garry
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DFSORT output in CSV for data spans i... hiravibk DFSORT/ICETOOL 0 Tue Nov 13, 2018 7:55 pm
No new posts Migrating AS400 to HIVE; Data type ma... sindhu.jose All Other Mainframe Topics 1 Tue Nov 06, 2018 1:06 pm
No new posts Merge data from record pairs ashokakash DFSORT/ICETOOL 5 Wed Oct 17, 2018 11:38 am
No new posts Calling and updating SAS Macro variab... Yogesh Jaiswal All Other Mainframe Topics 7 Thu Oct 11, 2018 12:37 pm
No new posts how to use RDZ for converting cobol c... balajiChid CICS 1 Tue Oct 09, 2018 8:40 pm

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