# JSON serialization of empty or comma variables problem

**URL:** <https://community.openpbs.org/t/json-serialization-of-empty-or-comma-variables-problem/3123>\
**Category:** Users/Site Administrators\
**Created:** [June 6, 2022, 9:25am UTC](https://community.openpbs.org/t/json-serialization-of-empty-or-comma-variables-problem/3123 "2022-06-06T09:25:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikita-T86](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/nikita-t86/32/546_2.png) [@Nikita-T86](https://community.openpbs.org/u/Nikita-T86)\
**Post date:** [June 6, 2022, 9:25am UTC](https://community.openpbs.org/t/json-serialization-of-empty-or-comma-variables-problem/3123/1 "2022-06-06T09:25:45Z")

</div>

I have OpenPBS 20.0.1 and have a problem with qstat JSON serialization when one of my job variables is empty or contains comma.

Syntax that I tried:  
Empty variable: “qsub -v **RecordSeparator=** start.sh”  
Single quotes: “qsub -v **RecordSeparator=’’** start.sh”  
Double quotes: “qsub -v **RecordSeparator=""** start.sh”  
Comma: “qsub -v **RecordSeparator=,** start.sh”  
Comma in quotes: “qsub -v **RecordSeparator=","** start.sh”  
Escaped comma in quotes: “qsub -v **RecordSeparator="\,"** start.sh”

In all these cases the job is submitted, but when I look at job details with command "qstat -f -F json ", I see that this variable is serialized to

“RecordSeparator”:",PBS\_O\_QUEUE=workq",

I.e. PBS incorrecty treats next variable key as value of my empty variable. What I would expect is

“RecordSeparator”:"",  
“PBS\_O\_QUEUE”:“workq”

Furthermore with escaped comma PBS also produces line with incorrect json syntax, because \ is control character in json. I’d suggest to replace \ to \\ when serializing to json.

“Submit\_arguments”:"-q workq -l select=1:ncpus=48 -v RecordSeparator=\, start.sh",

Example json output (partial)

```auto
{
    "timestamp":1654506845,
    "pbs_version":"20.0.1",
    "Jobs":{
        "14228.ip-10-77-176-170":{
            "Job_Name":"start.sh",
            "Variable_List":{
                "PBS_O_LANG":"en_US.UTF-8",
                "PBS_O_SHELL":"/bin/bash",
                "PBS_O_SYSTEM":"Linux",
                "RecordSeparator":",PBS_O_QUEUE=workq",
                "PBS_O_HOST":"ip-10-77-176-170.eu-west-1.compute.internal"
            },
            "Submit_arguments":"-S /bin/bash -q workq -l select=1:ncpus=48 -v RecordSeparator= start.sh",
        }
    }
}

```
