|
View previous topic :: View next topic
|
| Author |
Message |
rss0213
New User
Joined: 20 Jan 2010 Posts: 26 Location: Alabama
|
|
|
|
Hi. I have an easy one (I hope)... I'm using SORT to build email notification cards from a control totals file. In my OUTREC BUILD statement, I'm trying to left justify input fields that also had a custom edit mask applied. So I coded the following:
| Code: |
OPTION COPY
OUTFIL BUILD=(1:C'HELO MYEMAILSERVER.COM',/,
...
C'--SIMPLE BOUNDARY',/,
C'CONTENT-TYPE: TEXT/PLAIN; CHARSET="US-ASCII"',2/,
C' DEPOSIT CUT: ',18:4,2,/,
C' DEPOSIT COUNT: ',18:13,7,ZD,EDIT=(IIIIIIT),
JFY=(SHIFT=LEFT),/,
C'DEPOSIT AMOUNT: ',18:20,10,ZD,EDIT=($II,III,IIT.TT),
JFY=(SHIFT=LEFT),/,
C'--SIMPLE BOUNDARY',2/) |
But I get a syntax error:
| Code: |
C'CONTENT-TYPE: TEXT/PLAIN; CHARSET="US-ASCII"',2/,
C' DEPOSIT CUT: ',18:4,2,/,
C' DEPOSIT COUNT: ',18:13,7,ZD,EDIT=(IIIIIIT),
JFY=(SHIFT=LEFT),/,
$
ICE007A E SYNTAX ERROR |
Any ideas why I'm getting this? If I don't apply the justification, the output is accurate, but it doesn't line up:
| Code: |
CONTENT-TYPE: TEXT/PLAIN; CHARSET="US-ASCII"
DEPOSIT CUT: 10
DEPOSIT COUNT: 5
DEPOSIT AMOUNT: $971,159.40 |
I want it to look like this:
| Code: |
CONTENT-TYPE: TEXT/PLAIN; CHARSET="US-ASCII"
DEPOSIT CUT: 10
DEPOSIT COUNT: 5
DEPOSIT AMOUNT: $971,159.40 |
|
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
| What version of DFSort are you using? That is - please show us the ICE201I message. |
|
| Back to top |
|
 |
rss0213
New User
Joined: 20 Jan 2010 Posts: 26 Location: Alabama
|
|
|
|
| Code: |
| ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1 |
|
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
well, i only see syntax for
p,m,justify
%nn,justify
but none for
edit,justify
but, i can't play on a machine and determine
if i have interpreted that SYNTAX diagrams on this page correctly. |
|
| Back to top |
|
 |
rss0213
New User
Joined: 20 Jan 2010 Posts: 26 Location: Alabama
|
|
|
|
| Hi Dick. In the manuals it wasn't clear to me if DFSORT is capable of doing both either (edit and justify). |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
i found this example while searching:
| Code: |
OPTION COPY
INREC BUILD=(1,03,4,5,ZD,EDIT=(IIIII),09,3)
OUTREC BUILD=(1,11,SQZ=(SHIFT=LEFT)) |
edit during the INREC
sqz or jfy on the outrec.
squeeze has the same syntax rules as jfy
p,m
%nn |
|
| Back to top |
|
 |
rss0213
New User
Joined: 20 Jan 2010 Posts: 26 Location: Alabama
|
|
|
|
One difference: I'm building multiple out records from one input record. According to the manual, I need to use the the BUILD operation of OUTFIL - not OUTREC. So here's the solution...
Input: A single-record file with a value that tells me who needs to receive the email in first three bytes. Also contains confirmation totals:
| Code: |
| BBB10000000600000050097115940 |
DFSORT Statements:
| Code: |
OPTION COPY
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'AAA'),
BUILD=(1:1,12,
13:13,07,ZD,EDIT=(I,III,IIT), *** apply edit masking to count
22:20,10,ZD,EDIT=($II,III,IIT.TT), *** edit masking for amount
36:C'[email protected]')),
IFTHEN=(WHEN=(1,3,CH,EQ,C'BBB'),
BUILD=(1:1,12,
13:13,07,ZD,EDIT=(I,III,IIT),
22:20,10,ZD,EDIT=($II,III,IIT.TT),
36:C'BBB@[email protected]')),
IFTHEN=(WHEN=(1,3,CH,EQ,C'CCC'),
BUILD=(1:1,12,
13:13,07,ZD,EDIT=(I,III,IIT),
22:20,10,ZD,EDIT=($II,III,IIT.TT),
36:C'CCC@[email protected]')),
IFTHEN=(WHEN=(1,3,CH,EQ,C'DDD'),
BUILD=(1:1,12,
13:13,07,ZD,EDIT=(I,III,IIT),
22:20,10,ZD,EDIT=($II,III,IIT.TT),
36:C'DDD@[email protected]')),
IFTHEN=(WHEN=(1,3,CH,EQ,C'EEE'),
BUILD=(1:1,12,
13:13,07,ZD,EDIT=(I,III,IIT),
22:20,10,ZD,EDIT=($II,III,IIT.TT),
36:C'EEE@[email protected]'))
OUTFIL BUILD=(1:C'HELO [email protected]',/,
C'MAIL FROM:<ME@[email protected]>',/,
C'RCPT TO:<',10:36,29,/, ** last field in record after INREC operation
C'DATA',/,
C'FROM: MY DEPARTMENT',/,
C'TO: ',5:1,3,8:C' THEIR DEPARTMENT',/,
C'SUBJECT:DEPOSITS CONFIRMATION',/,
C'MIME-VERSION: 1.0',/,
C'CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"',/,
C'--SIMPLE BOUNDARY',/,
C'CONTENT-TYPE: TEXT/PLAIN; CHARSET="US-ASCII"',2/,
C' DEPOSIT CUT: ',18:4,2,/,
C' DEPOSIT COUNT: ',18:13,9,JFY=(SHIFT=LEFT),/, *** left justify count
C' TOTAL AMOUNT: ',18:22,14,JFY=(SHIFT=LEFT),/, *** left justify amount
C'--SIMPLE BOUNDARY',2/) |
Output (Email cards to be gener'd to SMTP output class for email):
| Code: |
HELO MYSERVER.COM
MAIL FROM:<[email protected]>
RCPT TO:<[email protected]
DATA
FROM: MY DEPARTMENT
TO: THEIR DEPARTMENT
SUBJECT: DEPOSITS CONFIRMATION
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN; CHARSET="US-ASCII"
DEPOSIT CUT: 10
DEPOSIT COUNT: 5
DEPOSIT AMOUNT: $971,159.40
--SIMPLE BOUNDARY
|
|
|
| Back to top |
|
 |
rss0213
New User
Joined: 20 Jan 2010 Posts: 26 Location: Alabama
|
|
|
|
| Oh, and I had to substitute a different recipient value for the AAA, BBB, etc. That's why I had so many IFTHEN statements... |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
Scott,
thx for getting back to us.
glad you were successful.
Kolusu will drop by sometime monday and verify if indeed
sqz and jfy cannot follow edit |
|
| Back to top |
|
 |
knickraj Warnings : 1 New User

Joined: 11 Jun 2007 Posts: 50 Location: Euro
|
|
|
|
rss0213,
if I have read correctly your sort card.
you have only recepient value as variable on position 36
instead of mutiple build you can use one build and use several ifthen overlay
at postion 36. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Good thought knickraj.
Scott,
Perhaps you can look at CHANGE to do the 3-character code to the mail reference.
Perhaps you can do all the first part with one OVERLAY - are those values in 1,3 fully inclusive?
Yes, if you want to write multiple records with the / (slash operator) you have to do that on OUTFIL. |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
rss0213,
Your control cards can be simplified. The edit mask is the same for all the codes. You just have to overlay differently for the email address.
You can use the LEAD and TRAIL parms to generate the text you want while justifying the numeric fields.
Use the following control cards.
| Code: |
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,
BUILD=(01,12,13,07,ZD,EDIT=(I,III,IIT),
20,10,ZD,EDIT=($II,III,IIT.TT))),
IFTHEN=(WHEN=(1,3,CH,EQ,C'AAA'),
OVERLAY=(36:C'[email protected]')),
IFTHEN=(WHEN=(1,3,CH,EQ,C'BBB'),
OVERLAY=(36:C'BBB@[email protected]')),
IFTHEN=(WHEN=(1,3,CH,EQ,C'CCC'),
OVERLAY=(36:C'CCC@[email protected]')),
IFTHEN=(WHEN=(1,3,CH,EQ,C'DDD'),
OVERLAY=(36:C'DDD@[email protected]')),
IFTHEN=(WHEN=(1,3,CH,EQ,C'DDD'),
OVERLAY=(36:C'DDD@[email protected]')),
IFTHEN=(WHEN=(1,3,CH,EQ,C'EEE'),
OVERLAY=(36:C'LONGEMAILADDRESSFORMAILIN.COM'))
OUTFIL BUILD=(1:C'HELO [email protected]',/,
C'MAIL FROM:<ME@[email protected]>',/,
C'RCPT TO:<',10:36,29,/,
C'DATA',/,
C'FROM: MY DEPARTMENT',/,
C'TO: ',5:1,3,8:C' THEIR DEPARTMENT',/,
C'SUBJECT:DEPOSITS CONFIRMATION',/,
C'MIME-VERSION: 1.0',/,
C'CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"',/,
C'--SIMPLE BOUNDARY',/,
C'CONTENT-TYPE: TEXT/PLAIN; CHARSET="US-ASCII"',2/,
C' DEPOSIT CUT: ',4,2,/,
13,09,JFY=(SHIFT=LEFT,LENGTH=32,LEAD=C' DEPOSIT COUNT: '),/,
22,14,JFY=(SHIFT=LEFT,LENGTH=32,LEAD=C' TOTAL AMOUNT: '),/,
C'--SIMPLE BOUNDARY',2/)
//* |
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|