Menu

Extracting a number from a string CSV - question

GnuCOBOL
Jason
2021-09-07
2021-09-07
  • Jason

    Jason - 2021-09-07

    Hello folks, i'm back on the COBOL train after a few months of another project.

    I'm feeling rusty. Please help.

    I have this entry in a CSV.

    I want to extract the number 19 and store it as an integer in a file.

    What's the best way to do this???

    https://www.site.com/brands/shoes,19

    Thank you for your help! :) Happy to be back in COBOL for a while.

     
  • Jose Manuel

    Jose Manuel - 2021-09-07

    01 wmyvar pic x(100)
    01 A pic x(100)
    01 B pic x(100)

    move "https://www.site.com/brands/shoes,19" to wmyvar
    unstring wmyvar delimited by ", into A B

     
  • Jason

    Jason - 2021-09-07

    Thats the one. Thanks Jose!

     

    Last edit: Jason 2021-09-07

Log in to post a comment.