|
View previous topic :: View next topic
|
| Author |
Message |
sonali L tambade
New User
Joined: 04 Nov 2020 Posts: 3 Location: India
|
|
|
|
I have a dynamically created input file which has transmission job details, I need to replace the node with my node and also the folder path with my path, I am able to achieve the replacement of node with IFTHEN/OVERLAY option but while doing same for folder path but it is going beyond 70 as the folder path is long , I tried splitting the line or replacing the path its not working. file is LRECL 70 FB.
Starting position is 3. Please help.
My input file has below records
| Code: |
SIGNON CASE=YES
SUBMIT PROC=ZZZZZZZZ -
PNODE=NODE1 -
SNODE=AAAAAAAAAAAA -
NEWNAME=BBBBBBBB -
&DSN1=TEMP.VB.DELTA -
&DSN2='eeeeeeeee/ABCD_D20201101_S01431_X_Y1_Z' -
&COMP=COMPRESS -
&EXT=EXT
SIGNOFF |
Expected output file -
| Code: |
SIGNON CASE=YES
SUBMIT PROC=ZZZZZZZZ -
PNODE=NODE1 -
SNODE=YYYYYYYYYYYY -
NEWNAME=BBBBBBBB -
&DSN1=TEMP.VB.DELTA -
&DSN2=\'/aaaa/bbbbbbb/cd/ddddd/eeeeeeeee/ffffff/\ || -
\ABCD_D20201101_S01431_X_Y1_Z'\ -
&COMP=COMPRESS -
&EXT=EXT
SIGNOFF |
Cod'ed |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
Welcome !!
Please make a use of Code tags. You can post what you tried instead of saying it. Second, confirm if this is what you want -
Find &DSN2= and push the current value to next line and add the one that you have hardcoded? It doesn't match in your example above as /fffffff/ is added after /eeeeeeeee/ in expected results.
You can think of using INREC IFTHEN=(WHEN=Condition, PUSH whatever is after &DSN2=)
in OUTREC you can BUILD using '/' operator to get the push'd value on to second line eliminating blank records.
Or
I believe, You can achieve using JOINKEYS too:) |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1424 Location: Bamberg, Germany
|
|
|
|
| Rohit Umarjikar wrote: |
| ..in OUTREC you can BUILD using '/' operator to get the push'd value on to second line eliminating blank records. |
This should work w/ OUTFIL but never in OUTREC. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| That’s right OUTFIL, it’s one of those auto spells🙂. Thanks Joerg. |
|
| Back to top |
|
 |
sonali L tambade
New User
Joined: 04 Nov 2020 Posts: 3 Location: India
|
|
|
|
Thanks for your replies, I was able to achieve the split of line with below and get it into output file-
INPUT - &DSN2='testflder/TEST_D20201101_S01431_C_P1_D' -
OUTPUT -
&DSN2='testflder/
TEST_D20201101_S01431_C_P1_D' -
SORT FIELDS=COPY
OUTFIL IFTHEN=(WHEN(10,10,CH,EQ,C'gcdudaily/'),
BUILD=(1,19,70:X,/,20,47))
Now I want to reformat below input
INPUT -
&DSN2='testflder/
TEST_D20201101_S01431_C_P1_D' -
Expected output -
&DSN2=\'/data/test/cd/DEV/testfolder/upload/\ || -
\TEST_D20201101_S01431_C_P1_D'\ -
I used below sort card but its not working, also I am not sure how to apen slash at the start and end of TEST_D20201101_S01431_C_P1_D
Please give some idea
//CTL1CNTL DD *
OPTION COPY
INREC IFOUTLEN=70,
IFTHEN=(WHEN(10,9,CH,EQ,C'testfolder'),
OVERLAY=(10:C'\'/data/test/cd/DEV/testfolder/upload/\ || -'))
/*
Thanks in advance for helping out |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1424 Location: Bamberg, Germany
|
|
|
|
Use code tags when presenting code and data!
| Code: |
//SPLITREP EXEC PGM=ICEMAN
//SORTIN DD *
&DSN2='eeeeeeeee/ABCD_D20201101_S01431_X_Y1_Z' -
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=(SORTOUT),
IFTHEN=(WHEN=(1,6,CH,EQ,C'&DSN2='),
PARSE=(%01=(STARTAFT=C'''',ENDBEFR=C'/',FIXLEN=60),
%02=(ENDBEFR=C'''',FIXLEN=60)),
BUILD=(C'&DSN2=\''/aaaa/bbbbbbb/cd/ddddd/',
C'eeeeeeeee/ffffff/\ !! -',/,
%02,SQZ=(SHIFT=LEFT,LEAD=C' ',TRAIL=C'''\ -',
LENGTH=60)))
END
/* |
No need to use ICETOOL, it's a simple task. |
|
| Back to top |
|
 |
sonali L tambade
New User
Joined: 04 Nov 2020 Posts: 3 Location: India
|
|
|
|
| Thanks a Ton! Joerg. It worked! got the expected output |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
The same story, again, and again: any advice given to new-coming “experts” is 100% ignored. They are waiting ONLY for a ready to copy-and-paste solution presented to them after all. Next step: “Thank you, Mr. Expert, it worked fine!” And after a short period of time the next question is posted here, to help with his new job assignment, and rather to do his job for him, free of charge...  |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|