|
View previous topic :: View next topic
|
| Author |
Message |
elixir1986
New User
Joined: 10 Nov 2015 Posts: 45 Location: USA
|
|
|
|
Hi Team,
My mainframe PS input file is as below,
Requirement:
If column 3 in the input file contains Q then my output PS/PDS member should be static as shown below,
| Code: |
You are not eligible for asset tiering of brokerage accounts
|
If column 3 is Y the my output should be dynamic and contain multiple lines as shown below,
| Code: |
You are not eligible for asset tiering of brokerage accounts
You were were eligible till 2019-02-01.
Since you have been recently removed we want to give you another chance.
Please contact support team if any questions. |
My attempt:
I tried using ICETOOL where i kept the verbiage "You are not eligible for asset tiering of brokerage accounts" in a HEADER field since its the first line for both output are same. It worked fine.
| Code: |
OUTFIL REMOVECC,
HEADER1=(1:'You are not eligible for asset tiering of brokerage accounts') |
Now to get 2nd line partially i tried using below and worked fine.
| Code: |
OUTREC IFTHEN=(WHEN=(3,1,CH,EQ,C'Y'),
BUILD=(C'You were were eligible till ',80:X)) |
I am not sure of how to proceed to get the dyanamic 'YYYY-MM-DD' from input for 2nd line as well as 3rd and 4th line.
Any constructive suggestions are much appreciated.
Note: I have cooked up the verbiage and it has no relation to where I work. Thanks! |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
You could achieve this using a DFSORT step like this. Note that I have used dummy values, could be changed as per your actual requirement.
| Code: |
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
Y2019-02-01
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL IFTHEN=(WHEN=(3,1,CH,EQ,C'Q'),
BUILD=(C'ABCD')),
IFTHEN=(WHEN=(3,1,CH,EQ,C'Y'),
BUILD=(C'ABCD',/,C'PQRS',4,10)) |
|
|
| Back to top |
|
 |
elixir1986
New User
Joined: 10 Nov 2015 Posts: 45 Location: USA
|
|
|
|
Appreciate the constructive response. I tried below per your suggestion and it worked,
| Code: |
OPTION COPY
OUTFIL IFTHEN=(WHEN=(3,1,CH,EQ,C'Y'),
BUILD=(1:C'LINE 1 VERBIAGE.',80:X,/,
1:C'LINE 2 VERBIAGE ',4,10,C'.',80:X,/,
C'LINE 3 VERBIAGE.',80:X,/,
C'LINE 4 VERBIAGE.',80:X)),
IFTHEN=(WHEN=(3,1,CH,EQ,C'Q'),
BUILD=(1:C'LINE 1 VERBIAGE.',80:X)) |
When column 3 is Q, i got below output,
When column 3 is Y, i got below output,
| Code: |
LINE 1 VERBIAGE.
LINE 2 VERBIAGE 2019-02-01.
LINE 3 VERBIAGE.
LINE 4 VERBIAGE. |
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|