Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How do we repeat the static data for each input file record?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Venkata Ramayya

New User


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

PostPosted: Mon Jan 28, 2008 2:15 am    Post subject: How do we repeat the static data for each input file record?
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    Post subject:
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: 39
Location: United States

PostPosted: Mon Jan 28, 2008 6:51 pm    Post subject:
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    Post subject: Reply to: How do we repeat the static data for each input fi
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: 39
Location: United States

PostPosted: Tue Jan 29, 2008 10:27 pm    Post subject: Reply to: How do we repeat the static data for each input fi
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 Moderator


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

PostPosted: Wed Jan 30, 2008 12:02 am    Post subject:
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: 39
Location: United States

PostPosted: Wed Jan 30, 2008 12:57 am    Post subject: Reply to: How do we repeat the static data for each input fi
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 Moderator


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

PostPosted: Wed Jan 30, 2008 1:50 am    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us