View previous topic :: View next topic
|
Author |
Message |
mukesh ratnani
New User
Joined: 16 Sep 2010 Posts: 5 Location: india pune
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
mukesh ratnani
New User
Joined: 16 Sep 2010 Posts: 5 Location: india pune
|
|
|
|
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 |
|
|
mukesh ratnani
New User
Joined: 16 Sep 2010 Posts: 5 Location: india pune
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
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 |
|
|
mukesh ratnani
New User
Joined: 16 Sep 2010 Posts: 5 Location: india pune
|
|
|
|
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 |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
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 |
|
|
mukesh ratnani
New User
Joined: 16 Sep 2010 Posts: 5 Location: india pune
|
|
|
|
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 |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
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 |
|
|
|