You are correct that it was a REST job! Thank you for sharing this and for your time. I will be test with this solution, too.
Original Message:
Sent: Apr 11, 2025 11:13 AM
From: Eric Lontz
Subject: Drop double quote at end of 1400+ character string
So there are a couple of other ways you could go about this, as Ralf's will definitely work. I am assuming you are using a WebServiceRest JOBS due to the position 54 for your token start, as that is exactly where mine are at.
Using str_find with str_cut you can do.
:set &TODAY# = sys_date('MM-DD-YYYY')
:DELETE_VAR 'VARA.XXXX'
:SET &HND# = PREP_PROCESS_REPORT(,,,'*"access_token": "*')
:PROCESS &HND#
: SET &TOKEN# = GET_PROCESS_LINE(&HND#)
: SET &TOKEN2# = SUBSTR(&TOKEN#,54)
: set "epos# = str_find(&TOKEN2#,'"')
: set &cutlen# = "epos# - 1
: set &TOKEN2# = str_cut(&TOKEN2#,1,&cutlen#)
: print &TOKEN2#
: PUT_VAR VARA.XXXX,"&TODAY#","Bearer &TOKEN2#"
:ENDPROCESS
:CLOSE_PROCESS &HND#
:PSET &TOKEN2# = GET_VAR(VARA.XXXX, &TODAY#, "1")
Alternately you can go to the Response tab and add parsing then you can just store it with put_var and retrieve with get_var
:set &TODAY# = sys_date('MM-DD-YYYY')
:PUT_VAR VARA.XXXX,"&TODAY#","Bearer &ACCESS_TOKEN#"
:PSET &TOKEN2# = GET_VAR(VARA.XXXX, &TODAY#, "1")

Original Message:
Sent: Apr 10, 2025 04:45 PM
From: Michele Adamski
Subject: Drop double quote at end of 1400+ character string
I'm running a job to obtain a token. The token length is varying and over 1430 characters. I'm doing a SUBSTR starting at position 54 and dropping it into a static variable to be passed into a succeeding job. This is working, however, there is a double quote at the end of the string that I need to remove so I cannot simply use STR_CUT.
None of the STR_* script elements seem appropriate to strip it out. Would anyone know how to solve this?
This is what I have so far:
:DELETE_VAR VARA.XXXX
:SET &HND# = PREP_PROCESS_REPORT(,,,'*"access_token": "*')
:PROCESS &HND#
: SET &TOKEN# = GET_PROCESS_LINE(&HND#)
: SET &TOKEN2# = SUBSTR(&TOKEN#,54)
: PUT_VAR VARA.XXXX,"&TODAY#","Bearer &TOKEN2#"
:ENDPROCESS
:CLOSE_PROCESS &HND#
:PSET &TOKEN2# = GET_VAR(VARA.XXXX, &TODAY#, "1")
Thanks! (I may have posted this twice.)