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

NDM file transfer


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Deepa.m

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Wed Oct 24, 2007 2:56 pm
Reply with quote

I need to create a dynamic NDM card for file transfer between two systems. I have input file with generic card

Code:
SIGNON ESF=YES CASE=YES                                           
SUBMIT PROC=PROC1                                            - 
     NEWNAME=XXXXXX                                          - 
     PNODE=SYM1                                                 - 
     SNODE=UNIX2                                             - 
     &SNDNODE=PNODE                                             - 
     &RECNODE=SNODE                                             - 
     &DSN01=ABC.XXX.YYY.[i][b]DMMDDYY[/b][/i]                         - 
     &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
View user's profile Send private message
Deepa.m

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Wed Oct 24, 2007 3:03 pm
Reply with quote

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
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Wed Oct 24, 2007 3:15 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Oct 24, 2007 3:39 pm
Reply with quote

I think that in your case REXX will be much easier to write, test and maintain.

O.
Back to top
View user's profile Send private message
Deepa.m

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Wed Oct 24, 2007 4:49 pm
Reply with quote

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
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Wed Oct 24, 2007 4:59 pm
Reply with quote

Quote:
some Solution using JCL
Please wait for Frank to give solution to your reqt using DFSORT
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Oct 24, 2007 6:33 pm
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Oct 24, 2007 7:08 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Oct 24, 2007 10:09 pm
Reply with quote

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
View user's profile Send private message
Deepa.m

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Mon Dec 03, 2007 5:17 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon Dec 03, 2007 11:24 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Aug 19, 2008 4:13 am
Reply with quote

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:

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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top