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

join 2 records to create 1 record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mukesh ratnani

New User


Joined: 16 Sep 2010
Posts: 5
Location: india pune

PostPosted: Thu Sep 16, 2010 1:48 pm
Reply with quote

0STATE: 49 WYOMING LINE: H
+____________________________________
| FIELD NAME: |
+____________________________________
|MF08-RATING-INDEX |
| |
+____________________________________
-
0STATE: 49 WYOMING LINE: H
+____________________________________
| FIELD NAME: |
+____________________________________
|MF08-RATING-INDEX |
| |
+____________________________________
0STATE: 01 ALABAMA LINE:
+___________________________________
| FIELD NAME:
+___________________________________
|MF08-WIND-PO
|MF08-RATING-INDEX
|MF08-COV-A-BASE-PREM
|MF08-COV-A-ENDSE-PREM
|MF08-ACT-PREM-CHANGE
|MF08-FL-HURR-WIND-BASE-PREM
|MF08-HURR-DED-FORCED
|
|MF34-ACCT-ORIG-PREM
|MF34-ACCT-1YR-PREPD-TOTAL
|MF34-PREV-TOT-QUART-ANN-PREM
|MF34-PREV-BASIC-POL-PREM
|MF34-REPL-COST-SAVED
-
0STATE: 02 ARIZONA LINE
+_________________________________
| FIELD NAME:
+_________________________________
|MF08-TERR-CODE
|MF08-COV-A-BASE-PREM
|MF08-COV-A-ENDSE-PREM
|MF08-STAT-NIASA-TERR-CODE
|MF08-ACT-PREM-CHANGE
|MF08-TRUE-TIER
|
|MF34-ACCT-ORIG-PREM
|MF34-ACCT-1YR-PREPD-TOTAL
|MF34-PREV-TOT-QUART-ANN-PREM
|MF34-PREV-BASIC-POL-PREM
|MF34-SECURITY-SYS-SAVED
|MF34-DEDUCTIBLES-SAVED
|MF34-REPL-COST-SAVED
|
+_________________________________

I have state wise listing of fields as shown above. I need to display State in same line against each field. is it possible using sort ??[/b]
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Sep 16, 2010 7:17 pm
Reply with quote

Hello,

You need to post the output that is needed from your sample input. . .

Also, mention the dsorg and lrecl of the files. Post any "rules" needed to get from the input to the output.
Back to top
View user's profile Send private message
mukesh ratnani

New User


Joined: 16 Sep 2010
Posts: 5
Location: india pune

PostPosted: Thu Sep 16, 2010 7:25 pm
Reply with quote

Both the input & output files need to have fixed format having fixed positions. you can assume it as FB 80.

output eg. - Field & state in same row -

|MF08-RATING-INDEX | WYOMING
|MF08-RATING-INDEX | WYOMING
|MF08-WIND-PO ALABAMA
|MF08-RATING-INDEX ALABAMA
|MF08-COV-A-BASE-PREM ALABAMA
|MF08-COV-A-ENDSE-PREM ALABAMA
|MF08-ACT-PREM-CHANGE ALABAMA
|MF08-FL-HURR-WIND-BASE-PREM ALABAMA
|MF08-HURR-DED-FORCED ALABAMA
Back to top
View user's profile Send private message
mukesh ratnani

New User


Joined: 16 Sep 2010
Posts: 5
Location: india pune

PostPosted: Thu Sep 16, 2010 7:27 pm
Reply with quote

sorry for improper alignment
output eg. - Field & state in same row -

Code:
|MF08-RATING-INDEX           WYOMING
|MF08-RATING-INDEX           WYOMING
|MF08-WIND-PO                ALABAMA
|MF08-RATING-INDEX           ALABAMA
|MF08-COV-A-BASE-PREM        ALABAMA
|MF08-COV-A-ENDSE-PREM       ALABAMA
|MF08-ACT-PREM-CHANGE        ALABAMA
|MF08-FL-HURR-WIND-BASE-PREM ALABAMA
|MF08-HURR-DED-FORCED        ALABAMA
"Code'd"
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Sep 16, 2010 8:07 pm
Reply with quote

Hello,

When posting data, code, jcl, etc you can preserve alignment by using the "Code" tag (your last post has been "Coded".

Just copy/paste and then apply the Code tag (there is a Preview function so you can see how your post will appear to the forum). When the post appears the way you want, Submit.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Sep 16, 2010 8:19 pm
Reply with quote

mukesh ratnani,
Your input and output doesn't seem to match.

What happened to ARIZONA LINE?
Do you actually have records with | FIELD NAME: and pipe symbols?
What is the difference between MF08 records and MF34 records? Do you need to see only MF08 records in the output?

What is LRECL and RECFM for the input file? Also, it may help us if you define rules to get the requested output. Please, try to use code tags.

Thanks
Back to top
View user's profile Send private message
mukesh ratnani

New User


Joined: 16 Sep 2010
Posts: 5
Location: india pune

PostPosted: Thu Sep 16, 2010 8:24 pm
Reply with quote

Sorry for the confusion. Other lines don't matter to me. I can remove those using omit. I just need Field Names which start with 'MF' & their state Names against them in the same row.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Sep 16, 2010 8:35 pm
Reply with quote

mukesh ratnani,
Quote:
Other lines don't matter to me.
What do you mean by other lines?

Asking again...
What is the difference between MF08 records and MF34 records? Do you only want MF08 records in the output?

Thanks,
Back to top
View user's profile Send private message
mukesh ratnani

New User


Joined: 16 Sep 2010
Posts: 5
Location: india pune

PostPosted: Thu Sep 16, 2010 8:41 pm
Reply with quote

The input file is a report which has State name at top & then fields for that State. The field names start with 'MF' like MF01,MF02,MF08... I want all field names MF08 as well as MF34. I want records with Field names & there states against them in same row & State not at Top.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Sep 16, 2010 9:13 pm
Reply with quote

mukesh ratnani,
Please find below JCL. I am assuming input of 133 FB. Also I am assuming that state name always ends with the word 'LINE:'. I had to make this assumption because you don't show semicolon ':' for 02 ARIZONA LINE. For testing purpose I change second WYOMING to SOUTH CAROLINA, to make sure I have space for max. char.

Let me know if it works for you...

Code:
//STEP01   EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                         
0STATE: 49 WYOMING LINE: H                                             
+____________________________________                                   
| FIELD NAME: |                                                         
+____________________________________                                   
|MF08-RATING-INDEX                                                     
| |                                                                     
+____________________________________                                   
-                                                                       
0STATE: 49 SOUTH CAROLINA LINE: H                                       
+____________________________________                                   
| FIELD NAME: |                                                         
+____________________________________                                   
|MF08-RATING-INDEX                                                     
| |                                                                     
+____________________________________                                   
0STATE: 01 ALABAMA LINE:                                               
+___________________________________                                   
| FIELD NAME:                                                           
+___________________________________                                   
|MF08-WIND-PO                                                           
|MF08-RATING-INDEX                                                     
|MF08-COV-A-BASE-PREM                                                   
|MF08-COV-A-ENDSE-PREM                                                 
|MF08-ACT-PREM-CHANGE                                                   
|MF08-FL-HURR-WIND-BASE-PREM                                           
|MF08-HURR-DED-FORCED                                                   
|                                                                       
|MF34-ACCT-ORIG-PREM                                                   
|MF34-ACCT-1YR-PREPD-TOTAL                                             
|MF34-PREV-TOT-QUART-ANN-PREM                                           
|MF34-PREV-BASIC-POL-PREM                                               
|MF34-REPL-COST-SAVED                                                   
-                                                                       
0STATE: 02 ARIZONA LINE:                                               
+_________________________________                                     
| FIELD NAME:                                                           
+_________________________________                                     
|MF08-TERR-CODE                                                         
|MF08-COV-A-BASE-PREM                                                   
|MF08-COV-A-ENDSE-PREM                                                 
|MF08-STAT-NIASA-TERR-CODE                                             
|MF08-ACT-PREM-CHANGE                                                   
|MF08-TRUE-TIER                                                         
|                                                                       
|MF34-ACCT-ORIG-PREM                                                   
|MF34-ACCT-1YR-PREPD-TOTAL                                             
|MF34-PREV-TOT-QUART-ANN-PREM                                           
|MF34-PREV-BASIC-POL-PREM                                               
|MF34-SECURITY-SYS-SAVED                                               
|MF34-DEDUCTIBLES-SAVED                                                 
|MF34-REPL-COST-SAVED                                                   
|                                                                       
+_________________________________                                     
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
 INREC IFTHEN=(WHEN=INIT,                                               
               PARSE=(%01=(ABSPOS=12,ENDBEFR=C'LINE:',FIXLEN=19)),     
               OVERLAY=(134:%01)),                                     
       IFTHEN=(WHEN=GROUP,                                             
               BEGIN=(1,6,CH,EQ,C'0STATE'),                             
               PUSH=(134:134,19))                                       
  OPTION COPY                                                           
  OUTFIL INCLUDE=(2,2,CH,EQ,C'MF'),                                     
  BUILD=(1,30,1X,134,19)                                               
//*                                             


OUTPUT
Code:
|MF08-RATING-INDEX             WYOMING       
|MF08-RATING-INDEX             SOUTH CAROLINA
|MF08-WIND-PO                  ALABAMA       
|MF08-RATING-INDEX             ALABAMA       
|MF08-COV-A-BASE-PREM          ALABAMA       
|MF08-COV-A-ENDSE-PREM         ALABAMA       
|MF08-ACT-PREM-CHANGE          ALABAMA       
|MF08-FL-HURR-WIND-BASE-PREM   ALABAMA       
|MF08-HURR-DED-FORCED          ALABAMA       
|MF34-ACCT-ORIG-PREM           ALABAMA       
|MF34-ACCT-1YR-PREPD-TOTAL     ALABAMA       
|MF34-PREV-TOT-QUART-ANN-PREM  ALABAMA       
|MF34-PREV-BASIC-POL-PREM      ALABAMA       
|MF34-REPL-COST-SAVED          ALABAMA       
|MF08-TERR-CODE                ARIZONA       
|MF08-COV-A-BASE-PREM          ARIZONA       
|MF08-COV-A-ENDSE-PREM         ARIZONA       
|MF08-STAT-NIASA-TERR-CODE     ARIZONA       
|MF08-ACT-PREM-CHANGE          ARIZONA       
|MF08-TRUE-TIER                ARIZONA       
|MF34-ACCT-ORIG-PREM           ARIZONA       
|MF34-ACCT-1YR-PREPD-TOTAL     ARIZONA       
|MF34-PREV-TOT-QUART-ANN-PREM  ARIZONA       
|MF34-PREV-BASIC-POL-PREM      ARIZONA       
|MF34-SECURITY-SYS-SAVED       ARIZONA       
|MF34-DEDUCTIBLES-SAVED        ARIZONA       
|MF34-REPL-COST-SAVED          ARIZONA       


Thanks,
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top