Re: SFTP Sortcard creating using DFSORT
Thanks a lot Kolusu .. Regards Ron -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: SFTP Sortcard creating using DFSORT
> Could you please help me to understand the below card as to how it > is picking the store_nbr and create Ron, The job is parsing the input for the delimiter "}". Since we don't care about the first 2 fields, they can be ignored. REPEAT=v can be used with % to specify v identically defined consecutive parsed fields to be ignored. v can be 2 to 1000. For example, to ignore five consecutive comma delimited fields, you can use: %=(ENDBEFR=C',',REPEAT=5), which is equivalent to using: %=(ENDBEFR=C','), %=(ENDBEFR=C','), %=(ENDBEFR=C','), %=(ENDBEFR=C','), %=(ENDBEFR=C','), and then we parsed the store number with %01 and then used Justify (JFY) to the parsed store number to add _ at the beginning using LEAD and the .CSV at the end using TRAIL keywords. If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from: http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T780 In your case look up for PARSE= and JFY= Thanks, Kolusu DFSORT Development IBM Corporation -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: SFTP Sortcard creating using DFSORT
Thanks a lot Kolusu.. it worked like a charm ! Could you please help me to understand the below card as to how it is picking the store_nbr and create NREC PARSE=(%=(REPEAT=2,ENDAT=C'}'), %01=(ENDBEFR=C'{', ENDBEFR=C' ', FIXLEN=8)), BUILD=(C' SPUT ''', C'K01.BB.RST.PTEM.FUTR.RTLDTA.REPT01''', C' FUTRETAIL_', DATE1(-)-1, %01,JFY=(SHIFT=LEFT, LEAD=C'_', TRAIL=C'.CSV', LENGTH=16)) Regards Ron T -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: SFTP Sortcard creating using DFSORT
> but the issue is the store_nbrs are of different length, the .csv is > not getting created correctly . Could some one let me know how we > can append the .csv also when the store is of variable length > Ron, Try this DFSORT JCL //STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * ITEM_NBR } ITEM_DESC1 } STORE_NBR } +1+2+3+4+5+- 500849599 }ENT MASSA TORTA 2 KG }33 500878286 }CAST DE CAJU TS 120G }331 500862526 }MTR MASS LASANH SECA }3 500877131 }PERU INTEIR C MIUDOS }3323 500034169 }ACUC FIT UNIAO }3311 500832360 }AMPOLA PANTENE UNIDA }33 //SORTOUT DD SYSOUT=* //SYSINDD * OPTION COPY,SKIPREC=1 INREC PARSE=(%=(REPEAT=2,ENDAT=C'}'), %01=(ENDBEFR=C'{', ENDBEFR=C' ', FIXLEN=8)), BUILD=(C' SPUT ''', C'K01.BB.RST.PTEM.FUTR.RTLDTA.REPT01''', C' FUTRETAIL_', DATE1(-)-1, %01,JFY=(SHIFT=LEFT, LEAD=C'_', TRAIL=C'.CSV', LENGTH=16)) /* Thanks, Kolusu DFSORT Development IBM Corporation -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
SFTP Sortcard creating using DFSORT
Hello- I am creating a dynamic SFTP sortcard using DFSORT, here in the Input file the Store_nbr is at position 40. I need the file to created as SPUT 'K01.BB.RST.PTEM.FUTR.RTLDTA.REPT01' FUTRETAIL_2020-12-07_33.csv but the issue is the store_nbrs are of different length, the .csv is not getting created correctly . Could some one let me know how we can append the .csv also when the store is of variable length Input File ---+1+2+3+4+ Top of Data ITEM_NBR } ITEM_DESC1 } STORE_NBR } 500849599 }ENT MASSA TORTA 2 KG }33 500878286 }CAST DE CAJU TS 120G }331 500862526 }MTR MASS LASANH SECA }3 500877131 }PERU INTEIR C MIUDOS }3323 500034169 }ACUC FIT UNIAO }3311 500832360 }AMPOLA PANTENE UNIDA }33 output card generated SPUT 'K01.BB.RST.PTEM.FUTR.RTLDTA.REPT01' FUTRETAIL_2020-12-07_33 SPUT 'K01.BB.RST.PTEM.FUTR.RTLDTA.REPT01' FUTRETAIL_2020-12-07_331 SPUT 'K01.BB.RST.PTEM.FUTR.RTLDTA.REPT01' FUTRETAIL_2020-12-07_3 SPUT 'K01.BB.RST.PTEM.FUTR.RTLDTA.REPT01' FUTRETAIL_2020-12-07_3323 SPUT 'K01.BB.RST.PTEM.FUTR.RTLDTA.REPT01' FUTRETAIL_2020-12-07_3311 SPUT 'K01.BB.RST.PTEM.FUTR.RTLDTA.REPT01' FUTRETAIL_2020-12-07_33 Control Card used SORT FIELDS=COPY OUTREC BUILD=(1:C'SPUT ', 6:C,7:C'K01.BB.RST.PTEM.FUTR.RTLDTA.REPT01', 41:C, 43:C'FUTRETAIL_', 53:DATE1(-)-1,63:C'_',64:40,4,21X) Regards Ron T -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN