Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

override the sysin data through parm in ass compile jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
veena_nagesh2002
Warnings : 1

Active User


Joined: 07 May 2005
Posts: 110
Location: hyderabad

PostPosted: Tue Oct 14, 2008 4:33 pm    Post subject: override the sysin data through parm in ass compile jcl
Reply with quote

How to override the below bolded hard coded values through parm in the sysin card of jcl. below i am pasting the complie jcl and sysin card seperately

sysin card : the below bolded 3 values need to be replaced through parm

TITLE 'AFCDATE - A ROUTINE TO GET THE SYSTEM DATE'
FORMATS *
AFCDATE $ENTER BASE=(R12),SAVE=SAVEAREA
LR R6,R1 ARGLIST ADDRS NOW IN R6
TIME DEC DATE IN R1, FORMAT 00YYDDDC
SPACE 5
*
* CONVERT YEAR FROM YY TO YYYY
*
LM R2,R4,0(R6) GET ADDRESSES OF ARGUMENTS
ST R1,SYSDATE SAVE DATE DIGITS
MVI SYSDATE,X'19' SET YEAR TO 19YY
CLI SYSDATE+1,X'80' IF YEAR <= 80
BH GETYYYY
MVI SYSDATE,X'20' THEN YEAR MUST BE 20YY
EJECT
*
* CONVERT YYYY TO EBCDIC FORMAT AND TEST FOR LEAP YEAR
*
GETYYYY MVC TEMPVAL(2),SYSDATE PREPARE FOR CONVERSION
SRP TEMP(L'TEMP),63(R0),0 SHIFT RIGHT 1 DECIMAL DIGIT
UNPK YYYY,TEMP FORMAT TO EBCDIC YYYY
OI YYYY+3,X'F0' CHANGE SIGN TO 'F'
CVB R9,TEMP CONVERT YYYY TO BINARY
N R9,=X'00000003' LEAP YEAR IS ONE DIVISIBLE
BZ LEAPYEAR BY 4 (GOOD TO YEAR 2099)
MVC DAYTABLE+2,=H'28' MODIFY TABLE
MVC #DAYS,=F'365' NUMBER OF DAYS PER YEAR
B GETDDD
LEAPYEAR MVC DAYTABLE+2,=H'29' MODIFY TABLE
MVC #DAYS,=F'366' NUMBER OF DAYS PER YEAR
SPACE 4
*
* CONVERT DDD TO EBCDIC AND TEST FOR VALID DATE
*
GETDDD MVI TEMPVAL,X'00' CLEAR TEMP LOCN
MVC TEMPVAL+1(2),SYSDATE+2 PREPARE TO CONVERT DDD
UNPK DDD,TEMP FORMAT TO EBCDIC DDD
CVB R11,TEMP CONVERT DDD TO BINARY
CL R11,#DAYS CK ON DAYS PER YEAR
BNH GETMONTH
MVC YYYYDDD,ASTERISK ERROR FOUND
MVC YYYYMMDD,ASTERISK
MVC YYYYXXDD,ASTERISK
B SEND SYSDATE INVALID
SPACE 4
*
* DETERMINE WHICH MONTH DDD IS IN
*
GETMONTH SR R10,R10 INITIALIZE INDEX REG OF TABLE
LOOPDATE SH R11,DAYTABLE(R10) SUBTRACT DAYS OF MONTH(INDEXED)
BM GETXXMM RESULT ZRO OR NEGATIVE
BZ GETXXMM
LA R10,2(0,R10) INCREMENT INDEX BY 2
B LOOPDATE
EJECT
*
* GET XX, MM, DD & YYYYDDD
*
GETXXMM LH R9,MONTHS(R10) INDEX INTO MONTH TABLE
STH R9,XX XX HAS 2 DIGIT MONTH CODE
AH R11,DAYTABLE(R10) DD IN R11 IN BINARY
SRA R10,1 MM = R10/2 + 1
LA R10,1(0,R10) MM IN R10 IN BINARY
CVD R10,TEMP MM NOW IN PACKED DECIMAL
UNPK MM,TEMP MM IN ZONED FORMAT
OI MM+1,X'F0' CHANGE SIGN TO 'F'
CVD R11,TEMP DD NOW IN PACKED DECIMAL
UNPK DD,TEMP DD IN ZONED FORMAT
OI DD+1,X'F0' CHANGE SIGN TO 'F'
MVC YYYYMMDD(L'YYYY),YYYY MOVE IN YEAR
MVC YYYYXXDD(L'YYYY),YYYY MOVE IN YEAR
MVC YYYYMMDD+6(L'DD),DD MOVE IN DAY
MVC YYYYXXDD+6(L'DD),DD MOVE IN DAY
MVC YYYYXXDD+4(L'XX),XX MOVE IN MONTH
MVC YYYYMMDD+4(L'MM),MM MOVE IN MONTH
UNPK YYYYDDD,SYSDATE FORM JULIAN DATE
SPACE 4
SEND MVC 0(7,R2),Y2KDDD 1'ST PARM
MVC 0(L'YYYYMMDD,R3),Y2KMMDD 2'ND PARM
MVC 0(L'YYYYXXDD,R4),Y2KXXDD 3'RD PARM
SPACE 4
RESTORE $RTRN RC=0
EJECT
SYSDATE DS F
SAVEAREA DS 18F
MONTHS DC CL24'JAFEMRAPMYJNJLAUSEOCNODE'
DAYTABLE DC H'31'
DC H'00' MODIFIED TO 28 OR 29
DC H'31'
DC H'30'
RESTORE $RTRN RC=0
EJECT
SYSDATE DS F
SAVEAREA DS 18F
MONTHS DC CL24'JAFEMRAPMYJNJLAUSEOCNODE'
DAYTABLE DC H'31'
DC H'00' MODIFIED TO 28 OR 29
DC H'31'
DC H'30'
DC H'31'
DC H'30'
DC H'31'
DC H'31'
DC H'30'
DC H'31'
DC H'30'
DC H'31'
#DAYS DC F'000' NUMBER OF DAYS PER YEAR (365 OR 366)
TEMP DS 0D THESE 4 LINES ARE KEPT TOGETHER
TEMPFIL DC XL5'00'
TEMPVAL DC XL2'00'
TEMPSGN DC X'0F'
YYYY DS CL4 YEAR IN DISPLAY FORMAT
DDD DS CL3 JULIAN DAY IN DISPLAY FORMAT
DD DS H GREGORIAN DAY DISPLAY FORMAT
MM DS H MONTH IN FMT2
XX DS H MONTH IN FMT3
ASTERISK DC CL8'********' DATE IN FMT1
YYYYDDD DS CL8 DATE IN FMT1
YYYYMMDD DS CL8 DATE IN FMT2
YYYYXXDD DS CL8 DATE IN FMT3
Y2KDDD DC CL8'2008287' DATE IN FMT1 - TEST Y2K
Y2KMMDD DC CL8'20081013' DATE IN FMT2 - TEST Y2K
Y2KXXDD DC CL8'2008OC13' DATE IN FMT3 - TEST Y2K
LTORG
END

jcl step:

//*********************************************************************
//* ASSEMBLER COMPILE JOB
//*********************************************************************
//ASM EXEC PGM=ASMA90,
// COND=(4,LT),
// PARM=(NODECK,OBJECT)
//SYSPRINT DD SYSOUT=*
//SYSLIB DD DISP=SHR,DSN=SYS1.MACLIB
// DD DISP=SHR,DSN=SYSAROC.MACLIB
// DD DISP=SHR,DSN=IMSVS.IPCS.MACLIB
// DD DISP=SHR,DSN=DPRD#G.CHGMAN.CPY.BASE0
// DD DISP=SHR,DSN=DPRD#G.CHGMAN.DCL.BASE0
// DD DISP=SHR,DSN=DPRD#G.CHGMAN.RSD.COPYLIB
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(2,2))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(2,2))
//SYSPUNCH DD DUMMY,DCB=BLKSIZE=80
//SYSLIN DD DISP=(,PASS),DSN=&&OBJECT,
// UNIT=SYSDA,SPACE=(CYL,(1,1)),

// DCB=(BLKSIZE=400)
//SYSIN DD DSN=EFA1T.FINCADS.ASM.TEST.NEW(AFCDATE),
// DISP=SHR
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Oct 14, 2008 9:54 pm    Post subject:
Reply with quote

Hello,

You could change the program so that the values are not literals but are data read from sysin at runtime.
Back to top
View user's profile Send private message
veena_nagesh2002
Warnings : 1

Active User


Joined: 07 May 2005
Posts: 110
Location: hyderabad

PostPosted: Fri Oct 17, 2008 12:34 pm    Post subject:
Reply with quote

can you give me a sample code if its available
Back to top
View user's profile Send private message
renzreny

New User


Joined: 16 Oct 2008
Posts: 7
Location: USA

PostPosted: Fri Oct 17, 2008 6:37 pm    Post subject:
Reply with quote

Veena,

Logic is like this. I'm passing dates through SYSIN parameter and those dates are used to over-ride the existing values of Y2KDDD, Y2KMMDD, Y2KXXDD. I've tested this program and it works fine for me.


Source Program

Code:
         TITLE 'OVER-RIDE DATE THRU SYSIN PARM'
TESTPGM  CSECT
         LINK13 (12,8),STAMP
         SPACE
         COPY  REGISTER
         SPACE
         USING  SYSINREC,R9
***********************************************************************
*               MAIN LOGIC TO HANDLE RECORDS                          *
***********************************************************************
         OPEN  SYSIN
         SPACE 3
READSYSN NOP   ENDOFPGM
         OI    READSYSN+1,X'F0'
         SPACE 3
GETREC   GET   SYSIN
         LR    R9,R1
         CLI   0(R9),C'*'
         BE    GETREC
         MVC   Y2KDDD,WY2KDDD WY2KDDD
         MVC   Y2KMMDD,WY2KMMDD
         MVC   Y2KXXDD,WY2KXXDD
         SPACE 3
ENDOFPGM EXIT13
***********************************************************************
*              W O R K I N G    S T O R A G E   S E C T I O N         *
***********************************************************************
         SPACE
SAVEADDR DS F
Y2KDDD   DC CL8'2008287'  DATE IN FMT1 - TEST Y2K
Y2KMMDD  DC CL8'20081013' DATE IN FMT2 - TEST Y2K
Y2KXXDD  DC CL8'2008OC13' DATE IN FMT3 - TEST Y2K
         SPACE
***********************************************************************
*              D C B     D E C L A R A T I O N S                      *
***********************************************************************
         SPACE
SYSIN    DCB   DDNAME=SYSIN,DSORG=PS,MACRF=GL
         SPACE
***********************************************************************
*                           D S E C T                                 *
***********************************************************************
SYSINREC DSECT
WY2KDDD  DS    CL8
         DS    CL1
WY2KMMDD DS    CL8
         DS    CL1
WY2KXXDD DS    CL8
         DS    CL74





JCL

Code:
//RENZRENY JOB 00000000,'TESTPGM ',CLASS=B,                           
//             MSGCLASS=X,                                             
//             USER=RENZRENY                                           
//STEP02   EXEC PGM=TESTPGM                                             
//STEPLIB  DD   DSN=SCMAX.UNIT9.LOADLIB,DISP=SHR                       
//SYSPRINT DD  SYSOUT=*                                               
//SYSIN    DD  *                                                       
*Y2KDDD  Y2KMMDD  Y2KXXDD                                             
2008291  20081017 2008OC17                                             




Thanks,
reny


[/code]
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 -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Paasing symbolic parameter to instrea... Anirudh Anand JCL & VSAM 1 Thu Jul 27, 2017 1:22 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 11 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us