jcl code to change certain values in the o/p file.

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
moni
Member
Posts: 1
Joined: Fri Aug 23, 2013 1:59 pm
Location: bangalore

jcl code to change certain values in the o/p file.

Post by moni » Fri Aug 23, 2013 2:30 pm

I have an input file where i need the values of only certain fields to be updated by fetching the system date,remaining should be the same.

INPUT FILE:

%XMITIP (abc@gmail.COM xyz@gmail.COM) +
from someone@gmail.com +
replyto someone@gmail.com +
SUBJECT 'REPORTS' +
FILE ( 'DDPCN.INPUT.CA.REPORT' +
'DDPCN.INPUT.HI.REPORT' )
FILENAME (CA3QTR13A111.TXT +
HI3QTR13A111.TXT +
MSGDD MSG
format txt/text/9///no

here in CA3QTR13A111
1) 13 is the year ie :(2013)
this value should change for every year..this value shoud be fetched from system date.
2) 3 is the Quarter. the logic for quarter is :
IF MONTH IS = ' 1' ' 2' ' 3'
THEN OUTPUT SHOULD BE -----4
IF MONTH IS = ' 4' ' 5' ' 6'
THEN OUTPUT SHOULD BE -----1
IF MONTH IS =' 7' ' 8' ' 9'
THEN OUTPUT SHOULD BE -----2
IF MONTH IS ='10' '11' '12'
THEN OUTPUT SHOULD BE -----3

this should get updated in the output file accourdingly


OUTPUT FILE :

IF THE YEAR IS--- 2013 and month is 2--then output should be

%XMITIP (abc@gmail.COM xyz@gmail.COM) +
from someone@gmail.com +
replyto someone@gmail.com +
SUBJECT 'REPORTS' +
FILE ( 'DDPCN.INPUT.CA.REPORT' +
'DDPCN.INPUT.HI.REPORT' )
FILENAME (CA4QTR13A111.TXT +
HI4QTR13A111.TXT +
MSGDD MSG
format txt/text/9///no

IF THE YEAR IS--- 2014-and month is 8 -then output should be

%XMITIP (abc@gmail.COM xyz@gmail.COM) +
from someone@gmail.com +
replyto someone@gmail.com +
SUBJECT 'REPORTS' +
FILE ( 'DDPCN.INPUT.CA.REPORT' +
'DDPCN.INPUT.HI.REPORT' )
FILENAME (CA2QTR14A111.TXT +
HI2QTR13A111.TXT +
MSGDD MSG
format txt/text/9///no


[/img][/list][/list][/code]

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Sat Aug 24, 2013 12:45 am

Hopefully, you realize that JCL cannot do this . . .

JCL Can control the execution of some program to do this. The program might be your sort product, some other utility, or code you have written to do this.

Your e-mail info appears to have unmatched parenthesis.

As all of the "input" is a literal (except the date related info), why not build the entire e-mail control text rather than read it?
Have a good one

User avatar
Gurugars
Active Member
Posts: 107
Joined: Sat Oct 23, 2010 2:17 pm
Location: Chennai,India.

Post by Gurugars » Tue Aug 27, 2013 4:37 pm

As DikDude mentioned it can't be done thru JCL, but can be done using Sort.

Step 1. INREC - in inrec overlay the date (after the data texts) to the particular lines where you wanted to update few positions.

Step 2. OUTREC - in outrec, overlay the need position's charaters by validating the system date value (using ifthen when).

Hope this may help, if you don't get the needed result or finding difficulties somewhere please revert back with your code/result so far you have tried.


Thanks!
Guru:-)

You're never fully dressed without a smile :)

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others