|
|
| Author |
Message |
Deepa.m Warnings : 1 Active User
Joined: 28 Apr 2005 Posts: 88
|
|
|
|
I need to create a dynamic NDM card for file transfer between two systems. I have input file with generic card
SIGNON ESF=YES CASE=YES
SUBMIT PROC=PROC1 -
NEWNAME=XXXXXX -
PNODE=SYM1 -
SNODE=UNIX2 -
&SNDNODE=PNODE -
&RECNODE=SNODE -
&DSN01=ABC.XXX.YYY.DMMDDYY -
&DISP01=(SHR,KEEP,KEEP) -
&DSN02='work/data/t1.txt' -
&OPCJOB=XXXXXXX -
&OPCNODE=PNODE
SIGNOFF
I have create a dynamic card everyday by replacing the
DSN01 = ABC.XXX.YYY.DMMDDYY with
ABC.XXX.YYY.D102407 (month/date/year) so that current file is transmitted every day.
Currently we are doing this in cobol program. I believe there should a much easier Solution using DFSORT using Date functions? |
|
| Back to top |
|
 |
References
|
|
 |
Deepa.m Warnings : 1 Active User
Joined: 28 Apr 2005 Posts: 88
|
|
|
|
To add with this
The location of MMDDYY in the record varies depending on the DSN name length and we need to do inspect every record if MMDDYY is there and replace it with current date.
but strictly speaking we should not replace MMDDYY other than in &DSN01 but I assume MMDDYY will not be found in any other line in the control card. |
|
| Back to top |
|
 |
Devzee
Senior Member
Joined: 20 Jan 2007 Posts: 708 Location: Hollywood
|
|
|
|
I believe in NDM, if you give dataset name with xx.dYYMMDD.ThhmmssT then then the literals YYMMDDD gets replaced with actual value and transmitted. We dont need to put the actual value, NDM does it.
Try and see if it works. |
|
| Back to top |
|
 |
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2039 Location: Israel
|
|
|
|
I think that in your case REXX will be much easier to write, test and maintain.
O. |
|
| Back to top |
|
 |
Deepa.m Warnings : 1 Active User
Joined: 28 Apr 2005 Posts: 88
|
|
|
|
We need to transmit the o/p of previous job which creates fataset with the DMMYYDD (D102207). so we cannot go in for xx.dYYMMDD.ThhmmssT
also Rexx /SAS option is also ruled out as we have prouctionizing issues.
Help me with some Solution using JCL. |
|
| Back to top |
|
 |
Devzee
Senior Member
Joined: 20 Jan 2007 Posts: 708 Location: Hollywood
|
|
|
|
| Quote: |
| some Solution using JCL |
Please wait for Frank to give solution to your reqt using DFSORT |
|
| Back to top |
|
 |
krisprems
Senior Member
Joined: 27 Nov 2006 Posts: 629 Location: India
|
|
|
|
Deepa.m
Here is a SORT JOB:
| Code: |
//*******************************************************
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
SIGNON ESF=YES CASE=YES
SUBMIT PROC=PROC1 -
NEWNAME=XXXXXX -
PNODE=SYM1 -
SNODE=UNIX2 -
&SNDNODE=PNODE -
&RECNODE=SNODE -
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
&DSN01=ABC.XXX.YYY.DMMDDYY -
&DISP01=(SHR,KEEP,KEEP) -
&DSN02='WORK/DATA/T1.TXT' -
&OPCJOB=XXXXXXX -
&OPCNODE=PNODE
SIGNOFF
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(1,6,CH,EQ,C'&DSN01'),
OVERLAY=(81:DATE1,21:85,2,23:87,2,25:83,2)),IFOUTLEN=80
/*
|
Assuming the file length is 80(as per my knowledge all the NDM control cards will be of length 80).
The SORTOUT will contain
| Code: |
SIGNON ESF=YES CASE=YES
SUBMIT PROC=PROC1 -
NEWNAME=XXXXXX -
PNODE=SYM1 -
SNODE=UNIX2 -
&SNDNODE=PNODE -
&RECNODE=SNODE -
&DSN01=ABC.XXX.YYY.D102407 -
&DISP01=(SHR,KEEP,KEEP) -
&DSN02='WORK/DATA/T1.TXT' -
&OPCJOB=XXXXXXX -
&OPCNODE=PNODE
SIGNOFF
|
|
|
| Back to top |
|
 |
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1477 Location: Bangalore,India
|
|
|
|
Deepa,
Does the file creation and transmission occur in the SAME JOB? If not what is the delay time? When does the creation job and transmission run (post with time)? |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4680 Location: San Jose, CA
|
|
|
|
| Quote: |
| The location of MMDDYY in the record varies depending on the DSN name length |
Deepa,
I guess Krisprems missed this because his solution assumes the Ddate will always start in position 21. From what you said, it can start in other positions. Some examples:
&DSN01=ABCDEF.X.QRSTU.DMMDDYY -
&DSN01=A.B.C.DMMDDYY -
Here's a DFSORT job that will replace the &DSN01 record correctly regardless of where the Ddate starts:
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,6,CH,EQ,C'&DSN01'),
PARSE=(%01=(ABSPOS=8,ENDAT=C'.',FIXLEN=9),
%02=(ENDAT=C'.',FIXLEN=9),
%03=(ENDAT=C'.',FIXLEN=9)),
BUILD=(C'&DSN01=',%01,%02,%03,71:DATE1),HIT=NEXT),
IFTHEN=(WHEN=(1,6,CH,EQ,C'&DSN01'),
OVERLAY=(51:C'D',75,4,73,2,71:10X,
1:1,80,SQZ=(SHIFT=LEFT,TRAIL=C' -')))
/*
|
|
|
| Back to top |
|
 |
Deepa.m Warnings : 1 Active User
Joined: 28 Apr 2005 Posts: 88
|
|
|
|
Frank,
Can i modify the same sort card for the below requirement
&DSN01=ABC.EF.X.QRSTU.DMMDDYY -
&DSN01=A.B.DMMDDYY -
where I have 4 qualifiers before DMMDDYY and sometimes only 2 qualifiers before DMMDDYY depending on the naming conventions we use.
The above code works for the fixed 3 qualifiers only.
&DSN01=ABCDEF.X.QRSTU.DMMDDYY -
&DSN01=A.B.C.DMMDDYY - |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4680 Location: San Jose, CA
|
|
|
|
Deepa,
Here's a DFSORT job that will handle any number of qualifiers. The trick is to use ENDBEFR=C'.DMMDDYY' in PARSE. Also, I used DATENS=(MDY) in INREC BUILD to get the mmddyy date more easily (I don't know why I didn't do that for the earlier job).
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=80,
IFTHEN=(WHEN=(1,6,CH,EQ,C'&DSN01'),
PARSE=(%01=(ENDBEFR=C'.DMMDDYY',FIXLEN=80)),
BUILD=(%01,81:C'.D',DATENS=(MDY)),HIT=NEXT),
IFTHEN=(WHEN=(1,6,CH,EQ,C'&DSN01'),
OVERLAY=(1,88,SQZ=(SHIFT=LEFT,TRAIL=C' -')))
/*
|
The following &DSN01 records:
| Code: |
&DSN01=ABC.XXX.YYY.DMMDDYY -
&DSN01=ABCDEF.X.QRSTU.DMMDDYY -
&DSN01=A.B.C.DMMDDYY -
&DSN01=ABC.EF.X.QRSTU.DMMDDYY -
&DSN01=A.B.DMMDDYY -
|
would be output today (12/03/07) as:
| Code: |
&DSN01=ABC.XXX.YYY.D120307 -
&DSN01=ABCDEF.X.QRSTU.D120307 -
&DSN01=A.B.C.D120307 -
&DSN01=ABC.EF.X.QRSTU.D120307 -
&DSN01=A.B.D120307 -
|
|
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4680 Location: San Jose, CA
|
|
|
|
You can replace MMDDYY anywhere in your records quite easily now with DFSORT's new FINDREP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
TDATE,S'&MON.&DAY.&YR2'
/*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INREC FINDREP=(IN=C'MMDDYY',OUT=TDATE)
/*
|
If you need the local date, you can use:
| Code: |
//SYMNAMES DD *
TDATE,S'&LMON.&LDAY.&LYR2'
/*
|
For complete details on the new FINDREP function and the other new functions available with PTF UK90013, see:
www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/ |
|
| Back to top |
|
 |
|
|
|