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

How do we repeat the static data for each input file record?


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

New User


Joined: 03 Dec 2007
Posts: 49
Location: United States

PostPosted: Mon Jan 28, 2008 2:15 am
Reply with quote

Hi,

I have an input file with Mail Ids (Each mail id is one record).
The output file shuold have the static data for each mail id. For example

Input file - record length 80 :
--------------------------
Mail_id1@yahoo.com
Mail_id2@yahoo.com
Mail_id3@yahoo.com
--------------------------

Output file should be : - record length 80
--------------------------------------------------------------------------------------
helo NY03
mail from:<System_Support@yahoo.com>
rcpt to:<Mail_id1@yahoo.com>
data
From: System_Support@yahoo.com
To: Mail_id1@yahoo.com
cc:
Subject: Access Alert --- TEST
You have not accessed the the payment application for 150
days. If you do not access the application within 30 days, your access
will be revoked. Please contact Systems Support if you have questions.
.
helo NY03
mail from:<System_Support@yahoo.com>
rcpt to:<Mail_id2@yahoo.com>
data
From: System_Support@yahoo.com
To: Mail_id2@yahoo.com
cc:
Subject: Access Alert --- TEST
You have not accessed the the payment application for 150
days. If you do not access the application within 30 days, your access
will be revoked. Please contact Systems Support if you have questions.
.
helo NY03
mail from:<System_Support@yahoo.com>
rcpt to:<Mail_id3@yahoo.com>
data
From: System_Support@yahoo.com
To: Mail_id3@yahoo.com
cc:
Subject: Access Alert --- TEST
You have not accessed the the payment application for 150
days. If you do not access the application within 30 days, your access
will be revoked. Please contact Systems Support if you have questions.
.
--------------------------------------------------------------------------------------

Thanks
Venkat
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Jan 28, 2008 10:40 am
Reply with quote

Venkata Ramayya

Is the number of mail ID's in the input file is fixed?
Back to top
View user's profile Send private message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 49
Location: United States

PostPosted: Mon Jan 28, 2008 6:51 pm
Reply with quote

Hi Krisprems,

No, the number of records (mail ids) in the input file varies.

Thanks
Venkat
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Jan 28, 2008 9:31 pm
Reply with quote

use the following control cards

Code:

//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                               
  OUTFIL BUILD=(C'HELO NY03',/,                                 
                C'MAIL FROM:<SYSTEM_SUPPORT@YAHOO.COM>',/,       
                C'RCPT TO:<',1,72,JFY=(SHIFT=LEFT,TRAIL=C'>'),/,
                C'DATA',/,                                       
                C'FROM: SYSTEM_SUPPORT@YAHOO.COM',/,             
                C'TO: ',1,72,/,                                 
                C'CC: ',/,                                       
                C'SUBJECT: ACCESS ALERT --- TEST',/,             
                C'YOU HAVE NOT ACCESSED THE THE PAYMENT',       
                C'APPLICATION FOR 150',/,                       
                C'DAYS. IF YOU DO NOT ACCESS THE ',             
                C'APPLICATION WITHIN 30 DAYS, YOUR ACCESS',/,   
                C'WILL BE REVOKED. PLEASE CONTACT ',             
                C'SYSTEMS SUPPORT IF YOU HAVE QUESTIONS.',/,     
                C'.',80:X)                                       
//*                                                             
Back to top
View user's profile Send private message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 49
Location: United States

PostPosted: Tue Jan 29, 2008 10:27 pm
Reply with quote

Hi,

I was trying your code but the job gave return code 16

ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE222A 0 81 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 80 BYTE LRECL FOR SORTOUT

Can you please let me know what can be the wrong here?

Thanks
Venkat
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jan 30, 2008 12:02 am
Reply with quote

Either your SORTOUT data set was previously created with LRECL=80 or you specified LRECL=80 on the SORTOUT DD statement.

Kolusu's job actually creates a data set with a record length of 81 bytes because of this line:

C'RCPT TO:<',1,72,JFY=(SHIFT=LEFT,TRAIL=C'>'),/,

'RCPT TO:<' is 9 bytes + 72 bytes for 1,72 = 81 bytes. DFSORT uses the longest record length of the BUILD lines as the LRECL. If you don't specify an LRECL, then DFSORT sets the LRECL automatically. If you specify a different LRECL (e.g. LRECL=80), DFSORT issues the ICE222A error message.

So either let DFSORT set the LRECL to 81, or change the line above to:

C'RCPT TO:<',1,71,JFY=(SHIFT=LEFT,TRAIL=C'>'),/,

so that the record length and LRECL will both be 80.
Back to top
View user's profile Send private message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 49
Location: United States

PostPosted: Wed Jan 30, 2008 12:57 am
Reply with quote

Hi Frank,

Thanks, It is working now.

Can you please let me know what is the syntax

JFY=(SHIFT=LEFT,TRAIL=C'>')

Thanks
Venkat
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jan 30, 2008 1:50 am
Reply with quote

1,71,JFY=(SHIFT=LEFT,TRAIL=C'>')

Left justifies the characters in positions 1-71 and puts a trailing '>' character after the last non-blank.

For more information on DFSORT's JFY function, see my paper at:

Use [URL] BBCode for External Links
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top