View previous topic :: View next topic
|
Author |
Message |
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 145 Location: India
|
|
|
|
HI Everyone.
I have one file Input file lets say ABC.DVJ.File1 inside that input file I have another file name listed as name ABC.DVJ.FILE2 i want to extract this file and use it in my further step to copy the data from file ABC.DVJ.FILE2 to another file.
I have idea to do it with rexx I am just looking out way to do it with sort , Any idea to suggestion or sort step or any link to do refer this type of sorting would be great help here.
step1: I have already extracted the file name ABC.DVJ.FILE2 from file ABC.DVJ.File1 and it is being kept in one file from position 1 to 12.
step2 I want to use the extracted file name ABC.DVJ.FILE2 kept in output of above step as sortin to extract the data from it and copy it to another file. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2119 Location: USA
|
|
|
|
Any example of the REAL WORKING code: what have you tried so far?
Please, in coupe with all input/output/error information.
A hint (one of many):
Code: |
//REPRO EXEC PGM=IDCAMS
// . . . . . .
//COPYDATA DD DISP=(NEW,PASS),
// . . . . . . ,DCB=(required),
// DSN=&©DATA
//SYSIN DD *
REPRO INDATASET('extracted dsname here') -
OUTFILE(COPYDATA)
//*
//SORT EXEC PGM=SORT,COND=(4,LT)
// . . . . . . . . . . .
//SORTIN DD DISP=(OLD,DELETE),DSN=&©DATA
// . . . . . . . . |
Another hint:
Code: |
// EXPORT SYMLIST=*
// . . . . . .
//ALIAS EXEC PGM=IDCAMS
// . . . . . .
//SYSIN DD *,SYMBOLS=EXECSYS
DELETE -
'&SYSUID..UNIQUE.NAME.TO.HANDLE' -
ALIAS
DEFINE ALIAS -
( NAME('&SYSUID..UNIQUE.NAME.TO.HANDLE') -
RELATE('extracted dsname here') )
//*
//SORT EXEC PGM=SORT,COND=(4,LT)
// . . . . . . . . . . .
//SORTIN DD DISP=SHR,DSN=&SYSUID..UNIQUE.NAME.TO.HANDLE
// . . . . . . . . |
|
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1306 Location: Bamberg, Germany
|
|
|
|
I don't see why it would be a good idea to hide the dataset name in another dataset. Looks like a not so clever attempt of obfuscation. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1306 Location: Bamberg, Germany
|
|
|
|
Code: |
//PARSE EXEC PGM=ICEMAN
//SORTIN DD *
WHATEVER.INPUT.DSN
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD DISP=(NEW,PASS),UNIT=SYSALLDA,
// SPACE=(TRK,(1,0)),
// DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=0
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,44,JFY=(SHIFT=LEFT,LEAD=C' REPRO IDS(',
TRAIL=C') ODS(ABCD.ANOTHER.DSN)',LENGTH=80))
END
/*
//REPRO EXEC PGM=IDCAMS
//SYSIN DD DISP=(OLD,PASS),DSN=*.PARSE.SORTOUT
//SYSPRINT DD SYSOUT=* |
|
|
Back to top |
|
|
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 145 Location: India
|
|
|
|
Thanks @ Joerg.Findeisen
Could you please help me to understand the sort card that you ar e using above to achieve this..?
Code: |
/SYSIN DD *
OPTION COPY
INREC BUILD=(1,44,JFY=(SHIFT=LEFT,LEAD=C' REPRO IDS(',
TRAIL=C') ODS(ABCD.ANOTHER.DSN)',LENGTH=80))
END
and
//SYSIN DD DISP=(OLD,PASS),DSN=*.PARSE.SORTOUT
//SYSPRINT DD SYSOUT=* |
|
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1306 Location: Bamberg, Germany
|
|
|
|
Basically the SORT step sends the IDCAMS REPRO command to a temporary DSN which is passed to the next step as DD:SYSIN
Code: |
Data set name copied from
an earlier DD statement - *.ddname
*.stepname.ddname
*.stepname.procstepname.ddname |
|
|
Back to top |
|
|
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 145 Location: India
|
|
|
|
Thank you Everyone it worked with little modification. I have actually two ways to do one with Rexx and one with JCL , I started working on with Rexx so it worked for me. I will surely try this solution in my coming requirements.
Thank to all of you . |
|
Back to top |
|
|
|