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

justification with edit mask?


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

New User


Joined: 20 Jan 2010
Posts: 26
Location: Alabama

PostPosted: Sat Jul 28, 2012 7:33 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Jul 28, 2012 10:16 pm
Reply with quote

What version of DFSort are you using? That is - please show us the ICE201I message.
Back to top
View user's profile Send private message
rss0213

New User


Joined: 20 Jan 2010
Posts: 26
Location: Alabama

PostPosted: Sat Jul 28, 2012 10:26 pm
Reply with quote

Code:
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Jul 28, 2012 10:44 pm
Reply with quote

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
View user's profile Send private message
rss0213

New User


Joined: 20 Jan 2010
Posts: 26
Location: Alabama

PostPosted: Sat Jul 28, 2012 10:54 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Jul 28, 2012 10:58 pm
Reply with quote

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
View user's profile Send private message
rss0213

New User


Joined: 20 Jan 2010
Posts: 26
Location: Alabama

PostPosted: Sat Jul 28, 2012 11:57 pm
Reply with quote

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'AAA@MYSERVER.COM')),
       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@AAA@MYSERVER.COM')),
       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@AAA@MYSERVER.COM')),
       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@AAA@MYSERVER.COM')),
       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@AAA@MYSERVER.COM'))
OUTFIL BUILD=(1:C'HELO AAA@MYSERVER.COM',/,
  C'MAIL FROM:<ME@AAA@MYSERVER.COM>',/,
  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:<ME@MYSERVER.COM>
RCPT TO:<BBB@MYSERVER.COM
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
View user's profile Send private message
rss0213

New User


Joined: 20 Jan 2010
Posts: 26
Location: Alabama

PostPosted: Sun Jul 29, 2012 12:00 am
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sun Jul 29, 2012 12:09 am
Reply with quote

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
View user's profile Send private message
knickraj
Warnings : 1

New User


Joined: 11 Jun 2007
Posts: 50
Location: Euro

PostPosted: Sun Jul 29, 2012 2:07 pm
Reply with quote

rss0213,

if I have read correctly your sort card.
you have only recepient value as variable on position 36

Code:
36:C'BBB@AAA@MYSERVER.COM'


instead of mutiple build you can use one build and use several ifthen overlay
at postion 36.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Jul 29, 2012 3:43 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Jul 30, 2012 10:00 pm
Reply with quote

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'AAA@MYSERVER.COM')),                               
  IFTHEN=(WHEN=(1,3,CH,EQ,C'BBB'),                                 
  OVERLAY=(36:C'BBB@AAA@MYSERVER.COM')),                           
  IFTHEN=(WHEN=(1,3,CH,EQ,C'CCC'),                                 
  OVERLAY=(36:C'CCC@AAA@MYSERVER.COM')),                           
  IFTHEN=(WHEN=(1,3,CH,EQ,C'DDD'),                                 
  OVERLAY=(36:C'DDD@AAA@MYSERVER.COM')),                           
  IFTHEN=(WHEN=(1,3,CH,EQ,C'DDD'),                                 
  OVERLAY=(36:C'DDD@AAA@MYSERVER.COM')),                           
  IFTHEN=(WHEN=(1,3,CH,EQ,C'EEE'),                                 
  OVERLAY=(36:C'LONGEMAILADDRESSFORMAILIN.COM'))                   
                                                                   
  OUTFIL BUILD=(1:C'HELO AAA@MYSERVER.COM',/,                       
    C'MAIL FROM:<ME@AAA@MYSERVER.COM>',/,                           
    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
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 Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Need help to resolve a hard edit COBOL Programming 8
This topic is locked: you cannot edit posts or make replies. Need help to resolve a hard edit COBOL Programming 4
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
Search our Forums:

Back to Top