Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

join 2 records to create 1 record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: join 2 records to create 1 record
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

Site Director


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

PostPosted: Thu Sep 16, 2010 7:17 pm    Post subject:
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    Post subject: Reply to: join 2 records to create 1 record
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    Post subject:
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

Site Director


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

PostPosted: Thu Sep 16, 2010 8:07 pm    Post subject:
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: 578
Location: USA

PostPosted: Thu Sep 16, 2010 8:19 pm    Post subject:
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    Post subject: Reply to: join 2 records to create 1 record
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: 578
Location: USA

PostPosted: Thu Sep 16, 2010 8:35 pm    Post subject:
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    Post subject: Reply to: join 2 records to create 1 record
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: 578
Location: USA

PostPosted: Thu Sep 16, 2010 9:13 pm    Post subject:
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    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 Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us