Copy rest of the records



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Copy rest of the records

Postby deva_048 » Wed Apr 03, 2013 4:15 pm

In jcl if column (1,3,ch,eq,c'ram') then we need to copy from ram to end of records in input file
E.g)
input dataset
aaaaa
bbbbbbbbbbbbbbbbbbb
ram
cccccccccccccccc
.......
.......

o/p should be in new dataset
ram
cccccccccccccccc
.......
.......


Please advice
deva_048
 
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Copy rest of the records

Postby BillyBoyo » Wed Apr 03, 2013 4:29 pm

I have assumed you records are FB and 80 bytes long.

If you are one who likes to learn, add this into your JCL (say, before SYSIN):

//SYMNAMES DD *
INPUT-RECORD,1,80,CH
EXTEND-FOR-INCLUDE-VALUE,*,3,CH
TEXT-TO-CHECK,1,=,=
TEXT-FOR-COPY-TO-END,C'ram'
//SYMNOUT DD SYSOUT=*


Use these as your control cards:

  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,
                 BEGIN=(TEXT-TO-CHECK,
                       EQ,
                        TEXT-FOR-COPY-TO-END),
                 PUSH=(EXTEND-FOR-INCLUDE-VALUE:
                       TEXT-TO-CHECK))

  OUTFIL INCLUDE=(EXTEND-FOR-INCLUDE-VALUE,
                 EQ,
                  TEXT-FOR-COPY-TO-END)


If you just want a solution, try this:

  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'ram'),
                 PUSH=(81:1,3))
  OUTFIL INCLUDE=(81,3,CH,EQ,C'ram')
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Copy rest of the records

Postby deva_048 » Wed Apr 03, 2013 5:22 pm

Thanks billy...It works like a charm ... Thanks a lot for your help.... but minor syntax error next TEXT-TO-CHECK , missed in control card.
deva_048
 
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Copy rest of the records

Postby NicC » Wed Apr 03, 2013 5:36 pm

In jcl if column (1,3,ch,eq,c'ram')

If columns 1-3 are 'ram' then it is NOT JCL - it is data. Column 1 of JCL always has '/' and column 2 is usually '/' but can be '*'.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Copy rest of the records

Postby BillyBoyo » Wed Apr 03, 2013 5:52 pm

deva_048 wrote:Thanks billy...It works like a charm ... Thanks a lot for your help.... but minor syntax error next TEXT-TO-CHECK , missed in control card.


Thanks for the feedback, fixed now in original.

I hope that you understand the use of the symbols, they can make Sort Control Cards much easier to code and understand.

EDIT:

I missed one on the OUTFIL. Update that on yours, the results will be the same.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post